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.
├── 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
# 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
- Unit test setup
- Remove unnecessary code, config etc specially nextjs and webpack config
- Test deploy a demo app