- TypeScript configured
- JWT based authentication and middleware
- User signup and login
- Sequelize ORM for database interaction
In the project directory, you can run:
Runs the server in development mode.
Open http://localhost:8000 to in your browser, you will see Express.js server is running!
.
Runs the server in development mode with hotload. Hotload configured by nodemon
Builds the app for production to the dist
folder.
After build the project, Runs the development/production server. Entry file is dist/index.js
.
root
|
|- dist/
|
|- node_modules/
|
|- src/
| |- config/
| | |- database.ts
| |
| |- controller/
| | |- auth.controller.ts
| |
| |- interfaces/
| | |- interfaces.ts
| |
| |- middleware/
| | |- auth.middleware.ts
| |
| |- model/
| | |- user.model.ts
| |
| |- routes/
| | |- auth.route.ts
| | |- index.ts
| |
| |- types/
| |
| |- index.ts
|
|- static/
|
|- .env
|- .env.example
|- .gitignore
|- nodemon.json
|- package-lock.json
|- package.json
|- README.md
|- tsconfig.json
If you use SPA for your frontend, copy compiled result into static
folder.
Set environment variable DB_SYNC=true
to synchronize models and database. Otherwise, set it as false
. Learn more about model synchronization here. Since Sequelize has various versions, you can check Sequelize official site here.