Delete git folder on root service after clone repository
To suggest or request adding changes, please clone the repository, create a new branch with your name/ISSUE and then request PR
nvm install 18.16.0
nvm use 18.16.0
https://oxc-project.github.io/docs/guide/usage/linter-cli.html
npm install
npm install @commitlint/cli @commitlint/config-conventional
npm install husky --save-dev
npx husky install
The Husky Library has been implemented in the project to validate the process of creating commits and branches and thus follow a standard.
The commits must be created following a convention that is configurable in the file commitlint.config.js
git commit -m "feat(scope): info del commit"
git commit -m "feat(scope): Info del commit"
This would return an error similar to this:
⧗ input: feat(scope): Info del commit
✖ subject may not be empty [subject-empty]
✖ type may not be empty [type-empty]
✖ found 2 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
husky - commit-msg hook exited with code 1 (error)
The scope in optional, but it would be advisable to add it, since India where the changes sent in said Commit point.Example:
git commit -m "feat(login): Added key recovery button"
git commit -m "fix(register): resolved error by sending email to new users"
'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf','refactor', 'revert', 'style', 'test'
They can review the convention for the commits in the following link: Convención
The branch must also follow a convention and should start with any of the following prefixes: hotfix | bugfix | fix | feature
If you try to create an commitment in a branch that does not follow the standard, this will not allow the creation of the ADS and much less a push to that branch
To change the name of your current branch, use the following command
# git branch -m old-name new-name
# Example:
git branch -m mi-rama-actual feature/BUQ-123-info-de-rama
You can add the ticket number that way in the name of the branch so that it is associated with the ticket in jira
You can check the info a bit about the appointment of branches in the following link: Branch Flow
Postman collections are found in the root folder of the same name and are updated when changes arise in the endpoints if it is merited.
Update url for the specified domain for the tests in the postman environment attached to this repo
To create modules and use cases, there is a command that can be used in this way:
node command.js module -n module-name
# Module with routes file, use case and controller
npm run command -- module -n moduleName
# Use Case
npm run command -- case -m moduleName -n useCaseName
# Mongo db Model
npm run command -- mdbmodel -n modelName
# Help
npm run command
This will create a module folder with its initial files in the folder [src/app]
/src
|-/module-name
|-/application
| |-/use-case
| |- module-default.case.ts
| |- module-default.dto.ts
|-/domain
|-/ repositories
|- iModuleName.repository.ts
|-/insfrastructure
|-/persistence
|- moduleName.repository.ts
|- module.controller.ts
|-/routes
|- module.routes.ts
node command.js -m module-name -n case-name
This will create a case of use within the indicated module [src/module-name/application/useCase-name], if the module does not exist the command omit the creation
/src
|-/module-name
|-/application
|-/use-case
|- module-default.case.ts
|- module-default.dto.ts
You can see the help and commands available with the following command
node command.js -h
To load a sample with Docker at your premises, please follow these steps:
npm run build:local
or manual:
docker build -f script/Dockerfile -t apitest:local .
Then start the machine with the next configuration
docker run -d -p 3010:3001 --restart always --name api_base_testing --network pruebaslocal apitest:local
Note: Remember to disable the start of database in Server if you are not going to test with a database, otherwise, if database must be in the same network of the Docker instance of the API test
Note: Modify the environment variables in the Docker-test file before creating the local test image