A boilerplate for building RESTful APIs using Node.js, PostgreSQL, koa, knex, bookshelf.
- Install Node.JS latest version
- Install PostgreSQL
- Clone this repository
- Install dependencies, just run in project folder:
npm install
oryarn
- Create database:
npm run createdb
- Change name value of .env.example to .env and set the key SECRET to any value you wish
- Run migrations:
npm run knex migrate:latest
- Run seeds:
npm run knex seed:run
- Run
npm start
ornpm run dev
to start server
- Run tests:
npm test
├── /database
| ├── /migrations
| ├── /models
| ├── /scripts
| ├── /seeds
├── /public
├── /src
| ├── /config
| ├── /controllers
| ├── /middleware
| ├── /routes
| ├── /schemas
| ├── /utils
├── /test