All Projects → hueter → docker-node-express-boilerplate

hueter / docker-node-express-boilerplate

Licence: MIT license
Boilerplate for quickly bootstrapping production-ready RESTful APIs / microservices

Programming Languages

javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-node-express-boilerplate

dhiwise-nodejs
DhiWise Node.js API generator allows you to instantly generate secure REST APIs. Just supply your database schema to DhiWise, and a fully documented CRUD APIs will be ready for consumption in a few simple clicks. The generated code is clean, scalable, and customizable.
Stars: ✭ 224 (+98.23%)
Mutual labels:  mongoose, expressjs, restful-api
Nodejs Rest Api Project Structure Express
Nodejs project structure practices for building RESTful APIs using Express framework and MongoDB.
Stars: ✭ 134 (+18.58%)
Mutual labels:  mongoose, expressjs, restful-api
NodeRestApi
Node.js, Express.js and MongoDB REST API App
Stars: ✭ 38 (-66.37%)
Mutual labels:  mongoose, expressjs, restful-api
nestjs-rest-sample
NestJS RESTful APIs Sample
Stars: ✭ 204 (+80.53%)
Mutual labels:  mongoose, expressjs, restful-api
express-typescript-mongoose-starter
A starter for Node JS, Express, Typescript, Mongoose application
Stars: ✭ 22 (-80.53%)
Mutual labels:  mongoose, expressjs, restful-api
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: ✭ 146 (+29.2%)
Mutual labels:  mongoose, expressjs, restful-api
express-mongodb-crud
Web Application CRUD using Nodejs and Mongodb
Stars: ✭ 87 (-23.01%)
Mutual labels:  mongoose, expressjs
mern-stack-crud
MERN stack (MongoDB, Express, React and Node.js) create read update and delete (CRUD) web application example
Stars: ✭ 142 (+25.66%)
Mutual labels:  mongoose, expressjs
typijs
The Angular CMS Framework for building fully-featured SPA sites powered by NodeJS and MongoDB with TypeScript
Stars: ✭ 141 (+24.78%)
Mutual labels:  mongoose, expressjs
react-nodejs-mongodb-crud
👨‍💻 Fullstack web app built with MongoDB, NodeJs, React and Redux. Features: Protected routes client/server side, MaterialUI layout
Stars: ✭ 91 (-19.47%)
Mutual labels:  mongoose, restful-api
TvrboReact
Dream starter project: React, Redux, React Router, Webpack
Stars: ✭ 13 (-88.5%)
Mutual labels:  mongoose, expressjs
commerce
🛒 e-commerce-platform
Stars: ✭ 54 (-52.21%)
Mutual labels:  mongoose, expressjs
express-mquery
Expose mongoose query API through HTTP request.
Stars: ✭ 37 (-67.26%)
Mutual labels:  mongoose, expressjs
MovieGo
A Website implemented using MERN (MongoDB, ExpressJS, ReactJS and NodeJS) stack, which allows users to sign-in/register and book movie tickets online.
Stars: ✭ 26 (-76.99%)
Mutual labels:  mongoose, expressjs
pothole detection
By using this app users can report the potholes on road by clicking a photo via our app and if a pothole is detected by Machine Learning modal then it is saved to our Database from where officials can view the specifics like location,reported by and official can resolve the request.User are notified by email for every update regarding their request
Stars: ✭ 17 (-84.96%)
Mutual labels:  mongoose, expressjs
search-cities
No description or website provided.
Stars: ✭ 11 (-90.27%)
Mutual labels:  mongoose, expressjs
express-mongo-jwt-boilerplate
Express Mongo JsonWebToken boilerplate
Stars: ✭ 100 (-11.5%)
Mutual labels:  mongoose, expressjs
Natours
An awesome tour booking web app written in NodeJS, Express, MongoDB 🗽
Stars: ✭ 94 (-16.81%)
Mutual labels:  mongoose, expressjs
node-crudapi-ts
CRUD boilerplate for create Node Restful API's with Express Framework and Sequelize ORM written in Typescript.
Stars: ✭ 41 (-63.72%)
Mutual labels:  expressjs, restful-api
nodejs-shopping-cart
NodeJS / Express / MongoDB - Shopping Cart (monolithic app with handlebars)
Stars: ✭ 42 (-62.83%)
Mutual labels:  mongoose, expressjs

RESTful API Server Boilerplate

Featuring Docker, Node, Express, MongoDB, Mongoose, & NGINX

Tech Logos

License & Purpose

MIT License. This is something I've used in production before with success that I found useful for quickly bootstrapping RESTful APIs. You can fork and clone and take this apart without giving me any credit for anything. If you like it, you can star the repo ⭐️ or follow me on GitHub.

Feel free to make an issue or PR if you want to suggest ideas / fixes.

About

This configuration is a backend RESTful API boilerplate with the following pieces:

  • Docker as the container service to isolate the environment.
  • Node.js (Long-Term-Support Version) as the run-time environment to run JavaScript.
  • Express.js as the server framework / controller layer
  • MongoDB as the database layer
  • Mongoose as the "ODM" / model layer
  • NGINX as a proxy / content-caching layer

How to Install & Run

You will need to first download and install Docker Desktop or Linux equivalent.

  1. Fork/Clone the repo
  2. Run docker-compose up to start three containers:
    • the MongoDB database container
    • the Node.js app container
    • the NGINX proxy container
  3. Server is accessible at http://localhost:8080 if you have Docker for Windows or Mac. Use http://localhost without specifying the port to hit the NGINX proxy. On Linux, you may need to hit the IP Address of the docker-machine rather than localhost (port rules are the same.)

How to Run Tests

Currently, tests are run outside of the Docker container (unfortunately for now). The tests use an in-memory version of MongoDB. You should be able to run npm install followed by npm test to run everything (assuming you have the LTS version of Node installed on your machine).

App Structure

  • the boilerplate entity is called "Thing" and all the routes are based on the thing resource. When you want to start building a real API, you can probably just do a global find and replace for thing, but mind the case-sensitivity.
  • most folders have an index.js which simply exports the contents of all the files in those folders. This is to make importing things around the app slightly easier, since you can just require the folder name and destructure the functions you are looking for. Check out this part of the Node.js docs for more info.

__tests__

  • this folder contains unit and integration tests both run using npm test which in turn uses Jest

./app

  • handlers are Express.js route handlers that have request, response, and next parameters.
  • helpers are raw JS "classes" and utility functions for use across the app
  • models are Mongoose schema definitions and associated models
  • routers are RESTful route declarations using express.Router module that utilize the functions in handlers
  • schemas are JSONSchema validation schemas for creating or updating a Thing. Pro-tip: use JSONSchema.net to generate schemas based on examples for you.
  • app.js is what builds and configures the express app
  • config.js is the app-specific config that you will want to customize for your app
  • index.js is the entrypoint that actually starts the Express server

./config

  • config contains NGINX proxy configuration, the production pm2 configuration (the process-runner of choice), and the Jest configuration to run MongoDB in memory
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].