Update dev guideline

pull/1566/head
Louis Lam 3 years ago
parent 4114f43b48
commit 94ada36dfa

@ -79,7 +79,7 @@ I personally do not like something need to learn so much and need to config so m
- 4 spaces indentation - 4 spaces indentation
- Follow `.editorconfig` - Follow `.editorconfig`
- Follow ESLint - Follow ESLint
- Methods and funtions should be documented with JSDoc - Methods and functions should be documented with JSDoc
## Name convention ## Name convention
@ -90,9 +90,10 @@ I personally do not like something need to learn so much and need to config so m
## Tools ## Tools
- Node.js >= 14 - Node.js >= 14
- NPM >= 8.5
- Git - Git
- IDE that supports ESLint and EditorConfig (I am using IntelliJ IDEA) - IDE that supports ESLint and EditorConfig (I am using IntelliJ IDEA)
- A SQLite tool (SQLite Expert Personal is suggested) - A SQLite GUI tool (SQLite Expert Personal is suggested)
## Install dependencies ## Install dependencies
@ -100,39 +101,42 @@ I personally do not like something need to learn so much and need to config so m
npm ci npm ci
``` ```
## How to start the Backend Dev Server ## Dev Server
(2021-09-23 Update) (2022-04-26 Update)
We can start the frontend dev server and the backend dev server in one command.
Port `3000` and port `3001` will be used.
```bash ```bash
npm run start-server-dev npm run dev
``` ```
It binds to `0.0.0.0:3001` by default. ## Backend Server
### Backend Details For development, it binds to `0.0.0.0:3001` by default.
For production, it binds to `0.0.0.0:3000` by default.
It is mainly a socket.io app + express.js. It is mainly a socket.io app + express.js.
express.js is just used for serving the frontend built files (index.html, .js and .css etc.) express.js is just used for serving the frontend built files (index.html, .js and .css etc.)
### Structure in /server/
- model/ (Object model, auto mapping to the database table name) - model/ (Object model, auto mapping to the database table name)
- modules/ (Modified 3rd-party modules) - modules/ (Modified 3rd-party modules)
- notification-providers/ (individual notification logic) - notification-providers/ (individual notification logic)
- routers/ (Express Routers) - routers/ (Express Routers)
- socket-handler (Socket.io Handlers) - socket-handler (Socket.io Handlers)
- server.js (Server main logic) - server.js (Server entry point and main logic)
## How to start the Frontend Dev Server ## Frontend Dev Server
1. Set the env var `NODE_ENV` to "development". It binds to `0.0.0.0:3000` by default. Frontend dev server is used for development only.
2. Start the frontend dev server by the following command.
```bash
npm run dev
```
It binds to `0.0.0.0:3000` by default. For production, it is not used. It will be compiled to `dist` directory instead.
You can use Vue.js devtools Chrome extension for debugging. You can use Vue.js devtools Chrome extension for debugging.

Loading…
Cancel
Save