How boostcampwm-2021/web15-tadaktadak works
Project’s Nature and Core Purpose
• TadakTadak is a full-stack, real‑time communication web service allowing users to interact via video, audio, chat, and a “campfire” themed shared environment.
• The system supports rich features such as live room interactions, profile management, media streaming via Agora, and real-time chat via Socket.IO.
Break Down the System’s Major Components
a. Frontend Client:
• Located in the “client” directory, it is built using React and TypeScript.
• Manages presentation layers including pages (Campfire, Main, Profile, etc.), reusable components (SearchBar, Modal, Sidebar, etc.), and asset management.
• Implements API calls through a unified fetcher and utilizes contexts and hooks to manage state (e.g., theme, toast, user).
b. REST API Server:
• Found in “server/api”, built using NestJS and TypeScript, with a clear domain-driven structure (modules for auth, room, user, field, history, etc.).
• Handles API requests (including authentication, CRUD operations on users/rooms, uploads, etc.), standardizing API responses and errors through interceptors and filters.
• Interacts with persistent storage (likely MySQL) and adheres to a coherent DTO and builder strategy.
c. Socket Server:
• Located in “server/socket” and also built with NestJS.
• Responsible for real‑time features such as in-room chat, managing live user status, and communicating via Socket.IO.
• Uses Redis (via its Pub/Sub mechanism) to enable clustering and efficient real‑time message distribution between multiple socket server instances.
d. Infrastructure and External Services:
• MySQL and Redis should be represented as supporting infrastructure for persistence and high-speed data operations respectively.
• External media handling via Agora for video, audio, and screen sharing services.
• Deployment technologies include Docker (shown by Dockerfiles in both API and Socket directories) and Nginx reverse proxy for load balancing across containers.
• CI/CD pipelines are configured via GitHub workflows, ensuring automated testing and deployment for both API and Socket servers as well as the Frontend.
Interactions and Data Flow
• RESTful API interactions for user data, authentication, and CRUD operations.
• WebSocket connections (using Socket.IO) for real‑time data like chat, participant updates, and room events.
• API Server connecting to:
• MySQL for persistent data storage.
• Possibly external storage modules or authentication providers.
• Socket Server’s use of Redis for Pub/Sub clustering to distribute messages across server instances.
• A connection from both backend components to an “External Service” block representing Agora (for media streaming) and other 3rd‑party integrations.
Architectural Patterns and Design Principles
• The project uses a modular architecture (especially in the API server) by segregating domains (auth, room, user, etc.) in their own modules.
• Both backend servers leverage NestJS—which enforces patterns like controllers, services, and modules for clear separation of concerns.
• The client is component-driven (React) and uses state management contexts for unified behavior.
• Separation between synchronous (REST) and asynchronous (socket real‑time) interactions.
• Infrastructure components are decoupled (using Docker and Nginx) to support scaling and clustered deployments.
Final Checklist for the Principal Software Engineer
• Every major module from both “client” and “server” directories is represented.
• Distinguish storage (MySQL and Redis) and external integrations such as Agora.