How bedelo/ft_transcendence works
ft_transcendence is a multiplayer Tic-Tac-Toe web application: users authenticate, find or create a room, play live 1v1 or 1v1v1 matches, and review profile progression and statistics. The React client also supports chat and social interaction, while the Fastify backend handles authenticated API and WebSocket traffic and persists application state through Prisma. The README documents further admin, GDPR, multilingual, and accessibility capabilities. Some route and UI implementations were not sampled, so links for those features reflect documented capabilities and registered modules, not inspected call chains.
Main entry points: main.ts Fastify server · prisma.ts Prisma data access · router.tsx Routes and pages · useGameRoom.ts Game room connection
Components 24
Web client
- React application
apps/frontend/src/main.tsx - Routes and pages
apps/frontend/src/router.tsx - Game lobby and match UI
apps/frontend/src/pages/GameLobbyPage.tsx - Game room connection
apps/frontend/src/hooks/useGameRoom.ts - Chat connection
apps/frontend/src/hooks/useChat.ts - HTTP API client
apps/frontend/src/lib/api.ts
Identity and profiles
- Authentication UI
apps/frontend/src/components/auth/index.ts - Authentication routes
apps/backend/src/routes/auth.ts - Profile and avatar routes
apps/backend/src/routes/profile.ts - Friends routes
apps/backend/src/routes/friends.ts
Live play and chat
- Chat WebSocket and history
apps/backend/src/routes/chat.ts - Game room routes
apps/backend/src/routes/game.ts - Room manager
apps/backend/src/services/game/GameManager.ts - Room and match state
apps/backend/src/services/game/GameRoom.ts - Game rules
apps/backend/src/services/game/GameEngine.ts
Progress and administration
- Statistics routes
apps/backend/src/routes/stats.ts - Achievement service
apps/backend/src/services/achievements.ts - Admin routes
apps/backend/src/routes/admin/index.ts - GDPR routes
apps/backend/src/routes/gdpr.ts
Contracts and persistence
- Fastify server
apps/backend/src/main.ts - Shared schemas and types
packages/shared-types/src/index.ts - Prisma data access
apps/backend/src/db/prisma.ts - Relational database
Other components
- Player
Connections 32
- Player → React application: uses
- React application → Routes and pages: renders
- Routes and pages → Game lobby and match UI: routes to
- Routes and pages → Authentication UI: routes to
- Game lobby and match UI → Game room connection: connects with
- Game room connection → Game room routes: WebSocket messages
- Chat connection → Chat WebSocket and history: history and messages
- Authentication UI → HTTP API client: submits requests
- HTTP API client → Fastify server: HTTP requests
- Fastify server → Authentication routes: registers
- Fastify server → Profile and avatar routes: registers
- Fastify server → Friends routes: registers
- Fastify server → Chat WebSocket and history: registers
- Fastify server → Game room routes: registers
- Fastify server → Statistics routes: registers
- Fastify server → Admin routes: registers
- Fastify server → GDPR routes: registers
- Game room routes → Room manager: manages rooms
- Room manager → Room and match state: creates and joins
- Room and match state → Game rules: applies rules
- Room manager → Prisma data access: persists games
- Prisma data access → Relational database: reads and writes
- Authentication routes → Prisma data access: session and user data
- Profile and avatar routes → Prisma data access: profile data
- Friends routes → Prisma data access: social data
- Chat WebSocket and history → Prisma data access: message history
- Statistics routes → Prisma data access: statistics data
- Admin routes → Prisma data access: management data
- GDPR routes → Prisma data access: export and deletion data
- Fastify server → Shared schemas and types: validates API contracts
- Game room connection → Shared schemas and types: uses game types
- Achievement service → Prisma data access: progress data