Skip to content

A basic starter template for starting your next ExpressJS project with MySQL & Sequelize.

License

Notifications You must be signed in to change notification settings

FHB369/express-sequelize-mysql-starter

Repository files navigation

Express-Sequelize-MySQL starter project

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

  1. Install node
  2. Install yarn
  3. Install XAMPP

How to run

  1. Go to the project root directory
  2. Run yarn install on terminal/CMD
  3. Then run yarn global add sequelize-cli nodemon on terminal/CMD
  4. Create a file named .env in the root directory & copy the texts from .env.example
  5. Create a MySql DB & change the value of database in /configs/dbConfig.json
  6. Then run migrations. The commands for migration & creating model are listed below in DB Commands section
  7. Go back to root directory and run yarn start
  8. Now your backend will be running on localhost:8000

DB Commands

  1. For creating a model, run sequelize model:create --name TableName --attributes columnName:string, ...
  2. 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.

About

A basic starter template for starting your next ExpressJS project with MySQL & Sequelize.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published