# kavinandan18/attendance-gap-finder architecture

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

- Interactive diagram: https://gitdiagram.com/kavinandan18/attendance-gap-finder
- Repository: https://github.com/kavinandan18/attendance-gap-finder

## Overview

##### Project type and purpose
- This is a lightweight, open-source Streamlit web application (“Attendance Gap Finder”) whose primary purpose is to let users upload two data files (main vs. duplicate), compare them, and generate an output Excel file with discrepancies highlighted.
- It is not a microservices or distributed system—rather a single-process, monolithic Python app that runs a small web UI and executes in-memory data processing.

##### File structure
- Top level:
- attendance_gap_finder.py – the entire Streamlit app (UI + business logic)
- requirements.txt – lists Python dependencies (streamlit, pandas, openpyxl, etc.)
- README.md, LICENSE, .gitignore, sample Excel file
- No separate “frontend” or “backend” folders—they’re combined in one script using Streamlit.

##### README for additional insights
- Confirms use of Streamlit for interactive UI
- Uses Pandas for data manipulation, Openpyxl for Excel handling
- Outputs a new Excel file with highlighted differences and renders data tables in the browser

##### Main components
a. User (browser)
b. Streamlit Web Server (attendance_gap_finder.py)
c. Data Input Module
- File-uploader widgets
- Excel/CSV parsers (Pandas + Openpyxl)
d. Comparison Engine
- Pandas DataFrame diff logic
- Identification of missing/differing cells
e. Output Generator
- Excel writer (Openpyxl) with cell-level styling (highlighting)
- DataFrame renderers in Streamlit UI
f. File System / Local Storage
- Temporary in-memory DataFrames
- Generated “highlighted” Excel file on disk (or streamed to user)

##### Relationships and interactions
- User → uploads main & duplicate files to Streamlit Web Server
- Web Server invokes Data Input Module → reads into DataFrames
- DataFrames flow into Comparison Engine → outputs DataFrames + styling metadata
- Output Generator writes Excel file to local storage (or serves directly) and concurrently renders interactive tables in the browser
- User downloads highlighted Excel or views results in the UI

##### Architectural patterns / design principles
- Monolithic, single-process architecture
- 3-tier separation (presentation, business logic, data access) logically, even though collocated in one script
- Use of declarative UI (Streamlit) to minimize custom frontend code
- In-memory processing for small/medium datasets

##### Technologies / frameworks
- Python 3.x
- Streamlit – web UI framework
- Pandas – data manipulation
- Openpyxl – Excel file read/write + styling
- (requirements.txt) used by pip for reproducible environment

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef ui fill:#D0E8FF,stroke:#000,stroke-width:1px
    classDef logic fill:#D0FFD0,stroke:#000,stroke-width:1px
    classDef data fill:#FFF5BA,stroke:#000,stroke-width:1px

    User["User (Browser)"]:::ui
    subgraph "Streamlit Application"
        Streamlit["Streamlit Web Server\nattendance_gap_finder.py"]:::ui
        DataInput["Data Input Module\n(file-uploader, parsing)"]:::data
        CompEngine["Comparison Engine\n(diff logic)"]:::logic
        OutputGen["Output Generator\n(excel writer, render)"]:::logic
    end
    FileSys["File System / Local Storage\nHighlighted_Empmain.xlsx"]:::data
    subgraph "Support Files"
        Requirements["requirements.txt"]:::data
        README["README.md"]:::data
        License["LICENSE"]:::data
    end

    User -->|uploads files| DataInput
    DataInput -->|"DataFrames"| CompEngine
    CompEngine -->|"Styled DataFrames"| OutputGen
    OutputGen -->|"Styled Workbook / tables"| User
    OutputGen -->|"Excel file"| FileSys
    Requirements -->|dependencies| Streamlit
    README -->|documentation| Streamlit
    License -->|license info| Streamlit

    click Streamlit "https://github.com/kavinandan18/attendance-gap-finder/blob/master/attendance_gap_finder.py"
    click DataInput "https://github.com/kavinandan18/attendance-gap-finder/blob/master/attendance_gap_finder.py"
    click CompEngine "https://github.com/kavinandan18/attendance-gap-finder/blob/master/attendance_gap_finder.py"
    click OutputGen "https://github.com/kavinandan18/attendance-gap-finder/blob/master/attendance_gap_finder.py"
    click FileSys "https://github.com/kavinandan18/attendance-gap-finder/blob/master/Highlighted_Empmain.xlsx"
    click Requirements "https://github.com/kavinandan18/attendance-gap-finder/blob/master/requirements.txt"
    click README "https://github.com/kavinandan18/attendance-gap-finder/blob/master/README.md"
    click License "https://github.com/kavinandan18/attendance-gap-finder/tree/master/LICENSE"
```
