All Projects → mesaugat → Express Api Es6 Starter

mesaugat / Express Api Es6 Starter

Licence: mit
Build APIs with Express.js in no time using ES6/ES7/ESNext goodness.

Programming Languages

javascript
184084 projects - #8 most used programming language
es2015
71 projects
es2017
19 projects

Projects that are alternatives of or similar to Express Api Es6 Starter

Rest Api Nodejs Mongodb
A boilerplate for REST API Development with Node.js, Express, and MongoDB
Stars: ✭ 672 (+216.98%)
Mutual labels:  api, rest, expressjs
Bookmarks.dev
Bookmarks and Code Snippets Manager for Developers & Co
Stars: ✭ 218 (+2.83%)
Mutual labels:  api, rest, expressjs
Node Express Postgresql Sequelize
Node.js, Express.js, Sequelize.js and PostgreSQL RESTful API
Stars: ✭ 148 (-30.19%)
Mutual labels:  api, rest, expressjs
Typescript Rest
This is a lightweight annotation-based expressjs extension for typescript.
Stars: ✭ 458 (+116.04%)
Mutual labels:  api, rest, expressjs
Mailman
Mailman is a GUI to help you manage your email accounts stored in a MySQL/MariaDB database.
Stars: ✭ 62 (-70.75%)
Mutual labels:  api, rest, expressjs
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: ✭ 146 (-31.13%)
Mutual labels:  api, rest, expressjs
Verb
Organize and send HTTP requests from Emacs
Stars: ✭ 205 (-3.3%)
Mutual labels:  api, rest, babel
Rrda
REST API allowing to perform DNS queries over HTTP
Stars: ✭ 176 (-16.98%)
Mutual labels:  api, rest
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-16.04%)
Mutual labels:  api, rest
Express React Boilerplate
Express, MySQL, React/Redux, NodeJs Application Boilerplate
Stars: ✭ 179 (-15.57%)
Mutual labels:  rest, expressjs
Lumen Microservice
Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 7 | Aws ECS, Google Kubernates, Azure Container Engine
Stars: ✭ 183 (-13.68%)
Mutual labels:  api, rest
Laravel Api Debugger
Easy debug for your JSON API.
Stars: ✭ 175 (-17.45%)
Mutual labels:  api, rest
Axios Actions
Bundle endpoints as callable, reusable services
Stars: ✭ 172 (-18.87%)
Mutual labels:  api, rest
Storefront Api
Storefront GraphQL API Gateway. Modular architecture. ElasticSearch included. Works great with Magento1, Magento2, Spree, OpenCart, Pimcore and custom backends
Stars: ✭ 180 (-15.09%)
Mutual labels:  api, rest
Js Client
A Open-API derived JS + Node.js API client for Netlify
Stars: ✭ 170 (-19.81%)
Mutual labels:  api, rest
Huobi java
Java SDK for Huobi Spot API
Stars: ✭ 180 (-15.09%)
Mutual labels:  api, rest
The Rest Architectural Style
An article on the REST architecture style.
Stars: ✭ 168 (-20.75%)
Mutual labels:  api, rest
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-14.62%)
Mutual labels:  api, rest
Apicheck
The DevSecOps toolset for REST APIs
Stars: ✭ 184 (-13.21%)
Mutual labels:  api, rest
Jsonapi Utils
Build JSON API-compliant APIs on Rails with no (or less) learning curve.
Stars: ✭ 191 (-9.91%)
Mutual labels:  api, rest

Express API ES6 Starter

Starter application for building APIs with Express.js

Build Status Codecov

Check out the working demo 👉 here.

Comes with:


Prerequisites

Setup

Clone the repository, install the dependencies and get started right away.

$ git clone --depth=1 [email protected]:mesaugat/express-api-es6-starter.git <application-name>
$ cd <application-name>
$ rm -rf .git
$ yarn   # or npm install

Make a copy of .env.example as .env and update your application details and database credentials. Now, run the migrations and seed the database.

$ yarn migrate
$ yarn seed

Finally, start the application.

$ yarn start:dev (For development)
$ NODE_ENV=production yarn start (For production)

Navigate to http://localhost:8848/api-docs/ to verify installation.

Creating new Migrations and Seeds

These are the commands to create a new migration and corresponding seed file.

$ yarn make:migration <name>
$ yarn make:seeder <name>

Example,

$ yarn make:migration create_tags_table
$ yarn make:seeder 02_insert_tags

Using Docker

Using docker-compose

Use docker-compose to quickly bring up a stack with pre-configured Postgres database container. Data is ephemeral and containers will disappear when stack is removed.

Specific configuration for Docker is in .env.docker

  • 0.0.0.0 as $APP_HOST to expose app on Docker network interface
  • Pre-configured Postgres settings - can be updated to point to another Postgres host

Bring up stack,

$ docker-compose up

Navigate to http://localhost:8848/api-docs/ to verify application is running from docker.

Bring down stack,

$ docker-compose down

Multi-stage docker builds

There are multiple build targets available for different stages. These images can be used to deploy or run jobs in different container based cloud infrastructure like Kubernetes, AWS ECS, Fargate, GCP Cloud Run etc.

  1. Building a production image.

    $ docker build --target=prod -t express-api-es6-starter:prod .
    
  2. Building an image for development.

    $ docker build --target=dev -t express-api-es6-starter:dev .
    
  3. Building an image that runs migration and/or rollback.

     # Docker image that runs migration and seeds.
     $ docker build --target=migrate -t express-api-es6-starter:migrate .
    
     # Docker image that rollbacks migrations.
     $ docker build --target=migrate-rollback -t express-api-es6-starter:migrate-rollback .
    

Once the images have been built - all you need to do is run them providing a .env file. Like this:

$ docker run -v "/path/to/your/.env:/app/.env" mesaugat/express-api-es6-starter:migrate

Using MySQL instead of PostgreSQL

Install the mysql driver first.

$ yarn add mysql

Update these lines in your .env file.

- DB_CLIENT='pg'
+ DB_CLIENT='mysql'

- DB_PORT='5432'
+ DB_PORT='3306'

You can remove the pg driver if you like to.

$ yarn remove pg

That's it, you are ready to roll.

Tests

To run the tests you need to create a separate test database. Don't forget to update your .env file to include the connections for test database.

$ NODE_ENV=test yarn migrate
$ yarn test

Run tests with coverage.

$ yarn test:coverage

Why 8848?

Because the highest point in the world is 8848 metres.

Contributing

For contribution and feature requests, please create an issue first.

License

express-api-es6-starter is under MIT License.

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].