Skip to content

A boilerplate for building RESTful APIs using Node.js, PostgreSQL, koa, knex, bookshelf.

Notifications You must be signed in to change notification settings

silaasdantas/nodejs-back-boilerplate

Repository files navigation

Node API boilerplate by nave.rs

A boilerplate for building RESTful APIs using Node.js, PostgreSQL, koa, knex, bookshelf.

Getting started

Installation

  1. Install Node.JS latest version
  2. Install PostgreSQL
  3. Clone this repository
  4. Install dependencies, just run in project folder: yarn or npm install

Things to do before run the project:

  1. Create database (by follow the commands):
  • CREATE USER user WITH PASSWORD password
  • CREATE DATABASE database
  • GRANT ALL PRIVILEGES ON DATABASE database to user
  1. Change name value of .env.example to .env and set the key SECRET to any value you wish
  2. Change DATABASE_URL to postgress://user:password@localhost/database
  3. Run migrations: yarn db:migrate
  4. Run seeds: yarn db:seed
  5. Run yarn start or yarn dev to start server

Testing

  1. Run tests: yarn test

Directory Structure

├── /src
|   ├── /controllers
|   ├── /database
|   |    ├── /migrations
|   |    ├── /seeds
|   ├── /helpers
|   ├── /middleware
|   ├── /models
|   ├── /routes
|   ├── /validators
├── /test

Styleguide

Standard - JavaScript Style Guide

About

A boilerplate for building RESTful APIs using Node.js, PostgreSQL, koa, knex, bookshelf.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.1%
  • Shell 1.3%
  • Dockerfile 0.6%