The main goal is to create an API that emulates the workings of company. Where you have Workers and Companies. And it's working on our website
First, clone the repo and install the dependencies.
npm install
.
Keep in mind that we use npm
for managing Node packages. If you try installing the dependencies with yarn
, it will generate a yarn.lock
file that will likely cause problems with the existing package-lock.json
.
First you will have to create a .env
file with the information shown in .env.example
- To run de production version image locally run
docker compose up
removing thedocker-compose.override.yml
. - To run de development version image locally run
docker compose up
which automatically will work withdocker-compose.override.yml
TBD
While developing, we follow an Hexagonal Architecture.
If this is new for you, here are some useful links:
- Arquitectura Hexagonal en Node + Typescript (Spanish)
- Arquitectura Hexagonal con Typescript en APIs web con Nodejs (Spanish)
- "Ready for changes with Hexagonal Architecture" - Netflix case study
TBD
Before pushing your changes, make sure to test and run the linter to ensure the code follows the rules, or the CI pipeline will throw an error and fail:
npm run test:prod
npm run lint:fix
In the root folder of the project, you'll find several config files. Let's go over the most important ones:
Dockerfile
: we need to replicate a given environment to work under the same conditions. With this file, we configure the Docker image we use.docker-compose.yml
: we need to work with a server and a database. With this file we configure both Docker containersdocker-compose.yml
: to work with the image in the directory and not in the Docker hub and for more development aidance we override the settings with this file.- In the
ADR
folder there are the decissions of the technologies we have chosen for the project
We use Gihub Actions as CI/CD service.
Every time you make a pull request to main
or commit to a branch that has one, the steps .github/workflows/test.yml
will run.
Every time a branch is merged to main
, the steps .github/workflows/build-and-deploy.yml
will run. And the new changes will be deployed.
(c) Company.