Giter VIP home page Giter VIP logo

isaacmtz90 / glee Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jsynowiec/node-flowtype-boilerplate

1.0 2.0 0.0 409 KB

Glee is a back-end starting point for development teams who use a specific stack of technologies and methodologies (see below). Glee includes build scripts, sample/template code and everything you need to quick-start back-end development. Glee's requirements were inspired by https://gist.github.com/bsommardahl/c2d57d51242b2336b7876f20fcf16ac6.

Home Page: http://acklenavenue.com

License: MIT License

Shell 3.07% JavaScript 94.99% Gherkin 1.94%

glee's Introduction

Dev dependencies Node.js version NPM version Yarn version Build Status

MIT License PRs Welcome

Watch on GitHub Star on GitHub

glee

Glee is a back-end starting point for development teams who use a specific stack of technologies and methodologies (see below). Glee includes build scripts, sample/template code and everything you need to quick-start back-end development. Glee's requirements were inspired by https://gist.github.com/bsommardahl/c2d57d51242b2336b7876f20fcf16ac6.

Glee provides a basic Rest API template:

  • ES6 + babel,
    • Removes Flow type annotations,
    • Transforms imports to lazy CommonJS requires,
    • Transforms async/await to generators,
  • ESLint with the airbnb-base and flowtype rules,
  • Jest unit testing and coverage,
  • Type definitions for Jest,
  • NPM scripts for common operations,
  • .editorconfig for consistent file format,
  • Yarn lockfile so only verified and up-to-date dependencies are installed.
  • PostreSQL Database integration with migrations
  • Feature Toggling
  • Authentication by JWT (requires separate IDP for auth and user management)
  • API documentation by Swagger (auto-generated)
  • Automated Acceptance Testing with Cucumber
  • CloudFormation configuration
  • Docker container
  • Buildkite configuration
  • Command Dispatching with MotoTaxi
  • Guidance for CQRS architecture

Global Install

npm install -g yarn

Database Setup

You need PostgreSQL to run glee locally. To install postgres on Ubuntu, check out this awesome tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04 (for Windows, head to google).

Glee comes with default database configurarion for localhost. You can change your db config by modifying ./src/config/sequelize.js. This config file is ignored by git, so it will not get checked in with your secrets.

Quick start

This project requires Node.js 8.2 or later and NPM, Yarn is optional but recommended. Make sure you have those installed. Then just type following commands:

git clone https://github.com/acklenavenue/glee
cd glee
yarn
yarn run first-time

Logging Setup

Glee comes with default logging configurarion for Loggly.com. You can change your logging config by modifying ./src/config/loggly.js. This config file is ignored by git, so it will not get checked in with your secrets.

API docs and easy access

Swagger docs work right out of the box at the <host>:<port>/docs route. Authenthication with jwt2 is enabled by default using the hapi-jwt2 plugin. In order to test the default endpoints with the default secret key use the next token:

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwibmFtZSI6IkFudGhvbnkgVmFsaWQgVXNlciIsImlhdCI6MTQyNTQ3MzUzNX0.KA68l60mjiC8EXaC2odnjFwdIDxE__iDu5RwLdN1F2A

Production tokens should be generated by the Auth/Login system.

To create validation schemas, use Joi objects. These will be parsed by Swagger to create the interface for every route. For aditional features check the official documentation

Available scripts

Run using either npm run <script> or yarn run <script> comand.

  • clean - remove coverage data, Jest cache and transpiled files,
  • lint - lint source files and tests,
  • typecheck - check type annotations,
  • test - lint, typecheck and run tests with coverage,
  • test-only - run tests with coverage,
  • test:watch - interactive watch mode to automatically re-run tests,
  • build - compile source files,
  • build:watch - interactive watch mode, compile sources on change.
  • aat - run automated acceptance tests

Questions

If you have any questions regarding this project:

Inspiration

This boilerplate was initially inspired by Jakub Synowiec, but taken several steps further to include a basic Hapi-based REST API with CQRS-style command dispatching.

Videos

License

MIT License. See the LICENSE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.