Coder Social home page Coder Social logo

night-stories-backend's Introduction

nodejs-api-template

A starter Template to build Api's with Express Node and MongoDB.

1 cp .env.example .env
2 npm run dev

Features

  1. Restful Api
  2. Swagger Docs
  3. Auth with Email Confirmation and Password Recovery
  4. Unit and Integration Tests.
  5. Modular file configuration and Folder Structure.
  6. Es-Lint.
  7. Multiple Enviroments setup (development, staging, production)

Project Structure

C:.
|   .env
|   .env.example
|   .eslintignore
|   .eslintrc.json
|   .gitignore
|   LICENSE
|   package-lock.json
|   package.json
|   README.md
|
+---src
|   |   app.js
|   |
|   +---config
|   |       .gitkeep
|   |       chalk.js
|   |       development.js
|   |       index.js
|   |       logger.js
|   |       production.js
|   |       staging.js
|   |
|   +---helpers
|   |       index.js
|   |
|   +---models
|   |   |   .gitkeep
|   |   |   index.js
|   |   |
|   |   \---User
|   |           User.js
|   |
|   +---modules
|   |   \---User
|   |       +---controllers
|   |       |       index.js
|   |       |
|   |       +---policies
|   |       |       index.js
|   |       |
|   |       \---routes
|   |               index.js
|   |
|   \---router
|           index.js
|
\---test
    +---integration
    |       .gitkeep
    |
    \---unit
            .gitkeep

SRC FOLDER

This contains most of the folders and files for the project

Config Folder

Houses all the config files including enviroment configs for development, staging and production.

Models Folder

All your mongoose models are kept here and are required automatically into the index.js in the model folder, which in turn is required into the app.js file.

Test Folder

This contains both folders for integation and unit test files.

Modules Folder

This contains all the modules for your project, etc User, Admin. In every module folder you have 3 sub-folders:

  1. Controllers
  2. Policies
  3. Routes

Controllers

contains all the logic for that specific module.

Policies

contains all the validation middleware for that module.

Routes

contains module route definitions and assembly point for controllers and validation middleware, assigning them to specific routes.

night-stories-backend's People

Contributors

webong avatar codetillamgone avatar

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.