Lesson 35 of 49 advanced

Putting It All Together

The Full Picture

Open interactive version (quiz + challenge)

Real-world analogy

You've learned each instrument individually. Now it's time to play in the orchestra! Each technology is one musician — alone they sound good, but TOGETHER they create a symphony. Your fullstack app is that symphony! 🎵

What is it?

A fullstack NestJS + React application combines everything you've learned: React frontend, NestJS backend, MongoDB database, Redis cache, Bull queues, JWT auth, Docker containers, and CI/CD pipelines — all working together as one system.

Real-world relevance

This is the exact architecture used by thousands of production applications. Companies like Adidas, Roche, and countless startups run this stack in production serving millions of users.

Key points

Code example

// The Complete Request Flow 🌊
//
// 1. User clicks "Sign Up" in React
//    └→ React Hook Form validates with Zod
//    └→ Axios sends POST /auth/signup
//
// 2. NestJS receives the request
//    └→ ValidationPipe checks the DTO
//    └→ AuthController.signup() runs
//    └→ AuthService.register() is called
//
// 3. Business logic executes
//    └→ Prisma creates user in MongoDB
//    └→ JWT token is generated
//    └→ Bull queue: add "send welcome email" job
//    └→ Bull queue: add "send push notification" job
//
// 4. Response sent to React
//    └→ { user, access_token }
//    └→ React stores token in memory
//    └→ React Query caches user data
//    └→ React Router redirects to /dashboard
//
// 5. Background (user doesn't wait!)
//    └→ Bull worker sends welcome email via SES
//    └→ Bull worker sends push notification via FCM
//    └→ Redis caches the new user data
//
// 6. Dashboard loads
//    └→ React Query fetches /api/dashboard
//    └→ NestJS checks JWT (Guard)
//    └→ Redis cache checked first (fast!)
//    └→ If miss → MongoDB query → cache result
//    └→ Dashboard renders with real-time data
//
// The whole flow: ~200ms for the user
// Background tasks: ~5-10 seconds (user doesn't notice!) 🚀

// Your tech stack summary:
// Frontend:  React + Vite + TypeScript + Tailwind + React Query
// Backend:   NestJS + Prisma + MongoDB
// Cache:     Redis
// Queue:     Bull (powered by Redis)
// Auth:      JWT + Passport
// Files:     AWS S3
// Email:     AWS SES / Mailgun
// Push:      Firebase Cloud Messaging
// Realtime:  Socket.IO
// Container: Docker + Docker Compose
// CI/CD:     GitHub Actions
// Quality:   ESLint + Prettier + Husky

Line-by-line walkthrough

  1. 1. The Complete Request Flow 🌊
  2. 2.
  3. 3. 1. User clicks "Sign Up" in React
  4. 4. └→ React Hook Form validates with Zod
  5. 5. └→ Axios sends POST /auth/signup
  6. 6.
  7. 7. 2. NestJS receives the request
  8. 8. └→ ValidationPipe checks the DTO
  9. 9. └→ AuthController.signup() runs
  10. 10. └→ AuthService.register() is called
  11. 11.
  12. 12. 3. Business logic executes
  13. 13. └→ Prisma creates user in MongoDB
  14. 14. └→ JWT token is generated
  15. 15. └→ Bull queue: add "send welcome email" job
  16. 16. └→ Bull queue: add "send push notification" job
  17. 17.
  18. 18. 4. Response sent to React
  19. 19. └→ { user, access_token }
  20. 20. └→ React stores token in memory
  21. 21. └→ React Query caches user data
  22. 22. └→ React Router redirects to /dashboard
  23. 23.
  24. 24. 5. Background (user doesn't wait!)
  25. 25. └→ Bull worker sends welcome email via SES
  26. 26. └→ Bull worker sends push notification via FCM
  27. 27. └→ Redis caches the new user data
  28. 28.
  29. 29. 6. Dashboard loads
  30. 30. └→ React Query fetches /api/dashboard
  31. 31. └→ NestJS checks JWT (Guard)
  32. 32. └→ Redis cache checked first (fast!)
  33. 33. └→ If miss → MongoDB query → cache result
  34. 34. └→ Dashboard renders with real-time data
  35. 35.
  36. 36. The whole flow: ~200ms for the user
  37. 37. Background tasks: ~5-10 seconds (user doesn't notice!) 🚀
  38. 38.
  39. 39. Your tech stack summary:
  40. 40. Frontend: React + Vite + TypeScript + Tailwind + React Query
  41. 41. Backend: NestJS + Prisma + MongoDB
  42. 42. Cache: Redis
  43. 43. Queue: Bull (powered by Redis)
  44. 44. Auth: JWT + Passport
  45. 45. Files: AWS S3
  46. 46. Email: AWS SES / Mailgun
  47. 47. Push: Firebase Cloud Messaging
  48. 48. Realtime: Socket.IO
  49. 49. Container: Docker + Docker Compose
  50. 50. CI/CD: GitHub Actions
  51. 51. Quality: ESLint + Prettier + Husky

Spot the bug

const app = await NestFactory.create(AppModule);
await app.listen(4000);

// React on localhost:3000
fetch('http://localhost:4000/api/users')
Need a hint?
What happens when React on one port calls NestJS on another?
Show answer
Browser blocks the request due to CORS - frontend (port 3000) and backend (port 4000) are different origins. Fix: add app.enableCors({ origin: 'http://localhost:3000' }) before app.listen().

Explain like I'm 5

You have learned to play piano, guitar, drums, and singing separately. Now it is time to play in a band! Each instrument sounds nice alone, but together they make beautiful music. A fullstack app is all your technologies playing in harmony!

Fun fact

If you've made it this far, you've learned about 25+ technologies that professional fullstack developers use daily. That's more tech than most bootcamps cover in 12 weeks! 🏆

Hands-on challenge

Draw the entire architecture on paper (or a whiteboard): React → NestJS → MongoDB, with Redis, Bull, S3, and FCM connected. Label each arrow with what data flows through it!

More resources

Open interactive version (quiz + challenge) ← Back to course: Full-Stack Playbook