# venkataphanindravutla/chatushtaya architecture

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

- Interactive diagram: https://gitdiagram.com/venkataphanindravutla/chatushtaya
- Repository: https://github.com/venkataphanindravutla/chatushtaya

## Overview

##### Main Components

A. Client-Side Applications
- Mobile App (React Native)
- Form Flow (/app/(form))
- Tab-based Navigation (/app/(tabs))
- Authentication Screens (login.jsx, register.jsx)
- AI Integration (ai.jsx)
- Admin Portal (Web - React.js + Vite) [Note: separate repository]

B. Backend Services (Firebase)
- Authentication Service
- Realtime Database
- Cloud Functions
- Storage (for uploaded content)

C. External Services
- AI/ML Services (for chatbot - Naira)
- Email Notification System

**[Client Layer] → [Service Layer] → [Data Layer]**

##### Component Relationships

**Mobile App ↔ Firebase Auth**
**Mobile App ↔ Realtime Database**
**Mobile App ↔ AI Service**
**Admin Portal ↔ Firebase Auth**
**Admin Portal ↔ Realtime Database**
**Firebase Functions ↔ Email Service**

##### Detailed Component Breakdown

Mobile App (React Native):
**[Navigation Layer]**
- ↓
**[Authentication Context]**
- ↓
**[Feature Modules]**
- Report Management
- AI Chat Support
- Resource Access
- User Profile

Backend (Firebase):
**[Authentication]**
- ↓
**[Data Storage]**
- User Profiles
- Incident Reports
- Resource Materials
- ↓
**[Cloud Functions]**
- Report Processing
- Notifications
- Analytics

##### Elements

- User roles (Student, Admin, Support Staff)
- Security checkpoints
- Data storage locations
- API endpoints
- Event triggers
- Notification paths

##### Additional Details

- Report submission workflow
- Authentication flow
- Admin dashboard architecture
- AI chatbot integration

- Privacy-first architecture
- Real-time capabilities
- Scalability points
- Security measures

Remember to:
- Use standardized symbols
- Version information
- Document integration points

This system design should reflect the sensitive nature of the application's purpose while demonstrating its robust security and support features. Make sure to highlight the anonymous reporting pathway and the immediate support mechanisms (like the Naira chatbot) as critical components of the architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        MA[Mobile App]
        AP[Admin Portal]
        
        subgraph "Form Flow"
            FD["Details"]:::file
            FL["Location"]:::file
            FU["Upload"]:::file
            FS["Success"]:::file
        end
        
        subgraph "Tab Navigation"
            AI["AI Interface"]:::file
            CO["Contact"]:::file
            RE["Reports"]:::file
        end
        
        subgraph "Authentication"
            LG["Login"]:::file
            RG["Register"]:::file
            AC["Auth Context"]:::file
        end
        
        subgraph "Components"
            CS["Chat Screen"]:::file
            MH["Message Handler"]:::file
            RH["Response Handler"]:::file
            FC["Form Container"]:::file
            FH["Form Header"]:::file
            FS["Form Screen"]:::file
            IC["Inputs Container"]:::file
            TB["Tab Bar"]:::file
            TBB["Tab Bar Button"]:::file
        end
    end
    
    subgraph Service
        FA[Firebase Auth]
        FF[Firebase Functions]
        
        subgraph "Backend"
            FC["Firebase Config"]:::file
            UT["Utils"]:::file
        end
        
        subgraph "Context"
            RC["Report Context"]:::file
            RD["Report Detail"]:::file
            RL["Reports List"]:::file
        end
    end
    
    subgraph Data
        RDB[(Realtime DB)]
        ST[(Storage)]
    end
    
    subgraph External
        AIS[AI Service]
        ENS[Email Service]
    end
    
    MA --> FA
    MA --> RDB
    MA --> AIS
    AP --> FA
    AP --> RDB
    FF --> ENS
    FA --> RDB
    FF --> ST
    
    %% Click events
    click FD "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/(form)/details.jsx"
    click FL "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/(form)/locationdt.jsx"
    click FU "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/(form)/upload.jsx"
    click FS "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/(form)/success.jsx"
    click AI "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/(tabs)/ai.jsx"
    click CO "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/(tabs)/contact.jsx"
    click RE "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/(tabs)/reports.jsx"
    click LG "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/login.jsx"
    click RG "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/register.jsx"
    click AC "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//context/AuthProvider.jsx"
    click FC "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//backend/firebase.js"
    click UT "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//backend/utils.js"
    click CS "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/ChatScreen.jsx"
    click MH "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/message.js"
    click RH "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/response.js"
    click RC "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//context/ReportProvider.jsx"
    click RD "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/report/[id].jsx"
    click RL "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//app/(tabs)/reports.jsx"
    click FC "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/FormContainer.jsx"
    click FH "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/FormHeader.jsx"
    click FS "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/FormScreen.jsx"
    click IC "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/InputsContainer.jsx"
    click TB "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/TabBar.jsx"
    click TBB "https://github.com/venkataPhanindraVutla/chatushtaya/blob/main//components/TabBarButton.jsx"

    classDef file fill:#f9f,stroke:#333,stroke-width:2px
    classDef default fill:#fff,stroke:#333,stroke-width:2px
    
    %% Legend
    subgraph Legend
        L1[Client Component]
        L2[Service Component]
        L3[Data Store]
        L4[External Service]
        L5[File Component]:::file
    end
```
