# nikhil-coder390/gdevaluationsystemfrontend architecture

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

- Interactive diagram: https://gitdiagram.com/nikhil-coder390/gdevaluationsystemfrontend
- Repository: https://github.com/nikhil-coder390/gdevaluationsystemfrontend

## Overview

##### Project type and purpose
- This is a single-page frontend application (React + TypeScript + Vite) for a “GD Evaluation System.”
- Purpose: Provide evaluators, administrators, and participants with real-time session management, scoring UI, analytics dashboards, and report generation.

##### File structure
Top-level:
- public/ – static assets (index.html, robots.txt)
- src/ – all application code
– main.tsx → application entrypoint, renders <App /> into index.html
– App.tsx + App.css → root layout, routing setup
– components/ → reusable UI pieces:
· auth/ (LoginForm, RegisterForm)
· layout/ (Navbar, Breadcrumb, PageContainer)
· ui/ (buttons, dialogs, tables, inputs, toasts, etc.)
– pages/ → route-level views (HomePage, DashboardPage, CreateSession, EvaluateSession, ExportReports, SessionDetails, SessionResults, Profile, LoginPage, RegisterPage, NotFound)
– context/ → React Context providers (AuthContext, GDContext)
– hooks/ → custom hooks (useMobile, useToast)
– integrations/ → Supabase client + types
– lib/ → utility functions
– types/ → shared TypeScript types
- config files: tsconfig.json, tailwind.config.ts, vite.config.ts, postcss.config.js, eslint.config.js

##### README insights
- Features: real-time evaluation, multi-parameter scoring, role-based UIs, session scheduling, analytics, PDF/Excel export
- Tech stack: React, TypeScript, Context API, Tailwind CSS, Axios (HTTP client), React Router, Vite, Jest/RTL
- Environment-based API URL and Supabase integration

a. Components:
- Browser (User Agent)
- Frontend SPA
– Routing layer (React Router)
– UI Layer (Tailwind + custom UI components)
– State layer (AuthContext, GDContext + custom hooks)
– Integrations (Supabase client, Axios to backend API)
- Backend API (external service)
- Supabase (Auth, DB tables)
- Database (PostgreSQL, via Supabase)
- Third-party services: PDF/Excel export library, analytics chart lib

b. Interactions:
1. User navigates pages via React Router → loads corresponding page component
2. Page component uses context/hooks → fetches data from Backend API / Supabase
3. AuthContext manages JWT tokens → attaches to API requests
4. GDContext manages session state in real time
5. UI components render data, send user input back to contexts/hooks → API calls
6. Responses update context → UI updates

c. Architectural patterns & principles:
- Component-based architecture (atomic UI library + composite page components)
- Separation of concerns: UI, state, data-fetching are decoupled via Context + hooks
- Unidirectional data flow: context/providers → page → UI → actions → API → context
- Integration abstraction: “integrations/” folder isolates Supabase client
- Configuration-driven (env vars for API_URL, build configs via Vite)

d. Key technologies:
- React + TypeScript for UI & type safety
- Vite as build tool / dev server
- Tailwind CSS + PostCSS for styling
- React Router for client-side routing
- Context API for global state
- Axios or fetch for HTTP calls
- Supabase SDK for auth & realtime DB
- Jest + React Testing Library for unit/integration tests

##### Essential details to capture
- Entry point: index.html → main.tsx → App.tsx → Router
- UI library folder vs. business-logic pages
- Context providers wrapping the App
- Supabase client initialization and usage in contexts/hooks
- API URL injection from .env
- Tailwind/Vite build pipeline (config files)

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser (User)"]:::external
    subgraph "Frontend Application"
        direction TB

        Entry["index.html → main.tsx"]:::root
        click Entry "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/main.tsx"

        App["App.tsx + App.css"]:::root
        click App "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/App.tsx"

        subgraph "UI Component Library"
            direction TB
            UILib["src/components/ui/"]:::ui
            click UILib "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/tree/master/src/components/ui/"
        end

        subgraph "Authentication UI Components"
            direction TB
            LoginForm["LoginForm.tsx"]:::ui
            click LoginForm "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/components/auth/LoginForm.tsx"
            RegisterForm["RegisterForm.tsx"]:::ui
            click RegisterForm "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/components/auth/RegisterForm.tsx"
        end

        subgraph "Layout Components"
            direction TB
            Navbar["Navbar.tsx"]:::ui
            click Navbar "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/components/layout/Navbar.tsx"
            Breadcrumb["Breadcrumb.tsx"]:::ui
            click Breadcrumb "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/components/layout/Breadcrumb.tsx"
            PageContainer["PageContainer.tsx"]:::ui
            click PageContainer "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/components/layout/PageContainer.tsx"
        end

        subgraph "Page-Level Views"
            direction TB
            HomePage["HomePage.tsx"]:::page
            click HomePage "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/HomePage.tsx"
            DashboardPage["DashboardPage.tsx"]:::page
            click DashboardPage "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/DashboardPage.tsx"
            CreateSession["CreateSession.tsx"]:::page
            click CreateSession "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/CreateSession.tsx"
            EvaluateSession["EvaluateSession.tsx"]:::page
            click EvaluateSession "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/EvaluateSession.tsx"
            ExportReports["ExportReports.tsx"]:::page
            click ExportReports "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/ExportReports.tsx"
            SessionDetails["SessionDetails.tsx"]:::page
            click SessionDetails "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/SessionDetails.tsx"
            SessionResults["SessionResults.tsx"]:::page
            click SessionResults "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/SessionResults.tsx"
            Profile["Profile.tsx"]:::page
            click Profile "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/Profile.tsx"
            LoginPage["LoginPage.tsx"]:::page
            click LoginPage "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/LoginPage.tsx"
            RegisterPage["RegisterPage.tsx"]:::page
            click RegisterPage "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/RegisterPage.tsx"
            NotFound["NotFound.tsx"]:::page
            click NotFound "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/pages/NotFound.tsx"
        end

        subgraph "State Management"
            direction TB
            AuthContext["AuthContext.tsx"]:::state
            click AuthContext "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/context/AuthContext.tsx"
            GDContext["GDContext.tsx"]:::state
            click GDContext "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/context/GDContext.tsx"
        end

        subgraph "Custom Hooks"
            direction TB
            UseMobile["use-mobile.tsx"]:::state
            click UseMobile "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/hooks/use-mobile.tsx"
            UseToast["use-toast.ts"]:::state
            click UseToast "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/hooks/use-toast.ts"
        end

        subgraph "Data & Integrations"
            direction TB
            SupabaseClient["supabase/client.ts"]:::integration
            click SupabaseClient "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/integrations/supabase/client.ts"
            SupabaseTypes["supabase/types.ts"]:::integration
            click SupabaseTypes "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/integrations/supabase/types.ts"
            Utils["utils.ts"]:::integration
            click Utils "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/lib/utils.ts"
        end

        subgraph "Configuration & Styles"
            direction TB
            IndexCSS["index.css"]:::integration
            click IndexCSS "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/src/index.css"
            TailwindConfig["tailwind.config.ts"]:::integration
            click TailwindConfig "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/tailwind.config.ts"
            PostCSS["postcss.config.js"]:::integration
            click PostCSS "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/postcss.config.js"
            ViteConfig["vite.config.ts"]:::integration
            click ViteConfig "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/vite.config.ts"
            TSConfig["tsconfig.json"]:::integration
            click TSConfig "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/tsconfig.json"
            TSConfigApp["tsconfig.app.json"]:::integration
            click TSConfigApp "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/tsconfig.app.json"
            TSConfigNode["tsconfig.node.json"]:::integration
            click TSConfigNode "https://github.com/nikhil-coder390/gdevaluationsystemfrontend/blob/master/tsconfig.node.json"
        end
    end

    subgraph "External Services"
        direction TB
        BackendAPI["Backend API"]:::external
        SupabaseAuth["Supabase Auth"]:::external
        SupabaseDB["Supabase Database (PostgreSQL)"]:::external
        PDFLib["PDF/Excel Export Library"]:::external
        ChartLib["Analytics Chart Library"]:::external
    end

    %% Connections
    Browser --> Entry
    Entry --> App
    App --> UILib
    App --> LoginForm
    App --> RegisterForm
    App --> Navbar
    App --> Breadcrumb
    App --> PageContainer
    App --> HomePage
    App --> DashboardPage
    App --> CreateSession
    App --> EvaluateSession
    App --> ExportReports
    App --> SessionDetails
    App --> SessionResults
    App --> Profile
    App --> LoginPage
    App --> RegisterPage
    App --> NotFound
    App --> AuthContext
    App --> GDContext
    AuthContext --> SupabaseClient
    GDContext --> SupabaseClient
    SupabaseClient --> SupabaseAuth
    SupabaseClient --> SupabaseDB
    AuthContext --> BackendAPI
    HomePage --> SupabaseClient
    DashboardPage --> BackendAPI
    CreateSession --> BackendAPI
    EvaluateSession --> BackendAPI
    ExportReports --> BackendAPI
    SessionDetails --> BackendAPI
    SessionResults --> BackendAPI
    Profile --> BackendAPI
    LoginPage --> BackendAPI
    RegisterPage --> BackendAPI
    Utils --> BackendAPI
    App --> UseMobile
    App --> UseToast
    App --> IndexCSS
    App --> TailwindConfig
    App --> PostCSS
    App --> ViteConfig
    App --> TSConfig
    App --> TSConfigApp
    App --> TSConfigNode
    BackendAPI --> PDFLib
    BackendAPI --> ChartLib

    %% Styles
    classDef ui fill:#cce5ff,stroke:#0366d6,color:#0366d6;
    classDef page fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
    classDef state fill:#d4edda,stroke:#155724,color:#155724;
    classDef integration fill:#fff3cd,stroke:#856404,color:#856404;
    classDef external fill:#f8f9fa,stroke:#343a40,color:#343a40;
    classDef root fill:#e2f0d9,stroke:#2e7d32,color:#2e7d32;
```
