All Projects → academia-de-codigo → noire-server

academia-de-codigo / noire-server

Licence: MIT license
Hapi Boilerplate

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to noire-server

purescript-swerve
Swerve is a library that offers a type-level DSL for describing server and client web applications. Inspired by Haskell's Servant library.
Stars: ✭ 20 (+0%)
Mutual labels:  api-client, api-server
pimba
Pimba is a minimalist command-line tool written in Go to publish and serve static files.
Stars: ✭ 12 (-40%)
Mutual labels:  api-client, api-server
webapi
WAI based library for web api
Stars: ✭ 27 (+35%)
Mutual labels:  api-client, api-server
simple-php-api
An extremely simple API (with authentication) example, written in PHP (server) and JS (client), using JSON
Stars: ✭ 23 (+15%)
Mutual labels:  api-client, api-server
drowsy
😪 Lazy integrations tool for RESTful interfaces to aid POC development and streamline integrations
Stars: ✭ 19 (-5%)
Mutual labels:  api-client, api-server
Appy Backend
A user system to bootstrap your app.
Stars: ✭ 96 (+380%)
Mutual labels:  hapi, api-server
Openapi Generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Stars: ✭ 10,634 (+53070%)
Mutual labels:  api-client, api-server
Electrode Csrf Jwt
Stateless Cross-Site Request Forgery (CSRF) protection with JWT
Stars: ✭ 127 (+535%)
Mutual labels:  hapi, csrf
hapi-now-auth
Hapi token auth for bearer and jwt
Stars: ✭ 43 (+115%)
Mutual labels:  hapi
monzo-php
PHP Library for use with https://monzo.com
Stars: ✭ 20 (+0%)
Mutual labels:  api-client
rcites
📦 R package to access the CITES Speciesplus database
Stars: ✭ 12 (-40%)
Mutual labels:  api-client
cv4pve-api-php
Proxmox VE Client API for PHP
Stars: ✭ 45 (+125%)
Mutual labels:  api-client
rippled-php
A PHP library for rippled (XRP Ledger) communication.
Stars: ✭ 33 (+65%)
Mutual labels:  api-client
Transformer-QG-on-SQuAD
Implement Question Generator with SOTA pre-trained Language Models (RoBERTa, BERT, GPT, BART, T5, etc.)
Stars: ✭ 28 (+40%)
Mutual labels:  api-server
YuiAPI
一个浏览器API测试客户端,API文档生成器,支持chrome/firefox/新版edge
Stars: ✭ 25 (+25%)
Mutual labels:  api-client
alpha-vantage-api
Alpha Vantage PHP Client
Stars: ✭ 57 (+185%)
Mutual labels:  api-client
dynamic-cli
A Modern, user-friendly command-line HTTP client for the API testing, and if you're stuck - Search and browse StackOverflow without leaving the CLI
Stars: ✭ 151 (+655%)
Mutual labels:  api-client
hapi-mongo-models
📦 A hapi plugin for `mongo-models`
Stars: ✭ 101 (+405%)
Mutual labels:  hapi
rdfp
This R package connects the DoubleClick for Publishers API from R
Stars: ✭ 16 (-20%)
Mutual labels:  api-client
insomnia-workspace
An Insomnia Workspace for Alpaca API
Stars: ✭ 34 (+70%)
Mutual labels:  api-client

last commit Build Status Coverage

Dependencies Status DevDependencies Status

Maintainer: Rui Ferrão

Noire Server

Extremely opinionated Hapi boilerplate using a layered architecture for proper separation of concerns

WARNING: Noire is currently under active development and might not be ready for heavy production use

Controllers

  • Map routes
  • Extract route parameters
  • Kick off some work
  • Send the result back to the client

Service Layer

  • Perform work for the Controller
  • Return the result for the Controller

Data Access Layer

  • Repository pattern for data entities
  • Thin models
  • ORM with transactional capabilities

Features

  • HTTP and HTTPS support
  • Automated API documentation generation
  • Stateless JWT auth for API endpoints
  • RBAC authorization
  • Email sending using handlebars templates
  • Fast and flexible logging (Pino)
  • Testing, code coverage and Travis CI integration
  • Graceful server shutdown
  • Database ORM (Objection) with migrations (Knex) support
  • Usage of native Promises and async/await

Get it Running

Clone the repo

git clone [email protected]:academia-de-codigo/noire-server.git

Install the required Dependencies

npm install

Adjust the configuration files to suit your environment

Edit all lib/config* files

Setup environment variables

  • NODE_ENV should be set to either development, staging or production. If not set at all, defaults to development
  • JWT_SECRET should contain a secret which will be used to sign authentication tokens. A safe randomly generated secret can be obtained by running npm run secret.
  • SMTP credentials should be configured using the SMTP_USER and SMTP_PASS environment variables
  • Staging and Production environment need the DB_HOSTT, DB_NAME, DB_USER and DB_PASS environment variables for configuration the database connection
  • All environment variables can be setup inside a .env file which should not be commited and is sourced when the server starts. A sample example.env file is provided.

Reset the database to it's original state

npm run reset

Run the unit tests

npm test

Launch the server in production mode

  • Make sure NODE_ENV=production
  • Start the server with npm start

Development

  • Set NODE_ENV=development
  • Start the server in watch mode with npm run watch

Development Environment

Noire is developed using Vim and/or Visual Studio Code. With VSCode the following plugins are used:

  • Babel ES6/ES7
  • Document This
  • DotENV
  • EditorConfig for VS Code
  • ESLint
  • HTMLHint
  • Node.js Modules Intellisense
  • npm
  • Path Autocomplete
  • Prettier

For proper code formatting and module intellisense under VSCode, the following settings are recommended:

"settings": {
		"editor.formatOnSave": true,
		"node-module-intellisense.scanBuiltinModules": true,
		"node-module-intellisense.scanDevDependencies": true,
		"node-module-intellisense.scanFileModules": true,
		"node-module-intellisense.modulePaths": [
			"lib"
		],
		"node-module-intellisense.autoStripExtensions": [
			".js"
		]
	}
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].