# dikshap-2506/mapmyroute architecture

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

- Interactive diagram: https://gitdiagram.com/dikshap-2506/mapmyroute
- Repository: https://github.com/dikshap-2506/mapmyroute

## Overview

##### Project Type and Purpose
- MapMyRoute is a full-stack, AI-powered learning roadmap platform.
- It consists of a React/Vite frontend, a Python/FastAPI backend, a PostgreSQL database, Firebase authentication, and several external APIs (Landbot chatbot, Adzuna job feed, GROQ AI).

##### File Structure
- Top-level separation:
- backend/ – contains FastAPI app (main.py), DB schema, requirements.txt
- frontend/ – React app (Vite) with pages, widgets, utils, config files
- Key patterns:
- Frontend pages under src/pages (Landing, Dashboard, etc.)
- Widget components (ChatbotWidget, LandbotWidgetLoader)
- Auth helper in src/utils/auth.js
- Firebase config in src/firebase.js
- Config & deployment:
- frontend/vercel.json, vite.config.js
- backend expects .env for DATABASE_URL, API keys

##### Extract Architecture Insights from README
- Frontend stack: React, Vite, Bootstrap
- Backend stack: FastAPI, Python, PostgreSQL
- Auth: Firebase + JWT
- External integrations: Landbot, Adzuna API, GROQ AI

##### Main Components
a. User (Web Browser / Client)
b. Frontend (React App hosted on Vercel)
– UI pages, Chatbot widget loader, API calls to backend
c. Authentication Layer (Firebase Auth + JWT)
d. Backend API (FastAPI service on Render or similar)
– Roadmap generation logic, progress tracking, challenge engine
e. Data Store (PostgreSQL DB)
f. External Services / APIs:
- Landbot (AI Chatbot)
- Adzuna (Job feed)
- GROQ (LLM execution)
g. Deployment & Hosting (Vercel for frontend, cloud/VPS for backend, managed PostgreSQL)

##### Relationships & Data Flows
- User → HTTP(S) → Frontend
- Frontend ↔ REST API (FastAPI)
- Frontend ↔ Firebase Auth (for sign-in/up, token exchange)
- Backend ↔ PostgreSQL (CRUD on users, roadmaps, progress)
- Backend → Adzuna API (fetch job data)
- Backend → GROQ API (invoke AI for roadmap/adaptations)
- Frontend → Landbot widget (embedded script → real-time chatbot)

##### Architectural Patterns & Principles
- Clear separation of concerns (frontend vs. backend)
- Client-server, stateless RESTful APIs
- Third-party integration layer
- Componentized UI (React pages & widgets)
- Environment-based config (.env, VITE_API_URL)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client"
        User["User / Web Browser"]:::client
    end

    subgraph "Deployment"
        Vercel["Vercel (Frontend Hosting)"]:::external
        Render["Render / Cloud VPS (Backend)"]:::external
        PostgresHost["Managed PostgreSQL"]:::external
    end

    subgraph "Frontend Layer"
        Frontend["React / Vite Frontend"]:::frontend
        MainEntry["main.jsx"]:::frontend
        AppComp["App.jsx"]:::frontend
        HTML["index.html"]:::frontend
        subgraph "Pages"
            Landing["LandingPage.jsx"]:::frontend
            Dashboard["Dashboard.jsx"]:::frontend
            CareerInsights["CareerInsights.jsx"]:::frontend
            Roadmap["RoadmapViewer.jsx"]:::frontend
            ChallengePage["MicroSkillChallenge.jsx"]:::frontend
            Settings["Settings.jsx"]:::frontend
            Login["LoginPage.jsx"]:::frontend
            Signup["SignupPage.jsx"]:::frontend
        end
        subgraph "Widgets"
            Chatbot["ChatbotWidget.jsx"]:::frontend
            LandbotLoader["LandbotWidgetLoader.jsx"]:::frontend
        end
        Firebase["firebase.js"]:::auth
        AuthUtils["auth.js"]:::auth
        Public["public/"]:::frontend
        ViteConfig["vite.config.js"]:::frontend
        ESLint["eslint.config.js"]:::frontend
        VercelConfig["vercel.json"]:::frontend
    end

    subgraph "Authentication"
        FirebaseAuth["Firebase Authentication"]:::auth
        JWT["JWT Service"]:::auth
    end

    subgraph "Backend Layer"
        BackendMain["main.py"]:::backend
        Req["requirements.txt"]:::backend
        BackendLogic["FastAPI Service"]:::backend
        BackendDocs["README.md"]:::backend
    end

    subgraph "Data Layer"
        PostgreSQL["PostgreSQL Database"]:::database
        Schema["db_schema.sql"]:::database
    end

    subgraph "External Services"
        LandbotAPI["Landbot Chatbot"]:::external
        Adzuna["Adzuna Job Feed"]:::external
        GROQ["GROQ AI API"]:::external
    end

    User -->|"HTTPS"| Frontend
    Frontend -->|"REST API"| BackendLogic
    Frontend -->|"Auth Requests"| FirebaseAuth
    FirebaseAuth -->|"JWT Tokens"| Frontend
    Frontend -->|"Embed Widget"| LandbotLoader
    BackendLogic -->|"CRUD Operations"| PostgreSQL
    BackendLogic -->|"Uses Schema"| Schema
    BackendLogic -->|"Fetch Job Data"| Adzuna
    BackendLogic -->|"Invoke AI"| GROQ
    Frontend --> Vercel
    BackendLogic --> Render
    PostgreSQL --> PostgresHost

    click Frontend "https://github.com/dikshap-2506/mapmyroute/tree/main/frontend/"
    click MainEntry "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/main.jsx"
    click AppComp "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/App.jsx"
    click HTML "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/index.html"
    click Landing "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/pages/LandingPage.jsx"
    click Dashboard "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/pages/Dashboard.jsx"
    click CareerInsights "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/pages/CareerInsights.jsx"
    click Roadmap "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/pages/RoadmapViewer.jsx"
    click ChallengePage "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/pages/MicroSkillChallenge.jsx"
    click Settings "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/pages/Settings.jsx"
    click Login "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/pages/LoginPage.jsx"
    click Signup "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/pages/SignupPage.jsx"
    click Chatbot "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/ChatbotWidget.jsx"
    click LandbotLoader "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/LandbotWidgetLoader.jsx"
    click Firebase "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/firebase.js"
    click AuthUtils "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/src/utils/auth.js"
    click Public "https://github.com/dikshap-2506/mapmyroute/tree/main/frontend/public/"
    click ViteConfig "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/vite.config.js"
    click ESLint "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/eslint.config.js"
    click VercelConfig "https://github.com/dikshap-2506/mapmyroute/blob/main/frontend/vercel.json"
    click BackendMain "https://github.com/dikshap-2506/mapmyroute/blob/main/backend/main.py"
    click Req "https://github.com/dikshap-2506/mapmyroute/blob/main/backend/requirements.txt"
    click DBSchema "https://github.com/dikshap-2506/mapmyroute/blob/main/backend/db_schema.sql"
    click BackendDocs "https://github.com/dikshap-2506/mapmyroute/blob/main/backend/README.md"
    click RootReadme "https://github.com/dikshap-2506/mapmyroute/blob/main/README.md"

    classDef client fill:#D0E6FF,stroke:#000
    classDef frontend fill:#D2F8D2,stroke:#000
    classDef backend fill:#FFE6A7,stroke:#000
    classDef database fill:#FFF4B2,stroke:#000
    classDef external fill:#E3D2FF,stroke:#000
    classDef auth fill:#F0E0E6,stroke:#000
```
