Fitness App Class Diagram - bounswe/bounswe2024group4 GitHub Wiki

classDiagram
    class User {
        +int ID
        +string email
        +string username
        +string password
    }
    class UserProfile {
        +string profilePicture
        +string bio
        +list createdPosts
        +list bookmarkedPosts
        +list createdExercisePrograms
        +list bookmarkedExercisePrograms
        +list createdDietPrograms
        +list bookmarkedDietPrograms
        +bool isSupermember
    }
    class Post {
        +int ID
        +string title
        +string content
        +string pictureURL
        +datetime timestamp
    }
    class ExerciseProgram {
        +int ID
        +string name
        +list exercises
        +datetime timestamp
        +float averageRating
    }
    class DietProgram {
        +int ID
        +string name
        +list meals
        +datetime timestamp
        +float averageRating
    }
    class Comment {
        +int ID
        +string content
        +datetime timestamp
    }
    class Like {
        +int ID
    }
    class Bookmark {
        +int ID
        +datetime bookmarkedOn
    }
    class PostFeed {
        -- Aggregates posts
    }
    class Message {
        +int ID
        +string content
        +datetime timestamp
    }
    class WorkoutDB {
        +list exerciseList
    }
    class MealDB {
        +list mealList
    }
    class Leaderboard {
        +list topRatedExercisePrograms
        +list topRatedDietPrograms
    }
    class Rating {
        +int ratingValue
    }

    %% Positioning relationships
    User --> UserProfile : has
    User --> Post : creates
    User --> ExerciseProgram : creates
    User --> DietProgram : creates
    User --> Comment : writes
    User --> Like : gives
    User --> Bookmark : bookmarks
    User --> Message : sends
    User --> User : follows
    Bookmark --> Post : refers_to
    Bookmark --> ExerciseProgram : refers_to
    Bookmark --> DietProgram : refers_to
    Post --> Comment : includes
    Post --> Like : receives
    Comment --> Like : receives
    ExerciseProgram --> Post : can_be_posted_as
    DietProgram --> Post : can_be_posted_as
    ExerciseProgram --> Rating : receives
    DietProgram --> Rating : receives
    WorkoutDB --> ExerciseProgram : contains
    MealDB --> DietProgram : contains
    Supermember --> WorkoutDB : can_add_to
    Supermember --> MealDB : can_add_to
    Leaderboard --> ExerciseProgram : ranks
    Leaderboard --> DietProgram : ranks