All Projects → naveteam → back-boilerplate

naveteam / back-boilerplate

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

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Labels

Projects that are alternatives of or similar to back-boilerplate

ejyy
「e家宜业」是一整套开源智慧物业解决方案,基于nodejs、typescript、koa、vue开发,包含web中台、业主小程序、员工小程序、公众号、物联网应用等,涵盖业主服务、物业运营、智能物联、数据统计等主要业务。
Stars: ✭ 561 (+1600%)
Mutual labels:  koa, knex
kurier
TypeScript framework to create JSON:API compliant APIs
Stars: ✭ 30 (-9.09%)
Mutual labels:  koa, knex
WebAppReader
基于 html5 、 Vue.js 、 Koa、Node.js 以及 EJS 的手机小说阅读器。使用 node.js 模拟后台数据,无实际后台,完全的前后端分离开发。
Stars: ✭ 15 (-54.55%)
Mutual labels:  koa
tie
🧶A Node.js Framework based on TypeScript and Express.
Stars: ✭ 30 (-9.09%)
Mutual labels:  koa
universal-react-starter-kit
Universal React Starter Kit is an universal web application framework using koa, react, redux and webpack.
Stars: ✭ 13 (-60.61%)
Mutual labels:  koa
koa-react-redux-universal-boilerplate
[Unmaintained] A fullstack Koa + React + Redux Universal Boilerplate to speed up your development process.
Stars: ✭ 22 (-33.33%)
Mutual labels:  koa
web-onefx-boilerplate
Full-stack React Framework for building web and backend
Stars: ✭ 34 (+3.03%)
Mutual labels:  koa
rgxp
Regular Expression Collection (ReactJS, Redux, React Router, Recompose, NodeJS, Express)
Stars: ✭ 62 (+87.88%)
Mutual labels:  knex
aws-serverless-koa
This library enables you to utilize AWS Lambda and Amazon API Gateway to respond to web and API requests using the Koa.js application framework
Stars: ✭ 37 (+12.12%)
Mutual labels:  koa
tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 2,350 (+7021.21%)
Mutual labels:  koa
shrtn-it
A url shortener developed as a course completion project
Stars: ✭ 16 (-51.52%)
Mutual labels:  knex
koa-xml-body
koa middleware to parse xml request body
Stars: ✭ 36 (+9.09%)
Mutual labels:  koa
js
serverless your express/koa/restify apps
Stars: ✭ 21 (-36.36%)
Mutual labels:  koa
koa-session-mongoose
Mongoose store for Koa sessions
Stars: ✭ 29 (-12.12%)
Mutual labels:  koa
fullstack-typescript
A demo project of a full stack typescript application
Stars: ✭ 28 (-15.15%)
Mutual labels:  knex
koahub-cli
KoaHub CLI -- KoaHub.js的开发工具,自动babel编译 ES6/7(Generator Function, Class, Async & Await)并且文件修改后自动重启。
Stars: ✭ 16 (-51.52%)
Mutual labels:  koa
nestjs-objection
Objection module for NestJS
Stars: ✭ 24 (-27.27%)
Mutual labels:  knex
aotoo-hub
aotoo-hub是一套通用型前端脚手架,无技术栈依赖,聚焦于多人协作及工程化。帮助开发者快速产出项目。支持react/vue/小程序/node
Stars: ✭ 74 (+124.24%)
Mutual labels:  koa
express-objection-starter
an opinionated, production-ready, isomorphic express/knex/objection starter with centralized configuration
Stars: ✭ 19 (-42.42%)
Mutual labels:  knex
cookbook
VueJS + NodeJS Evergreen Cookbook
Stars: ✭ 440 (+1233.33%)
Mutual labels:  knex

Node API boilerplate by nave.rs

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

Getting started

Installation

  1. Install Node.JS LTS version
  2. Install PostgreSQL
  3. Clone this repository and enter on the respective folder
  4. Install dependencies running: 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. Install citext extension on your database with the command CREATE EXTENSION citext;

  2. Change name value of .env.example to .env and set the key SECRET to any value you wish

  3. Change DATABASE_URL to postgress://user:password@localhost/database

  4. Run migrations: yarn db:migrate

  5. Run seeds: yarn db:seed

  6. Install Docker

  • Pull redis: docker pull redis
  • Create image: docker run --name your-image-name -d redis
  • Start redis: docker start your-image-name
  1. 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

Postman

Run in Postman

Styleguide

Standard - JavaScript Style Guide

Nodemailer

To use the nodemailer helper in a non-production environment, you need to set the variable in .env ALLOW_LIST and assign an array with the domains allowed for sending e-mail. This domain must start with an @, followed by a minimum of 2 characters, a . and 2 characters in the end. In case the informed email is not part of any informed domain, the email will not be sent.

Examples:

The following domains: nave.rs and@nave are not allowed as they do not satisfy the domain description, given above.

Database

This project uses objection.js as ORM and knex as query builder.

Migrations:

In order not to use before update hooks on our models, we decided to create a function and trigger via migration, everytime you create a table with updated_at add the trigger to it. (an example is in the file: "src/database/migrations/20180910221504_init.js")

Steps to use Queue UI

  1. After adding a new queue, need to add in queue.js a new adapter
  2. Acess UI on http://localhost:3001/v1/queues/dashboards
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].