A basic starter template for starting your next ExpressJS project with MySQL & Sequelize. You can start working on your app from very scratch with this template.
Prerequisite
How to run
- Go to the project root directory
- Run
yarn install
on terminal/CMD - Then run
yarn global add sequelize-cli nodemon
on terminal/CMD - Create a file named
.env
in the root directory & copy the texts from.env.example
- Create a MySql DB & change the value of database in
/configs/dbConfig.json
- Then run migrations. The commands for migration & creating model are listed below in DB Commands section
- Go back to root directory and run
yarn start
- Now your backend will be running on localhost:8000
DB Commands
- For creating a model, run
sequelize model:create --name TableName --attributes columnName:string, ...
- For migration, run
sequelize db:migrate
All other sequelize commands are available here Sequelize Documentation
Running on Docker
The Dockerfile is also included. You need to just build the image using
docker build -t express-sequelize-mysql-starter
and run using
docker run express-sequelize-mysql-starter
.