Skip to content
/ xapi Public

A quick start template for bootstrapping a new NODE Express API application using sequelize as the ORM.

License

Notifications You must be signed in to change notification settings

waleCloud/xapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xapi - Easy Express API

Build Status CircleCI Maintainability Test Coverage Coverage Status

A quick start template for bootstrapping a new NODE Express API application using sequelize as the ORM.

Quick setup

  • git clone https://github.com/waleCloud/xapi.git
  • cd xapi
  • cp .env.example .env - Listens on PORT 9000 by default.
  • npm install
  • npm test - To run tests
  • npm start - Your app should be running on http://localhost:9000/

Folder structure

  • app [dir] - application folder
    • config - config.js::sequelize configuration file
    • controllers - application controllers folder, app logic goes here
    • helpers - helper scripts to ease repetitive tasks goes here.
    • migrations - database migration files
    • models - application database models definition goes here
    • routes - application requests, requests format and definition goes
      • to carefully house all your api routes file
      • hello.js - hello default route (optional)
    • seeders - database seeders folder
    • index.js - Application entry point
  • test [dir]
    • feature [dir]
    • unit [dir]
    • test.js

Out of the box structure for building Node Express APIs, comes preconfigured with the following; ###Dependencies

  • body-parser - Node.js body parsing middleware. Parse incoming request bodies in a middleware before your handlers, available under the req.body property. body-parser
  • express - Fast, unopinionated, minimalist web framework for node. express-framework
  • morgan - HTTP request logger middleware for node.js. morgan
  • sequelize - Sequelize is a promise-based Node.js ORM for Postgres, MySQL, SQLite and Microsoft SQL Server. It features solid transaction support, relations, read replication and more. sequelize

Test framework

  • Mocha - Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. mochajs
  • Chai - Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework. chai
  • chai-http - HTTP integration testing with Chai assertions.chai-http

Licence

  • MIT
    

TODO

The project needs to be built into a CLI to npm tool such that with just one command, an install can be made. something like;

  • npm install -g xapi
  • xa create <app name>
  • cd <app name>
  • xa do controller User
  • xa do model:migration User

About

A quick start template for bootstrapping a new NODE Express API application using sequelize as the ORM.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published