# sidhumanbirsingh/community_event_cli architecture

> Architecture diagram of the GitHub repository sidhumanbirsingh/community_event_cli, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sidhumanbirsingh/community_event_cli
- Repository: https://github.com/sidhumanbirsingh/community_event_cli

## Overview

##### Main Components
- User Interface/Interaction: Represented by the main.cpp and the console-based menu-driven workflow.
- Business Logic / Classes:
- Abstract Base Class: User (defines the interface with a pure virtual displayMenu() method).
- Derived Classes: CommunityMember and Administrator, each with their own functionalities.
- Event Class: Handles event details.
- Application Class: Manages event applications (status updates, etc.).
- Data Structures:
- Arrays: eventList (20 elements) and members (10 elements).
- Flow Controller: Main function which orchestrates login, menu interactions, and the overall flow between user types.

##### Relationships
- Encapsulation: The Event and Application classes encapsulate their data; these are used by the User-derived classes.
- Functional Flow:
- At startup, the main function prompts for login (Community Member or Administrator).
- Depending on login, the system navigates to either the CommunityMember’s or Administrator’s displayMenu() where specific operations (apply for events, view events, add events, approve/reject applications) are handled.
- The Event class instances (stored in an array) represent available events.
- CommunityMember objects use the Application class to manage their participation requests.

##### Architectural Patterns and Design Principles
- Object-Oriented Design (OOP) forming the core of the architecture.
- The separation of concerns is reflected in how the program distinguishes between user types and isolates event management logic to specific classes.
- The usage of static arrays for data storage indicates a simple, memory-resident design without persistence.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        main["Main (Console UI & Flow Controller)"]:::ui
        doc["System Design Documentation & Architectural Overview"]:::ui
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        user["User (Abstract)"]:::logic
        comm["CommunityMember"]:::logic
        admin["Administrator"]:::logic
        event["Event"]:::logic
        app["Application"]:::logic
    end

    %% Data Structures Layer
    subgraph "Data Structures Layer"
        eventList["Event eventList[20]"]:::data
        memberArr["CommunityMember members[10]"]:::data
    end

    %% Connections from UI to Business Logic
    main -->|"login_as"| comm
    main -->|"login_as"| admin

    %% Inheritance Relationships
    user -->|"inherits"| comm
    user -->|"inherits"| admin

    %% Functional Relationships within Business Logic
    comm -->|"applies_via"| app
    admin -->|"manages"| app
    admin -->|"manages"| event

    %% Data Storage Links
    event -->|"stored_in"| eventList
    comm -->|"stored_in"| memberArr

    %% Reference Documentation
    doc ---|"references"| main

    %% Click Events
    click main "https://github.com/sidhumanbirsingh/community_event_cli/blob/main/main.cpp"
    click doc "https://github.com/sidhumanbirsingh/community_event_cli/blob/main/READme.md"
    click user "https://github.com/sidhumanbirsingh/community_event_cli/tree/main/System_Design"
    click comm "https://github.com/sidhumanbirsingh/community_event_cli/tree/main/System_Design"
    click admin "https://github.com/sidhumanbirsingh/community_event_cli/tree/main/System_Design"
    click event "https://github.com/sidhumanbirsingh/community_event_cli/tree/main/System_Design"
    click app "https://github.com/sidhumanbirsingh/community_event_cli/tree/main/System_Design"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef logic fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef data fill:#FFC0CB,stroke:#000,stroke-width:2px;
```
