This repository talks about how to build an outstanding web server using latest Javascript technologies that can help micro entrepreneurs swiftly reach economic freedom.
-- Node.js v16.x or v18.x
-- NPM v8+
-- Node.js
-- Koa.js (Express.js Godfather) 🔥🔥
-- Morgan (for logging purposes)
-- Mongodb 💾
.
│── README.md
│── .env.example (this will be the environment file)
|── .gitignore
|── package.json
|── index.js (entry point)
└── controllers/
| └── ...[.js]
└── helpers/
| └── ...[.js]
└── libraries/
| └── ...[.js]
└── middlewares/
| └── ...[.js]
└── repositories/
| └── ...[.js]
└── routes/
| └── ...[.js]
└── services/
| └── ...[.js] (db connection or third party api)
- install dependency.
npm install
- copy .env.example and rename it into .env (
cp .env.example .env
) - ajust config in .env
npm start
During the development cycle, a variety of supporting branches are used:
- feature/* -- feature branches are used to develop new features for the upcoming releases. May branch off from develop and must merge into develop.
- hotfix/* -- hotfix branches are necessary to act immediately upon an undesired status of master. May branch off from master and must merge into master and develop.
Creating a new feature
- create new branch from master. ex:
feature/name-of-feature
. - write your code.
- don't forget to run
npm run lint
to check standardize code ornpm run lintfix
to auto fix non-standard code. - commit & push your work to the same named branch on the server.
- create PR into development branch for testing in dev server.
- if its pre-production ready then create PR from the same branch into staging. DON'T PR FROM DEVELOPMENT BRANCH!
- if ready to production then create PR from the same branch into master/production. DON'T PR FROM DEVELOPMENT BRANCH OR STAGING!
This flow of deployment using Git Flow with 3 main branches
- master -- this branch contains production code. All development code is merged into master in sometime.
- staging -- this branch is a nearly exact replica of a production environment for software testing.
- development/dev -- this branch contains pre-production code. When the features are finished then they are merged into develop.