# akashakula327/resolve-hub-fe architecture

> Architecture diagram of the GitHub repository akashakula327/resolve-hub-fe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akashakula327/resolve-hub-fe
- Repository: https://github.com/akashakula327/resolve-hub-fe

## Overview

##### Project type and purpose
- This is a Single‐Page Application (SPA) front-end for a complaints management tool (“Lovable” complaint portal).
- Built with React + TypeScript, bundled by Vite, styled with Tailwind CSS, and using the shadcn-ui component library.
- It runs entirely in the browser, fetching data and authentication from external APIs or services.

##### File structure
- Top-level:
- public/ – static assets (index.html, robots.txt)
- src/ – all application code
- src/main.tsx – React entry point
- src/App.tsx + App.css – root component & styles
- vite.config.ts, tsconfig*.json, tailwind.config.ts – build & compiler configs
- src/components/ – presentational and layout components, including DashboardLayout, ProtectedRoute, NavLink, StatusBadge
- src/components/ui/ – primitive UI building blocks (buttons, dialogs, tables, forms, etc.) provided by shadcn-ui + Tailwind
- src/contexts/ – global state providers (AuthContext, ComplaintContext)
- src/hooks/ – custom React hooks (useToast, useMobile)
- src/lib/ – utility functions (e.g. utils.ts)
- src/pages/ – route-based views (Login, Register, Dashboard, AdminComplaints, OfficerComplaints, ManageCitizens, ManageOfficers, SubmitComplaint, NotFound)

##### README for additional insights
- Confirms tech stack: Vite, React, TypeScript, shadcn-ui, Tailwind CSS
- Describes development flow (npm run dev) and deployment via the Lovable platform
- No backend code here – the SPA communicates with external APIs for data and auth

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "External Services"
        direction TB
        SA["Static Asset Host<br/>(public/index.html,<br/>robots.txt)"]:::external
        AuthAPI["Authentication API"]:::external
        ComplAPI["Complaints API"]:::external
    end

    subgraph "Build & Dev Tooling"
        direction TB
        Vite["Vite Build & Dev Server<br/>(vite.config.ts,<br/>tsconfig*.json)"]:::build
    end

    subgraph "Client App"
        direction TB
        ME["src/main.tsx"]:::client
        RC["src/App.tsx &<br/>src/App.css"]:::client
        CTX["Context Providers<br/>(AuthContext,<br/>ComplaintContext)"]:::client
        HK["Custom Hooks<br/>(use-toast,<br/>use-mobile)"]:::client
        UT["Utilities<br/>(src/lib/utils.ts)"]:::client
        UI["UI Primitives<br/>(src/components/ui/*)"]:::client
        PC["Shared Components<br/>(DashboardLayout,<br/>ProtectedRoute,<br/>NavLink,StatusBadge)"]:::client
        PG["Pages<br/>(src/pages/*.tsx)"]:::client
    end

    Vite -->|builds & bundles| SA
    SA -->|serves bundles| ME
    ME -->|boots React App| RC
    RC -->|wraps with| CTX
    RC -->|renders UI & Layout| PC
    PC -->|renders pages| PG
    RC -->|uses primitives| UI
    RC -->|uses utils| UT
    CTX -->|uses hooks| HK
    CTX -->|uses utils| UT
    PG -->|uses UI & components| UI
    PG -->|uses shared components| PC
    PG -->|calls Auth| AuthAPI
    PG -->|calls Complaints| ComplAPI

    click SA "https://github.com/akashakula327/resolve-hub-fe/blob/main/public/index.html"
    click Vite "https://github.com/akashakula327/resolve-hub-fe/blob/main/vite.config.ts"
    click ME "https://github.com/akashakula327/resolve-hub-fe/blob/main/src/main.tsx"
    click RC "https://github.com/akashakula327/resolve-hub-fe/blob/main/src/App.tsx"
    click UI "https://github.com/akashakula327/resolve-hub-fe/tree/main/src/components/ui/"
    click PC "https://github.com/akashakula327/resolve-hub-fe/blob/main/src/components/DashboardLayout.tsx"
    click CTX "https://github.com/akashakula327/resolve-hub-fe/blob/main/src/contexts/AuthContext.tsx"
    click HK "https://github.com/akashakula327/resolve-hub-fe/blob/main/src/hooks/use-toast.ts"
    click UT "https://github.com/akashakula327/resolve-hub-fe/blob/main/src/lib/utils.ts"

    classDef external fill:#ffe6e6,stroke:#cc0000,stroke-width:1px;
    classDef build fill:#fff0b3,stroke:#ff9900,stroke-width:1px;
    classDef client fill:#e6ffe6,stroke:#339933,stroke-width:1px;
```
