This is a boilerplate to build a starting API with Node.js, Express and PostgreSQL on ES6. It is also configured with babel.
This is a starting application for create an API with a Node.js and Express, using PostgreSQL for database and Sequelize as ORM.
The server side Express code will be served by a node server using Nodemon which helps in automatically restarting the server whenever server side code changes.
# Clone the repository
git clone git@github.com:ParmentierChristophe/simple-nodejs-postgresql.git
or
git clone https://github.com/ParmentierChristophe/simple-nodejs-postgresql.git
# Go inside the directory
cd simple-nodejs-postgresql
# Install dependencies
yarn (or npm install)
# Start development server
yarn dev (or npm run dev)
the entrance of the application is index.js
, on folder database
All files created by Sequelize (migrations, seeds, models, config) and on folder server
all files for API and for server (config, modules, controllers, middlewares).
In the database folder you already have two models and the migration files for creating two Posts
and Users
tables with a relationship. to create these tables, make with Sequelize:
sequelize db:migrate
You also seeds, make with Sequilize :
sequelize db:seed:all
Thanks goes to these wonderful people (emoji key):
Antoine Caron 💻 🤔 👀 |
This project follows the all-contributors specification. Contributions of any kind welcome!