How norabino/ft_transcendence works
ft_transcendence is a social-network web app: users authenticate, browse a feed and public profiles, manage friendships, and use real-time chat and AI features. The frontend routes pages and composes UI with shared stores and API/socket clients; NestJS controllers delegate domain operations to services backed by Prisma. The README documents OAuth, 2FA, presence, and hybrid AI capabilities. Some backend gateways and several frontend modules were not excerpted, so uncertain runtime links are omitted or marked unverified.
Main entry points: prisma.service.ts Prisma data access · App.tsx App routing · PublicProfile.tsx Public profile · auth.controller.ts Auth endpoints
Components 29
Web experience
- App routing
frontend/src/App.tsx - Home feed
frontend/src/pages/HomeFeed.tsx - Public profile
frontend/src/pages/PublicProfile.tsx - Auth modals
frontend/src/components/AuthModals.tsx - Auth state
frontend/src/store/authStore.ts - HTTP client
frontend/src/api/axios.ts - Social sidebar
frontend/src/components/SocialSidebar.tsx - Social state
frontend/src/store/socialStore.ts - Global chat UI
frontend/src/components/GlobalChatWidget.tsx - Socket hook
frontend/src/hooks/useSocket.ts - AI API client
frontend/src/api/aiApi.ts
Identity and access
- Auth endpoints
backend/src/auth/auth.controller.ts - Authentication
backend/src/auth/auth.service.ts - 2FA service
backend/src/auth/2fa/two-factor-auth.service.ts - 42 OAuth strategy
backend/src/auth/42auth/forty-two.strategy.ts
Social features
- User profiles
backend/src/users/users.service.ts - Friend endpoints
backend/src/friends/friends.controller.ts - Friend management
backend/src/friends/friends.service.ts - Post endpoints
backend/src/posts/posts.controller.ts - Posts
backend/src/posts/posts.service.ts
Realtime and AI
- Chat endpoints
backend/src/chat/chat.controller.ts - Messaging
backend/src/chat/chat.service.ts - Chat gateway
backend/src/chat/chat.gateway.ts - Presence gateway
backend/src/friends/friends.gateway.ts - AI endpoints
backend/src/ai/ai.controller.ts - AI orchestration
backend/src/ai/ai.service.ts
Backend and data
- Prisma data access
backend/src/prisma/prisma.service.ts - Nest app composition
backend/src/app.module.ts
Other components
- User
Connections 36
- User → App routing: uses
frontend/src/App.tsx - App routing → Home feed: routes to
frontend/src/App.tsx - App routing → Public profile: routes to
frontend/src/App.tsx - App routing → Global chat UI: renders
frontend/src/App.tsx - Home feed → Auth modals: opens
frontend/src/pages/HomeFeed.tsx - Public profile → Auth modals: renders
frontend/src/pages/PublicProfile.tsx - Auth modals → HTTP client: submits requests
frontend/src/components/AuthModals.tsx - Auth modals → Auth state: updates
frontend/src/components/AuthModals.tsx - HTTP client → Auth state: updates session
frontend/src/api/axios.ts - Public profile → HTTP client: fetches profile
frontend/src/pages/PublicProfile.tsx - Public profile → Social sidebar: renders
frontend/src/pages/PublicProfile.tsx - Social sidebar → Social state: uses
frontend/src/components/SocialSidebar.tsx - Social state → HTTP client: requests social data
frontend/src/store/socialStore.ts - Global chat UI → AI API client: requests AI
frontend/src/components/GlobalChatWidget.tsx - Global chat UI → Socket hook: uses socket
frontend/src/components/GlobalChatWidget.tsx - Socket hook → Social state: updates presence
frontend/src/hooks/useSocket.ts - Auth endpoints → Authentication: delegates to
backend/src/auth/auth.controller.ts - Auth endpoints → 2FA service: uses
backend/src/auth/auth.controller.ts - Auth endpoints → User profiles: uses
backend/src/auth/auth.controller.ts - Friend endpoints → Friend management: delegates to
backend/src/friends/friends.controller.ts - Post endpoints → Posts: delegates to
backend/src/posts/posts.controller.ts - Chat endpoints → Messaging: delegates to
backend/src/chat/chat.controller.ts - AI endpoints → AI orchestration: delegates to
backend/src/ai/ai.controller.ts - Authentication → Prisma data access: queries
backend/src/auth/auth.service.ts - 2FA service → Prisma data access: reads and writes
backend/src/auth/2fa/two-factor-auth.service.ts - Friend management → Prisma data access: queries
backend/src/friends/friends.service.ts - Posts → Prisma data access: queries
backend/src/posts/posts.service.ts - User profiles → Prisma data access: queries
backend/src/users/users.service.ts - Messaging → Prisma data access: queries
backend/src/chat/chat.service.ts - AI orchestration → Prisma data access: uses
backend/src/ai/ai.service.ts - Nest app composition → Auth endpoints: registers module
backend/src/app.module.ts - Nest app composition → Prisma data access: configures provider
backend/src/app.module.ts - 42 OAuth strategy → Authentication: validates identity
- Chat gateway → Messaging: dispatches messages
- Presence gateway → Friend management: dispatches presence
backend/src/friends/friends.service.ts - AI API client → AI endpoints: calls backend