# jenish-1235/sports-equipment-inventory-management architecture

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

- Interactive diagram: https://gitdiagram.com/jenish-1235/sports-equipment-inventory-management
- Repository: https://github.com/jenish-1235/sports-equipment-inventory-management

## Overview

##### Project Type Analysis
This is a web-based inventory management system with Firebase as the backend, following a client-side architecture with distinct user roles (admin and student).

##### Main Components

A. Client-Side Components (Frontend):
- Login Portal
- Admin Dashboard
- Student Dashboard
- Static Assets (Scripts and Styles)

B. Backend Services:
- Firebase Authentication
- Firebase Realtime Database/Firestore
- Firebase Hosting (implied by the architecture)

**┌─ Presentation Layer ─────┐    ┌─ Firebase Services ──┐**
- ┌─ User Interfaces ───┐  │    │  ┌─ Auth ─────────┐ │
- Login Portal     │  │    │  │                │ │
- Admin Dashboard  │──┼────┼──│  Authentication │ │
- Student Dashboard│  │    │  │                │ │
- ┘  │    │  └────────────────┘ │
- ┌─ Database ────┐  │
- ┌─ Static Assets ──────┐  │    │  │  - Inventory │  │
- CSS Styles        │  │    │  │  - Users     │  │
- JavaScript        │  │    │  │  - Requests  │  │
- ┘  │    │  └────────────────┘ │
- ┘    └───────────────────────┘

##### Component Details

- Blue: User Interfaces
- Green: Firebase Services
- Orange: Static Assets
- Gray: Data Flow Lines

##### Specific Flows

A. Authentication Flow:
- Login Portal → Firebase Auth
- Redirect to appropriate dashboard based on role

B. Admin Operations:
- Inventory Management
- User Blacklisting
- Request Processing

C. Student Operations:
- Equipment Borrowing
- History Viewing
- Issue Reporting

##### Data Structure Representation

**Inventory {**
- itemId
- name
- quantity
- status
**}**

**BorrowRequests {**
- requestId
- studentId
- itemId
- status
- timestamp
**}**

**Users {**
- userId
- role
- blacklistStatus
**}**

##### Important Notes

- Notes about Firebase security rules
- Error handling paths
- User session management flow

##### Additional Elements

- Environment indicators (dev/prod)
- Critical security checkpoints
- Backup/recovery paths

Remember to:
- Use consistent notation
- A version number
- A brief textual description

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#a8d1ff,stroke:#2270c1
    classDef backend fill:#98e3a1,stroke:#2d8735
    classDef static fill:#ffd7a8,stroke:#c17922
    classDef database fill:#c2a8ff,stroke:#5922c1
    classDef auth fill:#ffa8a8,stroke:#c12222

    %% System Boundary
    subgraph System["Sports Equipment Inventory Management System"]
        %% Frontend Layer
        subgraph Frontend["Presentation Layer"]
            %% User Interfaces
            Login["Login Portal"]
            AdminDash["Admin Dashboard"]
            StudentDash["Student Dashboard"]
            
            %% Static Assets
            subgraph Assets["Static Assets"]
                Styles["CSS Styles"]
                Scripts["JavaScript"]
                Images["Image Assets"]
            end
        end

        %% Backend Layer
        subgraph Firebase["Firebase Services"]
            Auth["Authentication"]
            
            subgraph DB["Database"]
                Inventory["Inventory Data"]
                Users["User Data"]
                Requests["Borrow Requests"]
            end
        end
    end

    %% Relationships
    Login --> Auth
    Auth --> AdminDash
    Auth --> StudentDash
    AdminDash --> DB
    StudentDash --> DB
    Scripts --> DB
    
    %% Component Styling
    class Login,AdminDash,StudentDash frontend
    class Auth auth
    class Inventory,Users,Requests database
    class Styles,Scripts,Images static

    %% Click Events
    click Login "https://github.com/Jenish-1235/Sports-Equipment-Inventory-Management/blob/main/index.html"
    click AdminDash "https://github.com/Jenish-1235/Sports-Equipment-Inventory-Management/blob/main/admin_dashboard.html"
    click StudentDash "https://github.com/Jenish-1235/Sports-Equipment-Inventory-Management/blob/main/student_dashboard.html"
    click Scripts "https://github.com/Jenish-1235/Sports-Equipment-Inventory-Management/tree/main//Scripts"
    click Styles "https://github.com/Jenish-1235/Sports-Equipment-Inventory-Management/tree/main//Styles"
    click Images "https://github.com/Jenish-1235/Sports-Equipment-Inventory-Management/tree/main//Images"

    %% Legend
    subgraph Legend
        FE["Frontend Component"]:::frontend
        BE["Backend Service"]:::backend
        ST["Static Asset"]:::static
        DB2["Database"]:::database
        AT["Authentication"]:::auth
    end
```
