- hdCRM
- Table of contents
- Introduction
- Required Build Environment (Minimum)
- Required Development Tools
- Cloning The hdCRM Project
- Local Installation
- Running Development
- Gulp Tasks
- Building Development Instance
- Commit Message Guidelines
- Commit Message Format
- Pushing to the repository
- Pull Request Message Format
- Contribution Guidelines
- Authors
- Usefull links
hdCRM is an ERP software designed to streamline business operations
Visual Studio Code Extensions available in workspace recommended (will be prompted to install when you will open the workspace for the first time)
Use git clone in terminal:
git clone https://github.com/IMalaniak/hdCRM.git
or use the following link:
- Navigate to the root folder of the repository and run the following command:
npm install
- After installing root packages run the following command to install server and web dependencies:
npx gulp installAll
or with alias
npx gulp ia
This will install all of the dependencies of server and web applications.
-
Run
docker-compose up -d
command to get PostgreSQL running on your local machine. -
Create file
.env
in the server folder and configure it as an example of.env.sample
providing database credentials and database name (credentials for local db can be found in docker-compose.yml file).
Note, that every change in
.env
file needs a server restart
- Run command
npx gulp server:prepareDevDB
script to prepare local db.
- Use the following command to run Server locally
npx gulp server:dev
This will run the server locally on http://localhost:3000 and also will migrate db automatically
- Use the following command to run Web Client locally
npx gulp web:dev
This will open browser automatically on http://localhost:4200
Use the following command to get all available gulp tasks:
npx gulp --tasks
npx gulp lintAll // Lints all project
npx gulp formatAll // Formats all project
npx gulp installAll // Runs npm install on all project
npx gulp server:lint // Lints server
npx gulp server:format // Formats server
npx gulp server:install // Runs npm install on server
npx gulp web:lint // Lints web client
npx gulp web:format // Formats web client
npx gulp web:install // Runs npm install on web client
To build server and client applications you can run the following command:
npx gulp buildAll
This will create bundles in the
dist
folders accordingly in server and web folders.
We must create commit messages according to the following rules
Must be one of the following:
- dep: Update dependencies
- feat: A new feature
- fix: A bug fix
- refactor: A code change that neither fixes a bug nor adds a feature
- test: Adding missing tests or correcting existing tests
- perf: A code change that improves performance
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- memo: A doc writing
Each commit message consists of a header and a body. The header has a special format that includes a type, a scope, and a subject:
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
The header is mandatory and the scope should be GitHub task id or external. The body is not mandatory
Example:
fix(#1234): subject message
- Fixed component etc.
The scope should be the id of the GitHub tasks. If we have no task, we can use external
- GitHub task id
- external
- build
feat(#1234): add new feature
- external
feat(external): change something externally
If the commit reverts a previous commit, it should begin with revert:
, followed by the header of the reverted commit. In the body, it should say: These reverts commit <hash>.
, where the hash is the SHA of the commit being reverted.
revert: "fix(#1234): subject message"
These reverts commit <hash>.
cherry-pick: "fix(#1234): subject message"
When pushing to the repo there is a Husky tool configured to check prettier style and tslint rules are passed, also server and web unit tests are checked, whenever some exceptions it will be not possible to push the branch.
There are only two possible issues:
- code is not formatted or does not meet the tslint requirements
- some of unit tests are broken - check console logs for more details
Sometimes you may want to push changes to the repo and skip Husky verifying process that is HIGHLY NOT RECOMENDED, but anyway, if there is a situation, you can use the following command:
git push --no-verify
We must create pull request message according to the following rules.
Each pull request messages consists of a header and a body. The header has a special format that includes a type, a scope, and a subject:
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
The header is mandatory and the scope should be GitHub task id or external. The body has to contain fixing keyword: resolves #taskId
Example:
fix(#1234): subject message
resolves #1234
Every contribution to project requires pull request to be created
We must create new branch according to the following rules
Each new branch must be created from dev
branch and need to have a special format that includes a type and a scope:
<type>/<scope>
Example:
feat/#1234
Use type examples for the type
The scope should be the id of the GitHub tasks
- GitHub task id
-
Once you published your branch to the repo, the
Compare & pull request
button will appear in GitHub -
Follow the pull request message format
-
Follow next steps:
- Request responsible reviewers
- Assign related developers
- Add labels
- Add related project
Ivan Malaniak | Arsenii Irod |
github/IMalaniak | github/ArseniiIrod |
ivanmalaniak.pp.ua |
Local | Prod | |
---|---|---|
Swagger API | /api-docs | /api-docs |