docs: update

This commit is contained in:
Takeshi Kimata
2024-07-29 22:01:06 +09:00
parent 1b61567ae7
commit 0da8e4129e
11 changed files with 110 additions and 73 deletions

View File

@@ -0,0 +1,4 @@
{
"label": "Development",
"position": 4
}

42
docs/docs/dev/backend.md Normal file
View 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`

160
docs/docs/dev/er.md Normal file
View File

@@ -0,0 +1,160 @@
---
sidebar_position: 4
---
# Entity Relationship
<div style={{overflowX: 'auto'}}>
<div style={{width: '200%'}}>
```mermaid
erDiagram
users ||--o{ projects : "user has projects"
users ||--o{ members : "user belongs to the project via the members table"
projects ||--o{ members: "project has members"
projects ||--o{ folders: "project has folders"
projects ||--o{ runs: "project has runs"
projects ||--o{ "plans(unimplemented)": "project has plans"
"plans(unimplemented)" ||--o{ "planRuns(unimplemented)": "plan has planRuns"
runs ||--o{ "planRuns(unimplemented)": "run has planRuns"
folders ||--o{ cases: "folder has cases"
cases ||--o{ caseSteps: "has"
steps ||--o{ caseSteps: "has"
cases ||--o{ caseAttachments: "has"
attachments ||--o{ caseAttachments: "has"
cases ||--o{ "caseTags(unimplemented)": "has"
"tags(unimplemented)" ||--o{ "caseTags(unimplemented)": "has"
users {
integer id PK
string email
string password
string username
integer role
string avatarPath
timestamp created_at
timestamp deleted_at
}
projects {
integer id PK
string name
string detail
boolean isPublic
integer userId FK
timestamp created_at
timestamp deleted_at
}
members {
integer id PK
integer userId FK
integer projectID FK
integer role
}
folders {
integer id PK
string name
string detail
integer parentFolderId
integer projectId FK
timestamp created_at
timestamp deleted_at
}
runs {
integer id PK
string name
string configurations
string description
integer state
integer projectId FK
timestamp created_at
timestamp deleted_at
}
"plans(unimplemented)" {
integer id PK
string name
string description
timestamp startDate
timestamp endDate
integer projectId FK
timestamp created_at
timestamp deleted_at
}
"planRuns(unimplemented)" {
integer id PK
integer planId FK
integer runId FK
timestamp created_at
timestamp deleted_at
}
cases {
integer id PK
string title
integer state
integer priority
integer type
integer automationStatus
string description
integer template
string preConditions
string expectedResults
integer folderId FK
timestamp created_at
timestamp deleted_at
}
steps {
integer id PK
string step
string result
timestamp created_at
timestamp deleted_at
}
caseSteps {
integer id PK
integer caseId FK
integer stepId FK
integer stepNo
}
attachments {
integer id PK
string title
string detail
string path
timestamp created_at
timestamp deleted_at
}
caseAttachments {
integer id PK
integer caseId FK
integer attachmentId FK
}
"tags(unimplemented)" {
integer id PK
string name
integer projectId FK
timestamp created_at
timestamp deleted_at
}
"caseTags(unimplemented)" {
integer id PK
integer caseId FK
integer tagId FK
timestamp created_at
timestamp deleted_at
}
```
</div>
</div>

32
docs/docs/dev/frontend.md Normal file
View 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
```

View 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 |