Git Product home page Git Product logo

express-api-starter's Introduction

Express API Starter Kit

Getting Started

Prerequisites

  • Postgres(>=9.4)
  • Sequelize CLI ([sudo] npm install -g sequelize-cli)

Folder Architecture

├── mocha.conf.js
├── package-lock.json
├── package.json
├── server
│   ├── api
│   │   ├── thing
│   │   │   ├── index.js
│   │   │   ├── thing.controller.js
│   │   │   ├── thing.events.js
│   │   │   ├── thing.helper.js
│   │   │   ├── thing.model.js
│   │   │   └── thing.socket.js
│   │   └── user
│   │       ├── index.js
│   │       ├── user.controller.js
│   │       ├── user.events.js
│   │       └── user.model.js
│   ├── auth
│   │   ├── auth.service.js
│   │   ├── facebook
│   │   │   └── ...
│   │   ├── google
│   │   │   └── ...
│   │   ├── index.js
│   │   ├── local
│   │   │   └── ...
│   │   └── twitter
│   │       └── ...
│   ├── components
│   │   ├── errors
│   │   │   └── index.js
│   │   └── utils
│   │       ├── logger.js
│   │       └── responses.js
│   ├── config
│   │   ├── environment
│   │   │   ├── development.js
│   │   │   ├── index.js
│   │   │   ├── production.js
│   │   │   ├── shared.js
│   │   │   └── test.js
│   │   ├── express.js
│   │   ├── local.env.sample.js
│   │   └── socketio.js
│   ├── index.js
│   ├── routes.js
│   └── sqldb
│       ├── config.js
│       ├── index.js
│       ├── migrations
│       │   └── ...
│       └── seeders
│           └── ...
└── yarn.lock

32 directories, 81 files

Running the server

  1. Run npm install to install server dependencies.

  2. Edit the ./server/config/development.js file and enter the correct postgres DB connection variables.

  3. Run npm run dev to start the development server.

Migrations & Seeds

Migrations and seeds are placed in ./server/sqldb/migrations and ./server/sqldb/seeders respectively.

Running Migrations

To run all pending migrations, run the following command:

npm run migrate

To reverse all migrations:

npm run migrate:undo

More about Sequelize Migrations

Running Seeds

To run all seeds, run the following command:

npm run seed

To reverse all seeds:

npm run seed:undo

More about Sequelize Seeds

Testing

TODO: Add tests w. mocha vs. jest... Running npm test will run the unit tests with karma.

express-api-starter's People

Contributors

faisalal-tameemi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

express-api-starter's Issues

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.