Yape challenge repository. I hope you enjoy this code review!
Tech stack:
- GraphQl API for incoming requests.
- NodeJs with NestJs framework for microservices.
- Postgress DB.
- Redis DB.
- Docker and Docker Compose.
- Turborepo as monorepo tool.
- Run in root folder and each service folder:
cp .env.example .env. - You can configure environment variables in each
.envif is needed. Please, don't modifyAPP_ENV=localvalue. - Run
docker compose up - Run
npm install - Run
npm run start:prod
In order to create and get a transaction:
- Import in your postman workspace
./docs/Transactions.postman_collection.json - Run
createTransactionwhich is in Create Transaction on the imported collection. This mutation will start transaction creation. It will retrive the task and some useful information. - Copy
data.createTransaction.idand set it intransactionTaskwhich is in Query Transaction and run it then. As long polling pattern, you will receive the task with three important properties:- status: Task status (pending, completed).
- retryAfter: Time in seconds to retry if the task has not ended.
- retryTimes: Retry times before considering the task as not found.
- result: The result of the task when it be completed. The completed transaction in this case.
You can check the stack and the process here:
Some important developments are pendings:
- Handle microservices errors
- Master-slave pattern on Postgres
Some other development details could be missing due to lack of time.
Thanks for your time!
