Skip to content

A boilerplate for node.js + express.js with Controller Service and Repository pattle. This bolierplate is using Sequelize for Object-relational mapping.

License

Notifications You must be signed in to change notification settings

pitchayakit/node-express-boilerplate

Repository files navigation

Node Express Boilerplate

A boilerplate for node.js + express.js with Controller Service and Repository pattle. This bolierplate is using Sequelize for Object-relational mapping.

Table of Contents

  1. Container
  2. Run Server
  3. Database Migration
  4. Database Seeding
  5. Download Example

Container

To get started with the available container, run the following command:

docker-compose up

This command will start all the services defined in your docker-compose.yml file.

Run Server

Before running the server, make sure you have Node.js and npm installed on your machine. After cloning the repository, navigate to the project directory and install the necessary packages using npm:

npm install

Once the packages are installed, you can start the server by running:

npm run serve

Database Migration

Database migration is the process of transforming data from one format to another. In this project, we use Sequelize CLI for database migration. To migrate the database, use the following command:

npx sequelize-cli db:migrate

Database Seeding

Database seeding is the initial seeding of a database with data. This data can be dummy data used for testing or initial data required for the application to run. To seed the database, use the following command:

npx sequelize-cli db:seed:all

After seeding you will get ramdom users with email and password is "test" which can use to be credentials to login.

Download Example

Postman

Please replace the placeholders with the actual content relevant to your project.

About

A boilerplate for node.js + express.js with Controller Service and Repository pattle. This bolierplate is using Sequelize for Object-relational mapping.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published