This is my take-home exam for the position of Back End Engineer (TypeScript) at Smartrr.
Although the stack chosen for this project is a bit too much for this specific application, I wanted to pick tools that would be applicable on a real Smartrr project (microservices, queues, etc), that is what made the biggest impact on the final decision.
-
Backend
- Postgres (database)
- Redis (queue and message broker)
- Nest (application framework)
- GraphQL (entrypoint for the api)
- Jest (testing)
-
Frontend
- React
- Tailwind
- Urql
- GraphQL Codegen
The backend is composed of two different applications, which run independently of each other and communicate via a message broker (Redis).
-
API
- Handles requests from the web via GraphQL
- Handles subscriptions via GraphQL and WebSockets (for real-time updates)
-
Worker
- Handles the conversion queue (retries, circuit breaks, paralellism, timeouts)
- Handles the cron (runs hourly and enqueues conversions to be processed)
Below is a flow diagram that represents the entire application architecture:
- Copy or rename the
.env.example
file to.env
- Replace
<YOUR_RAPID_API_KEY>
with your Rapid API key inside the env file
TIP: You can do both steps with a single command:
sed 's/<YOUR_RAPID_API_KEY>/REAL_API_KEY/g' .env.example > .env
- Run
docker compose up
- Wait for the containers to be up
- Open http://localhost:3000
I had a great time diving into this take-home project. Really appreciate the opportunity to showcase my skills for this position. Hope you like what you see!
Cheers,
Humberto.