NodeJS boilerplate project
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Make sure you have Node.js and Docker (preferably) installed. This will make it easy to run the project locally and all tests without having to install PostgreSQL and Redis onto your system.
Install all dependencies
npm installThis repository contains a docker-compose.yml file providing PostgreSQL and Redis.
Start PostgreSQL in daemon mode:
docker-compose up -d postgresThe project uses a sql query builder called knex.js which provides migration support.
Run all migrations via npm run db:migrate.
- This will take you
DATABASE_URLfrom the environment variables.
The project uses a sql query builder called knex.js which provides seeding support.
Run all initial seeds via npm run db:seed.
- This will take you
DATABASE_URLfrom the environment variables. - It will use
INITIAL_SEED_USERNAMEandINITIAL_SEED_PASSWORDfrom the environment variables to create an initial Admin user.
Start redis in daemon mode:
docker-compose up -d redis- Make sure you have all environment variables set in an
.envfile. There is an.env.examplefile provided with all required and optional variables. - Make sure you have a running PostgreSQL and Redis instance
// Start
npm run start
// Build and start
npm run serve- Make sure you have a running PostgreSQL and Redis instance. Connection strings can be altered in the
test.config.tsfile under thetestsfolder. This will take the provided docker container strings by default.
npm run testnpm run test:coverage- Make sure to build the Typescript project before deploying onto Heroku or another provider.
- TravisCI is included in this project, but is not required to run deployments or test suites.
When you find issues, please report them:
Be sure to include all of the output from the npm command that didn't work as expected. The npm-debug.log file is also helpful to provide.
See the list of contributors who participated in this project.
This project is licensed under the ISC License - see the LICENSE.md file for details
