Express starter, is a basic application from where a developer can start a new REST service. It showcase basic feature of an API with typescript in express.
- Node.js server.
- MongoDB database.
- mongoose Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box for MongoDB.
- TypeScript
- Express node.js framework for building REST APIs
- Jest Jest is used to test Javascript frameworks
- Supertest provide a high-level abstraction for testing HTTP
This section is for getting started with Kue server on your development environment.
- Clone the repository
git clone <link>
- Install packages
npm install
- Launch the app in watch mode
npm start
Now you can expect automatic live reloading whenever you made changes to src
-
Build the app
npm build
You can access the api at http://localhost:9000/
We use unit tests with Jest in this project.
-
To run tests
npm test
We also use tslint with Typescript Standard Style.
-
To run lint:
npm lint
-
To automatically fix doable linting errors:
npm lint:fix
For commit message or branch name we will use following categories:
- feat (feature)
- fix (bug fix)
- docs (documentation)
- style (formatting, missing semi colons, etc)
- refactor
- test (when adding missing tests)
- chore (maintain)
<DEVELOPMENT CATEGORY>: <SUBJECT>
<BLANK LINE>
<BODY>
<BLANK LINE>
<FOOTER>
Git flow needs to be initialized in order to customize your project setup.
git flow init
Develop new features for upcoming releases.
-
Start a new feature:
git flow feature start MYFEATURE
-
Finish a feature:
git flow feature finish MYFEATURE
-
Publish a feature
git flow feature publish MYFEATURE
-
Getting a published feature
git flow feature pull origin MYFEATURE
Support preparation of a new production release Allow for minor bug fixes and preparing meta-data for a release
-
Start a new release:
git flow release start RELEASE
-
Finish a release:
git flow release finish RELEASE
IMP: Don't forget to do
git push --tags
-
Publish a release
git flow release publish RELEASE
-
Getting a release feature
git flow release pull origin RELEASE
Hotfixes arise from the necessity to act immediately upon an undesired state of a live production version
-
Start a new hotfix:
git flow hotfix start VERSION
-
Finish a release:
git flow hotfix finish RELEASE
- TODO
- Developer must commit his tasks at the end of the day, even if the task has not been completed
- Developer must create a pull request at the end of day, even if the task has not been completed, with a SUFFIX in subject name as
[WIP]:
e.g[WIP]: Setup of Jest with first unit test
Our preferred IDE is VSCODE
Please enable following plugins for your editor:
- EditorConfig: To enable reading of .editorconfig file for consistent coding convention.
- SonarLint: To enable error catch by sonarjs.
- TSlint: For linting errors