# keerthi-reddy/techmate architecture

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

- Interactive diagram: https://gitdiagram.com/keerthi-reddy/techmate
- Repository: https://github.com/keerthi-reddy/techmate

## Overview

##### Project type and purpose
- From the file tree and README, this is a full-stack web application with a React/TypeScript frontend, a Spring Boot backend (currently scaffolded under /backend), and a separate Python-based LLM microservice under /llm-service.
- The frontend handles user interaction (login, dashboards, role selection), the Spring Boot service will handle business logic and data persistence, and the LLM service provides AI/LLM-powered features.

##### Top-level components (based on folder structure)
- Frontend (frontend/)
– React + TypeScript, built with Vite
– Uses Firebase for authentication (firebase.tsx)
– Pages: Grandkid_View, AuthPage, Dashboard, EZMode, TapTutor, etc.
- Backend (backend/)
– Spring Boot application (to be fleshed out)
– Exposes REST APIs for CRUD and orchestration
- LLM-service (llm-service/)
– Python Flask or FastAPI (app.py)
– Provides AI endpoints for chat, feedback saving, etc.
- Assets & docs
– docs/: design notes, frontend-creation guide

##### High-level interactions
1. User ↔ Frontend
- Browser loads static HTML/CSS/JS from frontend (Vite build)
- User signs in via Firebase Auth SDK; obtains JWT token
2. Frontend ↔ Backend
- Frontend attaches Firebase JWT to HTTP requests
- Backend Spring Boot validates token, processes requests, reads/writes DB
3. Backend ↔ LLM Service
- When AI-powered features are invoked, the Spring Boot service issues HTTP(s) calls to the LLM microservice (JSON over REST)
- LLM service returns generated text, which backend may post-process or store
4. Backend ↔ Database (implicit)

##### Architectural patterns & design principles
- Separation of concerns: UI vs business logic vs AI logic
- Microservices: LLM service is its own deployable unit
- API gateway style: Spring Boot acts as single backend API for the frontend
- Token-based authentication: Firebase JWT validation in backend
- Tech stack boundaries: React/Vite vs Java/Spring vs Python

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["User's Web Browser"]:::external

    subgraph "Frontend Layer"
        FVITE["React-Vite Frontend"]:::frontend
        MAIN["main.tsx"]:::frontend
        APP["App.tsx"]:::frontend
        FIRE["firebase.tsx"]:::frontend
        PROT["ProtectedRoute.tsx"]:::frontend
        LOGIN["Login.tsx"]:::frontend
        AUTHPAGE["AuthPage.tsx"]:::frontend
        DASH["DashBoard.tsx"]:::frontend
        GRAND["Grandkid_View.tsx"]:::frontend
        EZ["EZMode.tsx"]:::frontend
        TAP["TapTutor.tsx"]:::frontend
        ROLE["roleselector.tsx"]:::frontend
        SAVEFB["saveLLMFeedback.ts"]:::frontend
        VITECFG["vite.config.ts"]:::frontend
        INTERF["Ticket.ts"]:::frontend
    end

    subgraph "Backend Layer"
        SB["Spring Boot Backend"]:::backend
    end

    subgraph "LLM Service"
        LAPP["app.py"]:::llm
        REQ["requirements.txt"]:::llm
    end

    DB["Database (PostgreSQL/MySQL)"]:::external
    FIREEXT["Firebase Auth"]:::external
    EXTLLM["External LLM Provider"]:::external
    ASSETS["assets/"]:::docs
    DOCS["docs/frontend-react-creation.txt"]:::docs

    Browser -->|"HTTP(S) GET/POST"| FVITE
    FVITE -->|"Auth SDK: signIn()/verifyIdToken()"| FIREEXT
    FVITE -->|"API requests with JWT"| SB
    SB -->|"JPA/Hibernate queries"| DB
    SB -->|"REST API call /generate"| LAPP
    LAPP -->|"LLM API call"| EXTLLM

    click FVITE "https://github.com/keerthi-reddy/techmate/tree/main/frontend/"
    click MAIN "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/main.tsx"
    click APP "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/App.tsx"
    click FIRE "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/firebase.tsx"
    click PROT "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/components/ProtectedRoute.tsx"
    click LOGIN "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/components/Login.tsx"
    click AUTHPAGE "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/components/AuthPage.tsx"
    click DASH "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/components/DashBoard.tsx"
    click GRAND "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/pages/Grandkid_View.tsx"
    click EZ "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/components/EZMode.tsx"
    click TAP "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/components/TapTutor.tsx"
    click ROLE "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/components/roleselector.tsx"
    click SAVEFB "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/utils/saveLLMFeedback.ts"
    click VITECFG "https://github.com/keerthi-reddy/techmate/blob/main/frontend/vite.config.ts"
    click INTERF "https://github.com/keerthi-reddy/techmate/blob/main/frontend/src/interfaces/Ticket.ts"
    click SB "https://github.com/keerthi-reddy/techmate/tree/main/backend/"
    click LAPP "https://github.com/keerthi-reddy/techmate/blob/main/llm-service/app.py"
    click REQ "https://github.com/keerthi-reddy/techmate/blob/main/llm-service/requirements.txt"
    click ASSETS "https://github.com/keerthi-reddy/techmate/tree/main/assets/"
    click DOCS "https://github.com/keerthi-reddy/techmate/blob/main/docs/frontend-react-creation.txt"

    classDef frontend fill:#ccf,stroke:#333,stroke-width:1px
    classDef backend fill:#cfc,stroke:#333,stroke-width:1px
    classDef llm fill:#fca,stroke:#333,stroke-width:1px
    classDef external fill:#eee,stroke:#333,stroke-width:1px
    classDef docs fill:#ffd,stroke:#333,stroke-width:1px
```
