Skip to content

skp3214/TinderLite-DatingApp-LLD-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinderLite - Dating App - LLD Project

Overview

TinderLite - Dating App is a low-level design (LLD) for a simplified dating application, inspired by platforms like Tinder. It manages user profiles, matching, swiping, chatting, and notifications using design patterns such as Singleton, Observer, Strategy, Factory, and Facade to ensure modularity and scalability.

alt text

Features

  • User Management: Create and manage user profiles with personal details, preferences, and interests.
  • Matching System: Calculate match scores based on gender preferences, age range, distance, and shared interests.
  • Swipe Functionality: Implement like/dislike swipes with mutual swipe detection for matches.
  • Chat System: Enable messaging between matched users.
  • Notification Service: Notify users of matches and new messages using the Observer pattern.
  • Location Services: Find nearby users based on geographic proximity using the Haversine formula.
  • Singleton Managers: Uses centralized control with DatingApp and NotificationService.

Class Structure

The system is divided into several key components, as illustrated in the class diagram:

Models

  • UserProfile: Represents a user profile with name, age, gender, bio, photos, interests, and location.
  • User: A user with an ID, profile, preferences, swipe history, and notification observer.
  • Preference: Manages user preferences for gender, age range, distance, and interests.
  • Location: Stores latitude and longitude, with a method to calculate distance.
  • Interest: Represents a user interest with a name and category.
  • Message: Represents a chat message with sender ID, content, and timestamp.
  • ChatRoom: Manages a chat between two users with a list of messages.
  • Gender: Enum for user gender options.
  • SwipeAction: Enum for swipe actions (LEFT, RIGHT).

Notification

  • NotificationObserver: Interface for notification observers.
  • UserNotificationObserver: Concrete observer for user notifications.
  • NotificationService (Singleton): Manages observer registration and notifications.

Location

  • LocationStrategy: Interface for location-based strategies.
  • BasicLocationStrategy: Concrete strategy to find nearby users.
  • LocationService (Singleton): Manages location-based user searches.

Matching

  • Matcher: Interface for calculating match scores.
  • BasicMatcher: Base matcher checking gender, age, and distance.
  • InterestsBasedMatcher: Enhances matching with shared interests.
  • LocationBasedMatcher: Adds proximity-based scoring.
  • MatcherFactory: Creates matcher instances.
  • MatcherType: Enum for matcher types.

App

  • DatingApp (Singleton): Facade for the entire system, handling user creation, swiping, and chatting.

Usage

Initialize the System

The Main class sets up users with profiles, preferences, and locations.

User Interaction

  • A User is created with a profile and preferences.
  • Users can swipe on others, triggering match notifications if mutual.
  • Matched users can send messages via a ChatRoom.

DatingApp Methods

  • DatingApp.findNearbyUsers locates potential matches within a distance.
  • DatingApp.swipe processes swipe actions and handles matches.
  • DatingApp.sendMessage facilitates chat between users.

Design Patterns Used

  • Factory Pattern: MatcherFactory creates matcher instances.
  • Strategy Pattern: LocationStrategy allows flexible location logic.
  • Singleton Pattern: DatingApp, NotificationService, and LocationService ensure single instances.
  • Observer Pattern: NotificationService notifies users of events.
  • Facade Pattern: DatingApp simplifies system interactions.

How to Run

The entry point is Main.java. Compile and run it to see a demo:

  • Initializes users with sample profiles.
  • Displays profiles, finds nearby users, simulates swipes, and creates a chat.
  • Outputs the chat summary with timestamps.

alt text

Class Diagram

Refer to the provided class diagram for a visual representation of the system architecture, showing relationships between classes, methods, and attributes. alt text

About

TinderLite is a Java-based low-level design (LLD) project for Dating App inspired by Tinder.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages