Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

175 Commits

Folders and files

Repository files navigation

This project has been created as part of the 42 curriculum by braelino, eralambo, nyrandri, rmamisoa, yandriam.

ft_transcendence

Description

Project name: ft_agar.io (ft_transcendence)

ft_agar.io is a full-stack multiplayer web application inspired by agar-style gameplay. Players can authenticate, join real-time matches, interact socially (friends/chat/profile), and track long-term progression through persistent statistics and match history.

Key features

  • Real-time multiplayer game over WebSocket
  • User management (register/login/logout, OAuth 2.0)
  • Social features (profiles, friends, private chat)
  • Persistent game stats, history, and achievements
  • Multilingual UI (EN/FR/ES)

Instructions

Prerequisites

  • Docker Engine + Docker Compose
  • GNU Make
  • (Optional local tooling) Node.js 20+ and npm 10+

Setup and run (step-by-step)

  1. Clone repository
    • git clone <repository-url>
    • cd project
  2. Copy environment file
    • cp .env.example .env
    • Update environment values if needed.
  3. Copy mock data (demo mode)
    • Copy mock_data/ into backend/ before startup.
  4. Start stack
    • make up

Note: mock_data/ (user seed data for demo) is not committed to the repository. To run the project with pre-populated demo accounts, copy the mock_data/ folder to backend/ before running make up.

Access

Demo credentials

  • Demo users are seeded from backend/mock_data/users_credentials.md when demo mock_data/ is provided.
  • Example demo account:
    • Email: dylan.drift@ftmock.dev
    • Password: MockPass!01

Useful commands

  • Stop: make down
  • Rebuild cleanly: make re
  • Browser tests (from frontend): npm run test:browsers

Team Information

Member (login) Role Responsibilities
rmamisoa Product Owner (PO), Frontend Dev Product vision, backlog priorities, feature acceptance, profile/stats/leaderboard UI
braelino Project Manager (PM), Dev Sprint planning, task tracking, risk follow-up, chat/realtime integration
yandriam Tech Lead, Dev Architecture decisions, quality gates, integration reviews, i18n/testing/infra support
nyrandri Backend & Game Dev Core game engine, room lifecycle, persistence pipeline, gameplay balancing
eralambo Developer Authentication, OAuth flow, responsive frontend work, social interactions

Project Management

Work was organized with a feature-first roadmap: authentication → profile/friends/chat → game loop → persistence → hardening/tests.

Process used

  • Task slicing in short, reviewable increments
  • Feature branches + pull-request review before merge
  • Mandatory scope delivered first, modules validated afterward

Collaboration tools

  • GitHub (issues/PRs/branch history)
  • Discord (daily coordination and blocker resolution)
  • Shared planning board (task status and ownership tracking)

Technical Stack

Frontend

  • React + TypeScript + Vite: component-based architecture, fast dev cycle, static typing safety.
  • Tailwind CSS: rapid, consistent styling and responsive utility-first UI.
  • Socket.IO client: real-time events for gameplay and live presence.

Backend

  • NestJS: modular structure, strong DI pattern, scalable API and gateway organization.
  • Prisma ORM: type-safe DB access and reliable migration workflow.
  • PostgreSQL: relational consistency for social graph + match persistence.
  • Socket.IO: bi-directional low-latency communication for game state.

Infrastructure

  • Docker + Docker Compose: reproducible environment and one-command startup.
  • Nginx + HTTPS: single secure entrypoint and reverse proxy for frontend/backend.

Database Schema

Source of truth: backend/prisma/schema.prisma

Entity Key fields (examples) Main relations
Users id, email, username, passwordHash, googleId, createdAt 1→1 with profile data (implemented in user record), 1→N friendships/messages/games
Profiles displayName, avatarUrl, bio, onlineStatus, stats fields In this project, profile attributes are stored with Users and exposed through profile services
Friendships id, requesterId, addresseeId, status, createdAt N→1 to Users (requester/addressee), 1→N Messages
Messages id, friendshipId, senderId, content, createdAt N→1 Friendship, N→1 User (sender)
Games id, status, mode, startedAt, endedAt, settings 1→N GamePlayers
GamePlayers id, gameId, userId, rank, kills, maxMass, survivalTime N→1 Games, N→1 Users
Achievements id, key, title, description N↔N Users via UserAchievements
UserAchievements id, userId, achievementId, unlockedAt N→1 Users, N→1 Achievements

Features List

Feature Description Implemented by
Local authentication Register/login/logout with JWT guards and protected routes eralambo
OAuth 2.0 login Google OAuth flow and callback integration eralambo
User profile Profile retrieval/update, avatar and account settings eralambo, rmamisoa
Friends system Request/accept/reject/remove/block friendship actions eralambo, yandriam
Private chat Friendship-scoped messaging and history retrieval braelino, eralambo
Presence Online/offline and live activity updates braelino, nyrandri
Multiplayer gameplay Real-time movement, collisions, growth, win resolution nyrandri
Remote players Cross-client synchronized sessions over network nyrandri, yandriam
AI opponent Bot behavior integrated into game sessions nyrandri
Stats & match history Persistent results and profile progression views rmamisoa, yandriam
Achievements Unlock logic and user achievement display nyrandri, rmamisoa
Internationalization EN/FR/ES translations and runtime language switch yandriam, eralambo
Browser compatibility Multi-browser validation with Playwright yandriam

Modules

Category Module Type Points Status Justification
Web Framework for frontend + backend Major 2 Complete React + NestJS core architecture
Web Frontend framework Minor 1 Complete React frontend implementation
Web Backend framework Minor 1 Complete NestJS backend implementation
Web Real-time features (WebSockets) Major 2 Complete Socket-based live game + presence updates
Web Allow users to interact (chat/profile/friends) Major 2 Complete Full social interactions between users
Web ORM Minor 1 Complete Prisma with typed queries and migrations
User Management Standard user management/authentication Major 2 Complete Profile updates, auth, friend and status support
User Management OAuth 2.0 Minor 1 Complete Google login implemented
Gaming & UX Complete web-based game Major 2 Complete Playable multiplayer cell game
Gaming & UX Remote players Major 2 Complete Real-time matches on separate machines
Gaming & UX Multiplayer game (3+ players) Major 2 Complete Multiplayer support beyond two players
Artificial Intelligence AI Opponent Major 2 Complete Bot opponent integrated into gameplay loop
Accessibility & I18n Multiple languages (EN/FR/ES) Minor 1 Complete Full translation resources and language switcher
Accessibility & I18n Additional browsers support Minor 1 Complete Chromium/Firefox/WebKit smoke compatibility

Point total

  • Major modules: 8 × 2 = 16
  • Minor modules: 6 × 1 = 6
  • Total = 22 points

Individual Contributions

rmamisoa (PO, Frontend Dev)

  • Defined product vision and feature priority order.
  • Validated sprint outcomes and acceptance criteria.
  • Built/co-built profile and progression screens.
  • Co-implemented leaderboard and user-facing stats flows.

braelino (PM, Dev)

  • Coordinated planning, cadence, and blocker tracking.
  • Structured task ownership and delivery checkpoints.
  • Implemented/co-implemented chat and realtime presence features.
  • Contributed to social/game integration testing.

yandriam (Tech Lead, Dev)

  • Set architecture standards and integration conventions.
  • Led quality hardening across backend/frontend boundaries.
  • Co-implemented social flows, i18n, stats/history display.
  • Built browser compatibility tests and defense-readiness fixes.

nyrandri (Backend & Game Dev)

  • Built the core game engine and real-time gameplay mechanics.
  • Implemented room/match lifecycle and result persistence.
  • Contributed to socket orchestration and performance tuning.
  • Integrated AI player behavior and achievement-related hooks.

eralambo (Dev)

  • Implemented authentication (local + JWT) and OAuth integration.
  • Built/co-built profile and friendship interaction workflows.
  • Improved responsive frontend behavior.
  • Co-implemented i18n and UI polish for key user flows.

Resources

Documentation and references

AI usage in this project

AI assistance was used for:

  • Refactoring suggestions and boilerplate acceleration
  • Debugging support (error triage and alternative fixes)
  • Test scenario drafting and checklist generation
  • Documentation structure/compliance review

All AI-assisted outputs were manually reviewed, edited, and validated by team members before merge.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages