Skip to content

mitul-bhatia/Flately

Repository files navigation

Flately

Flately Logo

Flately animated heading

TypeScript Node.js MongoDB React Socket.IO

Flately helps users find compatible roommates through guided onboarding, weighted preference matching, and real-time messaging.


The Team

The success of Flately is attributed to a highly coordinated and specialized team:

  • Mitul Bhatia: Team Lead β€” Coordinated the entire project lifecycle and managed cross-module integrations.
  • Hardik Maheshwari: Deployment & User Flow Lead β€” Spearheaded the deployment architecture and orchestrated the complete user journey.
  • Ajeesh Amreet: Recommendation & Chat Engineer β€” Architected the core matching engine and implemented the live Socket.IO-based chat features.
  • Akshat Chauhan: Database Lead β€” Designed the Entity-Relationship models and managed the MongoDB Atlas integration.
  • Suryansh Singh: Strategic Lead, UI & Documentation Manager β€” Designed the minimalist UI, managed all structural diagrams, authored the core architectural reports, and guided strategic direction.

Product Summary

Flately solves a practical housing pain point: roommate decisions are high-risk and usually made with low-quality context.

Our app improves this by combining:

  1. Structured user and lifestyle profiling
  2. Preference-weighted match scoring
  3. Mutual-interest conversion into direct chat

Hero User Journey

flowchart LR
  Landing[Landing] --> Start[Questionnaire]
  Start --> Auth{Auth Choice}
  Auth --> Signup[Signup]
  Auth --> Login[Login]
  Auth --> Google[Google OAuth]

  Signup --> Onboarding[Onboarding]
  Login --> App[App Home]
  Google --> Callback[Callback]
  Callback --> App

  Onboarding --> App
  App --> Discover[Discover]
  Discover --> Matches[Matches]
  Matches --> Chat[Chat]
  App --> Profile[Profile]
Loading

Route mapping:

  • Landing: /
  • Questionnaire: /start
  • Signup: /signup
  • Login: /login
  • Callback: /auth/callback
  • Onboarding: /app/onboarding
  • App Home: /app
  • Discover: /app/discover
  • Matches: /app/matches
  • Chat: /app/chat/:matchId?
  • Profile: /app/profile

Architecture Diagram

%%{init: {'theme':'base','themeVariables': {
  'primaryColor':'#EDF7F6',
  'primaryTextColor':'#0F4C5C',
  'primaryBorderColor':'#0F4C5C',
  'lineColor':'#0F4C5C',
  'secondaryColor':'#F7F5EF',
  'tertiaryColor':'#FFFFFF'
}}}%%
flowchart LR
  subgraph FE[Frontend Layer]
    UI[React 19 + Vite 7]
    Store[Redux Toolkit]
    Guards[Auth Bootstrap + Route Guards]
    SocketClient[Socket.IO Client]
    UI --> Store --> Guards --> SocketClient
  end

  subgraph BE[Backend Layer]
    API[Express 5 API]
    JWT[JWT Middleware Chain]
    Domain[Domain Modules\nAuth, Profiles, Preferences, Discovery, Matches, Chat, Uploads]
    Realtime[Socket.IO Gateway]
    API --> JWT --> Domain
    Realtime --> Domain
  end

  subgraph DATA[Data + Services]
    DB[(MongoDB Atlas via Prisma)]
    OAuth[Google OAuth]
    Media[Cloudinary Signed Uploads]
  end

  FE -->|REST + Bearer JWT| API
  FE -->|WebSocket| Realtime
  Domain --> DB
  Domain --> OAuth
  Domain --> Media
Loading

Tech Stack (Exact Versions)

Frontend

Technology Version
React 19.2.3
Vite 7.2.4
TypeScript 5.9.3
Redux Toolkit 2.11.2
React Router DOM 6.30.3
Socket.IO Client 4.8.3
TailwindCSS 4.1.18
Framer Motion 12.29.2
React Hook Form 7.71.1
Zod 4.3.5
Playwright 1.59.1

Backend

Technology Version
Express 5.2.1
TypeScript 5.9.3
Prisma + Prisma Client 6.19.2
Socket.IO 4.8.3
jsonwebtoken 9.0.3
Zod 3.23.8
Helmet 8.1.0
express-rate-limit 8.2.1
tsx 4.19.2
Vitest 2.1.8

πŸ“Š UML Diagrams

All UML diagrams are verified against the actual TypeScript codebase. Each diagram has a Mermaid source (.mmd) and a rendered PNG.

πŸ“‹ Full Documentation: UML_DIAGRAMS.md | πŸ—ΊοΈ Planning: Future Plan

Diagram Overview

# Diagram What It Shows Source Image
1 Class Diagram 18 core classes, Strategy/Factory/Template Method patterns .mmd .png
2 Use Case Diagram 5 actors, 15 use cases across 7 system modules .mmd .png
3 ERD 7 Prisma/MongoDB models with all FK/PK constraints .mmd .png
4 Activity Diagram Full user journey: login β†’ discovery β†’ match β†’ chat .mmd .png
5 Sequence Diagram Swipe β†’ onboarding check β†’ mutual match creation .mmd .png

πŸ–ΌοΈ Visual Previews

πŸ“ 1. Class Diagram β€” Architecture & Design Patterns

Shows all TypeScript classes, interfaces, abstract classes, and their relationships.

Key Patterns: Strategy, Factory, Template Method, Adapter, Singleton, Observer

Class Diagram

πŸ“„ View Mermaid Source


🎯 2. Use Case Diagram β€” Actor-System Interactions

Maps external actors to 15 system operations across 7 modules.

Actors: Guest User, Authenticated User, Google OAuth, Cloudinary CDN, Socket.IO Client

Use Case Diagram

πŸ“„ View Mermaid Source


πŸ—„οΈ 3. Entity-Relationship Diagram β€” Database Schema

All 7 Prisma models with field types, primary keys, foreign keys, and cardinalities.

Models: User, Profile, Preference, Swipe, Match, Conversation, Message

ERD Diagram

πŸ“„ View Mermaid Source


πŸ”„ 4. Activity Diagram β€” Discovery, Matching & Chat Flow

End-to-end state flow from login through onboarding, discovery, matching, and real-time chat.

Key Flows: Authentication gates, onboarding checks, mutual match detection

Activity Diagram

πŸ“„ View Mermaid Source


πŸ”€ 5. Sequence Diagram β€” Swipe & Match Process

Complete POST /discovery/swipe interaction flow through all backend layers.

Participants: Frontend β†’ Controller β†’ Service β†’ Matching β†’ Matches β†’ MongoDB

Sequence Diagram

πŸ“„ View Mermaid Source



Product Features Delivered

  1. Authentication

    • Email/password signup and login
    • Backend-managed Google OAuth
    • JWT-protected app access
  2. Onboarding + Profile Intelligence

    • Structured profile capture
    • Preference capture with weighted dimensions
    • Onboarding gate enforcement before discovery and matching
  3. Discovery and Matching

    • Candidate feed retrieval
    • Swipe actions with mutual-like match creation logic
  4. Real-time Chat

    • Match-scoped conversations
    • Socket.IO-based message delivery
    • Conversation and message persistence
  5. Engineering Quality

    • Manual fetch transport with Adapter + Strategy architecture
    • Typed full-stack contracts and validation layers
    • Architecture and verification docs for reproducible delivery

Local Setup (Demo Ready)

Prerequisites

  • Node.js >= 18
  • npm >= 9
  • MongoDB Atlas (or local Mongo)
  • Google OAuth credentials
  • Cloudinary credentials

Run Backend

cd backend
npm install
npx prisma generate
npm run dev

Backend: http://localhost:4000

Run Frontend

cd frontend
npm install
npm run dev

Frontend: http://localhost:5174

Health Check

curl http://localhost:4000/health

Expected response:

{ "status": "ok" }

Verification Snapshot

All verification complete as of 2026-05-03:

  • βœ… Backend typecheck: pass
  • βœ… Backend tests: pass
  • βœ… Backend build: pass
  • βœ… Frontend typecheck: pass
  • βœ… Frontend tests: pass
  • βœ… Frontend build: pass
  • βœ… Manual auth flows: verified

Testing Guide: Manual Auth End-to-End Verification


πŸ“š Documentation

πŸ“– Complete Documentation Index - Master navigation for all documentation

Quick Links

Category Documents
Getting Started Setup Β· User Flow Β· Architecture
Implementation Backend Reference Β· Frontend Guide Β· API Reference
Database Schema Β· Matching Algorithm
Testing Auth Verification
Design UML Diagrams Β· System Design Study Guide
Planning Future Plan Β· Historical Archive

Pitch Using This README Only

  1. Open Product Summary to frame the problem.
  2. Use Hero User Journey to explain conversion flow.
  3. Present Architecture Diagram for technical depth.
  4. Show Diagram Library to prove system rigor.
  5. Close with Verification Snapshot for execution credibility.

Brand colors used in this README:

  • #0F4C5C
  • #0A3742
  • #EDF7F6
  • #F7F5EF

About

Best flatmate finding app in town

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors