From 0da8e4129ecbeef78cde063c465b7a205b72d85e Mon Sep 17 00:00:00 2001 From: Takeshi Kimata <117462761+kimatata@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:01:06 +0900 Subject: [PATCH] docs: update --- backend/README.md | 43 -------------------------- backend/package.json | 3 +- docs/docs/architecture/_category_.json | 4 --- docs/docs/dev/_category_.json | 4 +++ docs/docs/dev/backend.md | 42 +++++++++++++++++++++++++ docs/docs/{architecture => dev}/er.md | 2 +- docs/docs/dev/frontend.md | 32 +++++++++++++++++++ docs/docs/dev/technologies.md | 26 ++++++++++++++++ docs/docs/getstarted/manual.md | 4 +-- docs/docs/roadmap/_category_.json | 2 +- frontend/README.md | 21 ------------- 11 files changed, 110 insertions(+), 73 deletions(-) delete mode 100644 backend/README.md delete mode 100644 docs/docs/architecture/_category_.json create mode 100644 docs/docs/dev/_category_.json create mode 100644 docs/docs/dev/backend.md rename docs/docs/{architecture => dev}/er.md (94%) create mode 100644 docs/docs/dev/frontend.md create mode 100644 docs/docs/dev/technologies.md delete mode 100644 frontend/README.md diff --git a/backend/README.md b/backend/README.md deleted file mode 100644 index 18c0dcb..0000000 --- a/backend/README.md +++ /dev/null @@ -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 -``` diff --git a/backend/package.json b/backend/package.json index aa50781..577e435 100644 --- a/backend/package.json +++ b/backend/package.json @@ -3,7 +3,8 @@ "version": "1.0.0", "private": true, "scripts": { - "start": "node index", + "start": "node --env-file=.env index", + "dev": "node index", "migrate": "bash scripts/migrate.sh", "seed": "bash scripts/seed.sh", "drop": "bash scripts/drop.sh" diff --git a/docs/docs/architecture/_category_.json b/docs/docs/architecture/_category_.json deleted file mode 100644 index 152b300..0000000 --- a/docs/docs/architecture/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Architecuture", - "position": 5 -} diff --git a/docs/docs/dev/_category_.json b/docs/docs/dev/_category_.json new file mode 100644 index 0000000..d57edee --- /dev/null +++ b/docs/docs/dev/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Development", + "position": 4 +} diff --git a/docs/docs/dev/backend.md b/docs/docs/dev/backend.md new file mode 100644 index 0000000..3b2c84f --- /dev/null +++ b/docs/docs/dev/backend.md @@ -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` diff --git a/docs/docs/architecture/er.md b/docs/docs/dev/er.md similarity index 94% rename from docs/docs/architecture/er.md rename to docs/docs/dev/er.md index 8c21dab..cc2ae0d 100644 --- a/docs/docs/architecture/er.md +++ b/docs/docs/dev/er.md @@ -1,5 +1,5 @@ --- -sidebar_position: 1 +sidebar_position: 4 --- # Entity Relationship diff --git a/docs/docs/dev/frontend.md b/docs/docs/dev/frontend.md new file mode 100644 index 0000000..a0e50c2 --- /dev/null +++ b/docs/docs/dev/frontend.md @@ -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 +``` diff --git a/docs/docs/dev/technologies.md b/docs/docs/dev/technologies.md new file mode 100644 index 0000000..8ea7434 --- /dev/null +++ b/docs/docs/dev/technologies.md @@ -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 | diff --git a/docs/docs/getstarted/manual.md b/docs/docs/getstarted/manual.md index 20b6fa4..11f4535 100644 --- a/docs/docs/getstarted/manual.md +++ b/docs/docs/getstarted/manual.md @@ -24,7 +24,7 @@ Move to backend directory, then install dependencies. ```bash cd backend -npm install +npm ci ``` Initialize the database with the following command. @@ -45,7 +45,7 @@ Move to frontend directory, then install dependencies. ```bash cd frontend -npm install +npm ci ``` Build frontend code diff --git a/docs/docs/roadmap/_category_.json b/docs/docs/roadmap/_category_.json index 5e977d7..514be2a 100644 --- a/docs/docs/roadmap/_category_.json +++ b/docs/docs/roadmap/_category_.json @@ -1,4 +1,4 @@ { "label": "Roadmap", - "position": 4 + "position": 5 } diff --git a/frontend/README.md b/frontend/README.md deleted file mode 100644 index ec8aa56..0000000 --- a/frontend/README.md +++ /dev/null @@ -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 -```