# krishpatel46/karmbhog architecture

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

- Interactive diagram: https://gitdiagram.com/krishpatel46/karmbhog
- Repository: https://github.com/krishpatel46/karmbhog

## Overview

##### Main Components

a. Client Layer (Mobile Application)
- User Interface (Activities and Layouts)
- Role-based Access Control
- Local Storage (ManagePreferences)

b. Business Logic Layer
- User Management
- Event Management
- Kitchen Management
- Worker Management
- Company Management
- Feedback System
- Donation System

c. Data Layer
- Firebase Integration (indicated by google-services.json)
- Data Models (objects package)

##### Component Relationships

**┌─────────────────────────────────────────────────────────────┐**
- Client Layer (Android)                   │
- ┬─────────────────────┬────────────────────┤
- Normal User   │  Kitchen Manager    │    Company User    │
- Interface    │    Interface        │     Interface      │
- ┬────────┴──────────┬──────────┴─────────┬─────────┘

- ▼                    ▼                    ▼
**┌─────────────────────────────────────────────────────────────┐**
- Business Logic Layer                      │
- ┬────────────────────┬─────────────────────┤
- Event Manager  │  Worker Manager    │   Company Manager   │
- Register     │  - Add/View        │   - Job Requests    │
- Track        │  - Assignments     │   - Reports         │
- Feedback        │   - Feedback        │
- ┴────────────────────┴─────────────────────┘

- ▼                    ▼                    ▼
**┌─────────────────────────────────────────────────────────────┐**
- Data Layer                            │
- ┤
- Firebase Backend                           │
- Authentication                                           │
- Real-time Database                                       │
- Storage (for images/documents)                           │
- ┘

##### Important Elements to Highlight

a. User Roles (3 distinct paths):
- Normal User Flow
- Kitchen Manager Flow
- Company User Flow

b. Core Features:
- Event Registration System
- Worker Management System
- Feedback & Rating System
- Donation System

c. Data Models (from objects package):
- Company
- Donor
- Events
- HungerEmployees
- KitchenManager
- WorkerRequests

##### Implementation Details

- Use standard UML notation where appropriate
- Notes for important architectural decisions
- Security boundaries between different user roles

##### Key Interactions to Demonstrate

- Event registration flow
- Worker request and assignment process
- Feedback submission and retrieval
- Donation processing
- Report generation and viewing

This architecture emphasizes the mobile-first nature of the application while showing its integration with cloud services for data persistence and real-time updates.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef client fill:#a8d1f0,stroke:#333
    classDef business fill:#90EE90,stroke:#333
    classDef data fill:#FFB347,stroke:#333
    classDef firebase fill:#CCCCCC,stroke:#333
    classDef adapter fill:#FFE4B5,stroke:#333

    %% Client Layer
    subgraph ClientLayer
        UI["User Interface Layer"]
        NormalUI["Normal User Interface"]
        KitchenUI["Kitchen Manager Interface"]
        CompanyUI["Company User Interface"]
        LocalStorage["Local Storage"]
        Auth["Authentication"]
    end

    %% Business Logic Layer
    subgraph BusinessLayer
        EventMgmt["Event Management"]
        WorkerMgmt["Worker Management"]
        KitchenMgmt["Kitchen Management"]
        FeedbackSys["Feedback System"]
        DonationSys["Donation System"]
    end

    %% Data Layer
    subgraph DataLayer
        DataModels["Data Models"]
        Adapters["Data Adapters"]
        Firebase["Firebase Backend"]
    end

    %% Relationships
    UI --> NormalUI & KitchenUI & CompanyUI
    NormalUI & KitchenUI & CompanyUI --> EventMgmt
    NormalUI & KitchenUI & CompanyUI --> WorkerMgmt
    KitchenUI --> KitchenMgmt
    NormalUI & CompanyUI --> FeedbackSys
    NormalUI --> DonationSys
    
    EventMgmt & WorkerMgmt & KitchenMgmt & FeedbackSys & DonationSys --> DataModels
    DataModels --> Adapters
    Adapters --> Firebase
    Auth --> Firebase
    LocalStorage --> UI

    %% Click Events
    click UI "https://github.com/krishpatel46/karmbhog/tree/master/app/src/main/res/layout/"
    click NormalUI "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/User_dashboard.java"
    click KitchenUI "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/Kitchens.java"
    click CompanyUI "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/Company_dashboard.java"
    click LocalStorage "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/classes/ManagePreferences.java"
    click Auth "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/SignUp.java"
    click EventMgmt "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/Register_event.java"
    click WorkerMgmt "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/Workers.java"
    click KitchenMgmt "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/Add_kitchens.java"
    click FeedbackSys "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/Feedback.java"
    click DonationSys "https://github.com/krishpatel46/karmbhog/blob/master/app/src/main/java/com/example/karmbhog/Donation.java"
    click DataModels "https://github.com/krishpatel46/karmbhog/tree/master/app/src/main/java/com/example/karmbhog/objects/"
    click Adapters "https://github.com/krishpatel46/karmbhog/tree/master/app/src/main/java/com/example/karmbhog/adapters/"
    click Firebase "https://github.com/krishpatel46/karmbhog/blob/master/app/google-services.json"

    %% Style Applications
    class NormalUI,KitchenUI,CompanyUI,UI,LocalStorage,Auth client
    class EventMgmt,WorkerMgmt,KitchenMgmt,FeedbackSys,DonationSys business
    class DataModels,Adapters data
    class Firebase firebase
```
