Skip to content

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/senplate

Repository files navigation

senplate

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/andela-git/senplate.git
  • cd senplate
  • 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 https://localhost:9000/

Folder structure

  • index.js - Application entry point
  • 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
      • api [dir] - api folder to carefully house all your api routes file
        • hello.js - hello default route (optional)
    • seeders - database seeders folder
  • 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 senplate
  • sen create <app name>
  • cd <app name>
  • sen do controller User
  • sen do model:migration User

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published