docs: update
This commit is contained in:
@@ -1,43 +0,0 @@
|
|||||||
# unittcms Backend
|
|
||||||
|
|
||||||
## Install dependencies
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
## Set Environmental variable
|
|
||||||
|
|
||||||
Create `.env` File
|
|
||||||
|
|
||||||
```
|
|
||||||
FRONTEND_ORIGIN=http://localhost:8000
|
|
||||||
PORT=8001
|
|
||||||
SECRET_KEY=your-secret-key
|
|
||||||
```
|
|
||||||
|
|
||||||
## Set up database
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run migrate
|
|
||||||
```
|
|
||||||
|
|
||||||
## Run the development server
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node --env-file=.env index.js
|
|
||||||
```
|
|
||||||
|
|
||||||
## Database operation command
|
|
||||||
|
|
||||||
### drop table
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run drop
|
|
||||||
```
|
|
||||||
|
|
||||||
### add seed data
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run seed
|
|
||||||
```
|
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node index",
|
"start": "node --env-file=.env index",
|
||||||
|
"dev": "node index",
|
||||||
"migrate": "bash scripts/migrate.sh",
|
"migrate": "bash scripts/migrate.sh",
|
||||||
"seed": "bash scripts/seed.sh",
|
"seed": "bash scripts/seed.sh",
|
||||||
"drop": "bash scripts/drop.sh"
|
"drop": "bash scripts/drop.sh"
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"label": "Architecuture",
|
|
||||||
"position": 5
|
|
||||||
}
|
|
||||||
4
docs/docs/dev/_category_.json
Normal file
4
docs/docs/dev/_category_.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"label": "Development",
|
||||||
|
"position": 4
|
||||||
|
}
|
||||||
42
docs/docs/dev/backend.md
Normal file
42
docs/docs/dev/backend.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 2
|
||||||
|
---
|
||||||
|
|
||||||
|
# Backend
|
||||||
|
|
||||||
|
## Environmental variables
|
||||||
|
|
||||||
|
:::warning[Strongly Recommended]
|
||||||
|
|
||||||
|
Although the system will work with default settings without setting environment variables, it is strongly recommended to set SECRET_KEY in production.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
Create `.env` File on `backend/`
|
||||||
|
|
||||||
|
```.env
|
||||||
|
FRONTEND_ORIGIN=http://localhost:8000
|
||||||
|
PORT=8001
|
||||||
|
SECRET_KEY=your-secret-key
|
||||||
|
```
|
||||||
|
|
||||||
|
## Set up database
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run migrate
|
||||||
|
```
|
||||||
|
|
||||||
|
## Start backend server
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run start
|
||||||
|
```
|
||||||
|
|
||||||
|
If you do not bother to place `.env` files, such as in a development environment, you can start the server with `npm run dev`.
|
||||||
|
|
||||||
|
## Database operation
|
||||||
|
|
||||||
|
The following commands may be useful when trying things out in development:
|
||||||
|
|
||||||
|
- drop tables: `npm run drop`
|
||||||
|
- insert seed data: `npm run seed`
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 1
|
sidebar_position: 4
|
||||||
---
|
---
|
||||||
|
|
||||||
# Entity Relationship
|
# Entity Relationship
|
||||||
32
docs/docs/dev/frontend.md
Normal file
32
docs/docs/dev/frontend.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 3
|
||||||
|
---
|
||||||
|
|
||||||
|
# Frontend
|
||||||
|
|
||||||
|
## Environmental variables
|
||||||
|
|
||||||
|
:::info
|
||||||
|
|
||||||
|
Although the system will work with default settings without setting environment variables, but you can override the settings by setting environment variables.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
Create `.env` File on `frontend/`
|
||||||
|
|
||||||
|
```
|
||||||
|
NEXT_PUBLIC_BACKEND_ORIGIN=http://localhost:8001
|
||||||
|
```
|
||||||
|
|
||||||
|
## Start frontend server with dev mode
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Start frontend server with production mode
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run build
|
||||||
|
npm run start
|
||||||
|
```
|
||||||
26
docs/docs/dev/technologies.md
Normal file
26
docs/docs/dev/technologies.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
sidebar_position: 1
|
||||||
|
---
|
||||||
|
|
||||||
|
# Technologies
|
||||||
|
|
||||||
|
UnitTCMS is powered by following technologies. For more detailed package and version information, please see package.json.
|
||||||
|
|
||||||
|
## Frontend
|
||||||
|
|
||||||
|
| Technology | Use |
|
||||||
|
| ----------------------------------------------- | -------------------- |
|
||||||
|
| [React](https://react.dev/) | Rendering |
|
||||||
|
| [Next.js](https://nextjs.org/) | Routing, etc. |
|
||||||
|
| [NextUI](https://nextui.org/) | UI library |
|
||||||
|
| [next-intl](https://next-intl-docs.vercel.app/) | Internationalization |
|
||||||
|
| [ApexCharts](https://apexcharts.com/) | Charts |
|
||||||
|
|
||||||
|
## Backend
|
||||||
|
|
||||||
|
| Technology | Use |
|
||||||
|
| ----------------------------------- | ------------------ |
|
||||||
|
| [Node.js](https://nodejs.org/en) | JavaScript runtime |
|
||||||
|
| [Express](https://expressjs.com/) | API Server |
|
||||||
|
| [Sequelize](https://sequelize.org/) | ORM |
|
||||||
|
| [SQLite](https://www.sqlite.org/) | database |
|
||||||
@@ -24,7 +24,7 @@ Move to backend directory, then install dependencies.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd backend
|
cd backend
|
||||||
npm install
|
npm ci
|
||||||
```
|
```
|
||||||
|
|
||||||
Initialize the database with the following command.
|
Initialize the database with the following command.
|
||||||
@@ -45,7 +45,7 @@ Move to frontend directory, then install dependencies.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd frontend
|
cd frontend
|
||||||
npm install
|
npm ci
|
||||||
```
|
```
|
||||||
|
|
||||||
Build frontend code
|
Build frontend code
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"label": "Roadmap",
|
"label": "Roadmap",
|
||||||
"position": 4
|
"position": 5
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
# unittcms Frontend
|
|
||||||
|
|
||||||
## Install dependencies
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
## Set Environmental variable
|
|
||||||
|
|
||||||
Create `.env` File
|
|
||||||
|
|
||||||
```
|
|
||||||
NEXT_PUBLIC_BACKEND_ORIGIN=http://localhost:8001
|
|
||||||
```
|
|
||||||
|
|
||||||
## Run the development server
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user