# kgand/shellhacks2024 architecture

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

- Interactive diagram: https://gitdiagram.com/kgand/shellhacks2024
- Repository: https://github.com/kgand/shellhacks2024

## Overview

##### Project type and purpose
- This is a full-stack “Lotion” application combining a React Native/Expo mobile frontend with a Python/Flask backend.
- Purpose: AI-powered note classification, query, and AR-based annotation using camera scans.

##### Top-level components
a. Mobile (frontend)
- App entry points: app.json, app/_layout.tsx, index.tsx
- Pages/flows: (auth) login/register, (extra) onboarding, (pages) home
- UI components: ARCamera, CreateNote, Query, Quiz, Read, SubjectDetails, onboarding/login/register subfolders
- Context: AuthProvider
- Utilities: auth, network, inference, classes
- Configs: Tailwind, Firebase
b. Server (backend)
- Flask app: app.py (defines HTTP endpoints)
- Modules:
– image_processing.py (camera image → text via Google Vision)
– sentiment_processing.py
– database_actions.py (app-level CRUD logic)
– mongo_actions.py (low-level MongoDB operations)
- Data: Test_Data
- Dependencies: requirements.txt
c. Datastores & External services
- MongoDB (persistent note storage)
- Firebase Auth (mobile user authentication)
- Google Vision API (OCR)
- ChatGPT API / HuggingFace (text classification & query)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Mobile App
    subgraph "Mobile App" 
        direction TB
        EntryPoints["Entry Points"]:::frontend
        AuthPages["Auth Pages"]:::frontend
        ExtraFlow["Onboarding Flow"]:::frontend
        MainPages["Main Pages"]:::frontend
        UIComponents["UI Components"]:::frontend
        Context["AuthProvider"]:::frontend
        Utils["Utils"]:::frontend
        Configs["Configurations"]:::frontend

        EntryPoints --> AuthPages
        AuthPages --> ExtraFlow
        ExtraFlow --> MainPages
        MainPages --> UIComponents
        UIComponents --> Context
        Context --> Utils
        Utils --> Configs
    end

    %% Backend Server
    subgraph "Flask Backend" 
        direction TB
        FlaskApp["app.py (API Gateway)"]:::backend
        ImageProc["image_processing.py"]:::backend
        Sentiment["sentiment_processing.py"]:::backend
        DBHigh["database_actions.py"]:::backend
        DBLow["mongo_actions.py"]:::backend
        TestData["Test_Data"]:::backend

        FlaskApp --> ImageProc
        FlaskApp --> Sentiment
        FlaskApp --> DBHigh
        DBHigh --> DBLow
        FlaskApp --> TestData
    end

    %% Datastores
    subgraph "Datastores"
        direction TB
        MongoDB["MongoDB"]:::db
        FirebaseAuth["Firebase Auth"]:::auth
    end

    %% External Services
    subgraph "External Services"
        direction TB
        GoogleVision["Google Vision API"]:::api
        AIModels["ChatGPT/HuggingFace"]:::api
    end

    %% Interactions
    User["User"]:::external
    User -->|"Interact"| EntryPoints
    EntryPoints -->|"uses Context"| Context
    Context -->|"verify via"| FirebaseAuth
    MainPages -->|"POST /scan /classify /query"| FlaskApp
    FlaskApp -->|"call OCR"| ImageProc
    ImageProc -->|"OCR request"| GoogleVision
    FlaskApp -->|"call NLP"| Sentiment
    Sentiment -->|"NLP request"| AIModels
    FlaskApp -->|"CRUD ops"| DBHigh
    DBHigh -->|"low-level ops"| MongoDB
    FlaskApp -->|"response JSON"| MainPages

    %% Click Events - Frontend
    click EntryPoints "https://github.com/kgand/shellhacks2024/blob/master/mobile/app.json"
    click EntryPoints "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/_layout.tsx"
    click EntryPoints "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/index.tsx"
    click AuthPages "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/(auth)/_layout.tsx"
    click AuthPages "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/(auth)/login.tsx"
    click AuthPages "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/(auth)/register.tsx"
    click ExtraFlow "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/(extra)/onboarding.tsx"
    click MainPages "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/(pages)/_layout.tsx"
    click MainPages "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/(pages)/home.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/ARCamera.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/camera/ARCamera.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/CreateNote.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/Query.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/Quiz.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/Read.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/SubjectDetails.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/CreateNoteModal.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/QueryResults.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/Menu.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/camera/CameraModal.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/camera/ScanningAnimation.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/login/Card.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/register/Card.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/onboarding/Card.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/onboarding/Modal.tsx"
    click UIComponents "https://github.com/kgand/shellhacks2024/blob/master/mobile/components/onboarding/Selector.tsx"
    click Context "https://github.com/kgand/shellhacks2024/blob/master/mobile/contexts/AuthProvider.tsx"
    click Utils "https://github.com/kgand/shellhacks2024/blob/master/mobile/utils/auth.ts"
    click Utils "https://github.com/kgand/shellhacks2024/blob/master/mobile/utils/network.ts"
    click Utils "https://github.com/kgand/shellhacks2024/blob/master/mobile/utils/inference.ts"
    click Utils "https://github.com/kgand/shellhacks2024/blob/master/mobile/utils/classes.ts"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/mobile/configs/firebase.ts"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/mobile/tailwind.config.js"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/mobile/app/tailwind.json"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/mobile/package.json"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/mobile/package-lock.json"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/mobile/tsconfig.json"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/mobile/babel.config.js"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/mobile/nativewind.env.d.ts"

    %% Click Events - Backend
    click FlaskApp "https://github.com/kgand/shellhacks2024/blob/master/server/app.py"
    click ImageProc "https://github.com/kgand/shellhacks2024/blob/master/server/image_processing.py"
    click Sentiment "https://github.com/kgand/shellhacks2024/blob/master/server/sentiment_processing.py"
    click DBHigh "https://github.com/kgand/shellhacks2024/blob/master/server/database_actions.py"
    click DBLow "https://github.com/kgand/shellhacks2024/blob/master/server/mongo_actions.py"
    click TestData "https://github.com/kgand/shellhacks2024/blob/master/server/Test_Data/Hugo_Liu_Resume.pdf"
    click Configs "https://github.com/kgand/shellhacks2024/blob/master/server/requirements.txt"

    %% Styles
    classDef frontend fill:#a0f0ed,stroke:#006666,stroke-width:2px;
    classDef backend fill:#cce5ff,stroke:#003366,stroke-width:2px;
    classDef db fill:#d4edda,stroke:#006600,stroke-width:2px,stroke-dasharray: 5 5;
    classDef auth fill:#e5ccff,stroke:#660066,stroke-width:2px;
    classDef api fill:#ffe5b4,stroke:#cc6600,stroke-width:2px;
    classDef external fill:#f0f0f0,stroke:#666666,stroke-width:1px,stroke-dasharray: 2 2;
```
