Outcome is to learn & implement nestjs, graphql, python and docker
--> Generated by GPT for crisp and precise understanding of what this repo is all about 🙂
A step-by-step 8-week roadmap to master NestJS, GraphQL, and Python microservices, fully Dockerized.
By the end, you'll have a production-ready backend stack with MongoDB, Redis caching, and optional ML/image processing services.
- Backend: NestJS, GraphQL (Apollo)
- Microservices: Python (FastAPI)
- Database: MongoDB (Mongoose)
- Cache & Messaging: Redis, Optional RabbitMQ
- Containerization: Docker & Docker Compose
Goal: Learn NestJS structure, modules, services, and basic GraphQL CRUD.
Tasks & Subtasks:
-
Setup Project
- Install NestJS CLI.
- Scaffold project:
nest new task-tracker
. - Add GraphQL module (code-first).
- Setup MongoDB with Mongoose.
-
Create Modules & Services
- Create
TaskModule
. - Create
TaskService
with CRUD methods. - Create
TaskResolver
with queries/mutations.
- Create
-
GraphQL Implementation
- Define Task schemas using Mongoose.
- Implement
createTask
,getTasks
,updateTask
,deleteTask
. - Test queries in GraphQL Playground.
-
Docker Practice
- Write basic
Dockerfile
for NestJS. - Build image & run container.
- Verify GraphQL Playground inside container.
- Write basic
Optional Bonus: Add pagination & filtering.
Goal: Master GraphQL queries, relationships, and nested resolvers.
Tasks & Subtasks:
-
User Module
- Create
UserModule
andUserService
. - Add
User
schema and relationships to Task.
- Create
-
Resolvers
- Add
getUserTasks(userId)
query. - Implement nested resolvers for task details.
- Add
-
Input Validation
- Use class-validator decorators.
- Handle errors gracefully in GraphQL.
-
Docker
- Add MongoDB container via Docker Compose.
- Connect NestJS container to MongoDB service.
- Test queries from NestJS container.
Optional Bonus: Fix N+1 problem using DataLoader.
Goal: Secure GraphQL APIs.
Tasks & Subtasks:
-
JWT Auth Setup
- Install Passport.js + JWT packages.
- Configure JWT strategy and guards.
-
User Auth
- Implement
signup
&login
mutations. - Hash passwords using bcrypt.
- Add
me
query for authenticated user.
- Implement
-
Role-based Access
- Add roles (e.g., admin, user).
- Create
@Roles()
decorator. - Protect queries/mutations.
-
Docker
- Use
.env
for JWT secret inside container. - Rebuild NestJS image with updated config.
- Use
Optional Bonus: Add refresh tokens & password reset mutation.
Goal: Improve performance with caching and interceptors.
Tasks & Subtasks:
-
Integrate Redis
- Add Redis client to NestJS.
- Cache GraphQL query results.
-
Middleware & Interceptors
- Logging middleware for requests.
- Interceptor to transform responses.
- Rate limiting middleware.
-
Docker
- Add Redis container in Docker Compose.
- Connect NestJS container to Redis service.
- Test cache persistence across container restarts.
Optional Bonus: Add custom decorators to inject metadata for logging.
Goal: Connect Python microservice to NestJS for analytics.
Tasks & Subtasks:
-
Python FastAPI Setup
- Scaffold FastAPI project.
- Create
/analyze
route. - Define Pydantic models for input/output.
-
NestJS Integration
- Add Axios module in NestJS.
- Create service to call Python
/analyze
endpoint. - Expose GraphQL query
getUserAnalytics
.
-
Docker
- Write
Dockerfile
for Python service. - Add Python container to Docker Compose.
- Verify NestJS ↔ Python container communication.
- Write
Optional Bonus: Use RabbitMQ or Redis Streams for async communication.
Goal: Handle file uploads and background processing with Python.
Tasks & Subtasks:
-
GraphQL File Upload
- Add
Upload
scalar. - Implement
uploadImage(file: Upload)
mutation.
- Add
-
Python Image Processing
- Script to resize/compress images (Pillow/OpenCV).
- Store processed images in volume or S3.
-
Background Jobs
- Setup Bull (Redis-based queue).
- Send image processing tasks to queue.
- Python worker picks up job and returns result.
-
Docker
- Mount local folder as volume for image storage.
- Ensure Python container can access volume.
- Test full workflow in Docker Compose.
Goal: Implement WebSockets and GraphQL subscriptions.
Tasks & Subtasks:
-
NestJS WebSocket Gateway
- Setup WebSocket gateway.
- Create
onTaskUpdated
subscription.
-
Broadcasting Events
- Trigger events when tasks are created/updated.
- Test multiple clients subscribing.
-
Python Integration (Optional ML)
- Python service predicts notifications.
- NestJS broadcasts ML suggestions via subscription.
-
Docker
- Verify WebSocket communication between containers.
- Ensure Redis pub/sub works across containers.
Goal: Build a fully Dockerized, production-ready microservice stack.
Tasks & Subtasks:
-
NestJS GraphQL Gateway
- Aggregate multiple subgraphs (tasks, users, recommendations).
-
Python ML Service
- Serve movie recommendations via ML model.
- FastAPI route returns recommendations.
-
Docker Compose Orchestration
- NestJS container
- Python ML service container
- MongoDB
- Redis
- Optional RabbitMQ
- Setup networks, volumes, env files.
-
Testing
- Test
getRecommendedMovies(userId)
query. - Test caching, subscriptions, and analytics pipelines.
- Test
-
Optional Frontend
- Minimal React/Angular dashboard to visualize recommendations & notifications.
- Copy
.env.example
to.env
and configure variables. - Build and start all services:
docker-compose up --build