EMCP Baseline NestJS Backend
A production‑ready NestJS backend service with Docker, Docker Compose
This project is a baseline NestJS backend service designed for cloud‑native environments. It provides a solid starting point that includes:
-
A modular, TypeScript‑based NestJS server
-
Docker and Docker Compose configuration for local development
-
Node.js (v18 or higher recommended)
Welcome new developers! Complete this ping-pong service challenge to demonstrate your understanding of the tech stack.
Build a real-time ping-pong service that demonstrates:
-
RESTful API endpoints
-
Redis streams for message queuing
-
WebSocket connections for real-time communication
-
Client-side real-time updates
-
Ping Endpoint: Create a POST endpoint /api/ping that:
-
Accepts a "ping" message from clients
-
Writes the message to a Redis stream
-
Returns acknowledgment to the client
-
-
Redis Stream Processing: Implement a background service that:
-
Listens to the Redis stream for new ping messages
-
Processes each message and transforms it to "pong"
-
Broadcasts the "pong" message to all connected WebSocket clients
-
-
WebSocket Gateway: Create a WebSocket gateway that:
-
Accepts client connections
-
Broadcasts "pong" messages to all connected clients
-
Handles client connect/disconnect events
-
-
Client Application: Build a simple client (React preferred) that:
-
Has a button to send "ping" requests to the server
-
Connects to the WebSocket to receive "pong" messages
-
Displays received "pong" messages in real-time
-
-
Local Development Only: No need for multi-node considerations
-
Docker Compose: All services must run via docker-compose up
-
Dependencies: Include Redis in your docker-compose setup
-
Real-time: Use WebSockets for client-server communication
-
Message Queue: Use Redis streams (not pub/sub)
-
✅ Code quality and organization
-
✅ Proper error handling
-
✅ Docker setup works out of the box
-
✅ Real-time functionality works as described
-
✅ Clean and intuitive client interface
-
✅ Documentation and comments
-
Updated NestJS backend with ping-pong service
-
Client application (React or any framework)
-
Updated docker-compose.yml with Redis
-
Brief documentation explaining your implementation choices
-
Click on "Use this template" to create a new repository
-
Commit your changes
-
Push your changes to your new repository
-
Send an email - [email protected] with a link
If you encounter issues during the home test or have questions about the setup, please:
-
Email - [email protected]
-
Feel free to use any AI, but do not share the entire repo with AI
Good luck with the home test! Happy hacking 🎯