Node.js, Express, PostgreSQL Scaffolder for RESTful API servers.
With heavily borrowed ideas from node-express-boilerplate.
Clone the repository and remove the git database folder:
git clone --depth 1 https://github.com/fernandocanizo/neps.git your-brand-new-project
cd your-brand-new-project
rm -rf .git
Install dependencies:
pnpm install
Precise instructions on how to create a role and database are out of the scope of this documentation, but here's a quick example using defaults:
sudo su
su postgres
createuser -i neps
exit
exit
psql -U neps postgres
postgres=> create database neps;
exit
Edit build/config/index.js
appropriately with database connections details
and chmod 700 build/config
and chmod 600 build/config/index.js
to improve
security.
Migrate database with:
npm run migrate
Note: I prefer forward-only migrations, since experience has showed me
that you cannot do a realiable rollback in production. However sometimes
rollbacks are useful in development, so if you want, postgrator
allows them,
so they can be used.
- EditorConfig configuration
- Code formatting with Prettier
- Standard linted
- Husky git hooks to run checkers when needed
- Postgrator-cli for database migrations
- DotEnv configuration