Coder Social home page Coder Social logo

backend-start's Introduction

backend starter kit with NodeJS for easy prototyping apis

#f03c15 Work in Progress

updated: sep 2, 2018

A naive approach to building an api starter kit to quickly start side projects. Meant to be used with fullstack-start project. Javascript is choosen to minimize fatigue working on both frontend and backend.

Table of Contents

Folder Structure

├── api                             # api code
│   ├── auth                        # auth module used for auth api endrpoints /auth
│       ├── auth.controller.js      
│       ├── auth.route.js                        
│       ├── auth.util.js                        
│   ├── khobor                      # khobor module used for auth api endrpoints /khobor
│       ├── khobor.controller.js      
│       ├── khobor.route.js                        
│       ├── khobor.util.js                        
│   ├── middlewares                 # middlewares to be used by api modules i.e. auth, khobor etc
│       ├── auth.js
│   ├── routes                      # route definitions
│       ├── v1                      # api version 1 routes
│           ├── index.js
├── config                          # server config files
│   ├── express.js                  # expressjs configuration
│   ├── passport.js                 # passport configuration
│   ├── vars.js                     # environtment variables exported to be consumed by express app
├── db                              # Database configuration files
│   ├── config                      
│       ├── config.json             # database connection info for sequelize ORM
│   ├── migrations                  # database migrations generated by sequelize-cli
│   ├── models                      # model definitions generated by sequelize-cli
│   ├── seeders                     # seed files. generated by sequelize-cli
├── node_modules
├── scripts                         # Project operation scripts
│   ├── bash.py                     # enters fullstack-backend and fullstack-postgres containers
│   ├── down.py                     # stops containers 
│   ├── init-project.py             # bootstraps starter kit by changing config files 
│   ├── log.py                      # logs output of **fullstack-backend** container
│   ├── rebuild.py                  # cleans up containers, volumes for rebuilding docker image
│   ├── up.py                       # starts containers defined in docker-compose files
│   ├── utils.py                    # utility function to be used with other scripts
│   ├── .gitgignore
├── volumes                         # docker volume mount points. defined in docker-compose files                         
│   ├── db                          # used for fullstack-postgres container
├── .dockerignore 
├── .env.development                # environtment variables for react app 
├── .env.docker.development         # docker environtment variables for development config
├── .eslintrc
├── .gigignore
├── .sequelizerc                    # sequelize configuration 
├── docker-compose.override.yml     # development config
├── docker-compose.production.yml   # production configs
├── docker-compose.yml              # common configs
├── Dockerfile                      # backend container image definition
├── index.js                        # server app entry point
├── package.json                    
├── README.md
├── yarn.lock

Quick Start

# Clone the repository
git clone https://github.com/dostokhan/backend-start 
# Go inside the directory
cd backend-start

# Configure containers with desired project name.
cd scripts

./init-project.py # ideally one time only, at first
# Asks for **Project Name**, **Domain Name**, **Email Address* 
# Updates docker container config files and replaces 'fullstack' with given **Project Name**. i.e. network name
#   1. ./docker-compose.yml
#   2. ./docker-compose.override.yml
#   3. ./docker-compose.production.yml

# Start development containers
./up.py

# Migrate and seed database
./bash.py       # get inside fullstack-backend container
yarn sequelize db:migrate 
yarn sequelize db:seed:all

# Install/Remove node packages
./bash.py       # get inside fullstack-backend container and run yarn add/remove packages

# Stop container
./down.py

# See build output log
./log.py

Todo

  • Unit test setup
  • Remove unnecessary code, config etc specially nextjs and webpack config
  • Test deploy a demo app

backend-start's People

Contributors

imonirr avatar

Watchers

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