Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diomalta/boilerplate-nodejs-expressjs-postgres
🛸 Quick starter (API Rest) with Node, Express and Postgres.
https://github.com/diomalta/boilerplate-nodejs-expressjs-postgres
Last synced: 2 months ago
JSON representation
🛸 Quick starter (API Rest) with Node, Express and Postgres.
- Host: GitHub
- URL: https://github.com/diomalta/boilerplate-nodejs-expressjs-postgres
- Owner: diomalta
- Created: 2019-04-28T17:32:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T21:43:50.000Z (about 2 years ago)
- Last Synced: 2023-03-06T23:09:19.630Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 1.75 MB
- Stars: 8
- Watchers: 0
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Node + Express + Sequelize Quick Starter project
The goal of this project is to provide a starting base for an api node with postgres.
Features:
- Postgres user store/update/get/delete and login
- Automatic restarts _(when server code changes)_
- Logs server when requests
- handling unexpected errors
- Token based authentication
- Husky controls hooks of test and lint when run "git commit"
- Eslint configured with Google Standard
- Jest + Supertest for create tests unit and of integration for app
- # `async/await` support
🔰 Node + Express + Sequelize Quick Starter project---
The goal of this project is to provide a starting base for an api node with postgres.
📰Features:
- Postgres user store/update/get/delete and login
- Automatic restarts _(when server code changes)_
- Logs server when requests
- handling unexpected errors
- Token based authentication
- Husky controls hooks of test and lint when run "git commit"
- Eslint configured with Google Standard
- Jest + Supertest for create tests unit and of integration for app
- `async/await` support## How to run
For development:
npm run dev or yarn dev
For production:
npm run start or yarn start
## How to run lint or test
Run lint:
npm run lint or yarn lint
Run test:
npm run test or yarn test
## Requirements
Node 6+
Postgres server## Goals
- Structure for real application.
- Avoid duplication of code.
- Separate business rules from the control layer.
- Control unexpected errors.
- Test for application of unit and integration.
- Style guides for formatting code.## Project structure
```
src
│ app.js # App entry point
│ server.js # Run aplication
│ routes.js # Express routes
└───app
└───controllers # All that is required for the endpoints
└───models # Database models
└───services # All the business logic is here
└───jobs # Jobs definitions for agenda.js (coming soon)
└───subscribers # Event handlers for async task (coming soon)
└───config # Environment variables and configuration related stuff
└───constants # Are fixed values
└───database # For control have of DB version, table creation, and data entry
└───middlewares # All that is filter for controll
```## Author
Diego Malta