# abhay-kushwaha/study-planner architecture

> Architecture diagram of the GitHub repository abhay-kushwaha/study-planner, 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/abhay-kushwaha/study-planner
- Repository: https://github.com/abhay-kushwaha/study-planner

## Overview

##### Project type and purpose
- This is a full-stack web application called “Study Planner.”
- The frontend is a React (Vite + Tailwind CSS) single-page app.
- The backend is a Python HTTP API (likely FastAPI or Flask style) with routes for auth, plan generation, and user management.

##### File structure
- Top-level:
- backend/ – Python API
– app/main.py (entry point)
– app/controllers (business logic)
– app/routes (API endpoints: auth, plan, api)
– app/models (data models: user.py)
– app/middleware (e.g., logging)
– app/utils (generate_plan logic)
– requirements.txt, package.json (possibly for nodemon or front-end package bundling), railway.json (deployment on Railway)
- frontend/ – React single-page application
– src/pages (Landing, Login, SignUp, Dashboard, StudyPlanner, etc.)
– src/components (UI: HeroSection, PlanCard, Modal)
– src/services/api.js (wrapper for HTTP calls)
– Vite/Tailwind config, netlify.toml (deploy on Netlify)

##### Insights from README
- Title “Study Planner” – no further architecture comments, so we infer a classic SPA + REST API + database.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["User's Web Browser"]:::external
        subgraph "Frontend Hosting (Netlify)"
            direction TB
            ReactSPA["React SPA (Vite/Tailwind)"]:::frontend
            IndexHTML["index.html"]:::frontend
            MainJSX["main.jsx"]:::frontend
            UIComponents["UI Components"]:::frontend
            SPAPages["Page Views"]:::frontend
            FrontendRoutes["Frontend Routing"]:::frontend
            APIWrapper["API Service Wrapper"]:::frontend
            ViteConfig["vite.config.js"]:::frontend
            TailwindConfig["tailwind.config.js"]:::frontend
            NetlifyConfig["netlify.toml"]:::deployment
        end
    end

    %% Server Layer
    subgraph "Server Layer"
        direction TB
        subgraph "Backend Hosting (Railway)"
            direction TB
            BackendApp["Python API (FastAPI)"]:::backend
            MainPY["main.py"]:::backend
            AuthRoutes["auth.py"]:::backend
            PlanRoutes["plan.py"]:::backend
            OtherAPIRoutes["api.py"]:::backend
            LoggingMiddleware["logging.py"]:::backend
            UserController["user_controller.py"]:::backend
            UserModel["user.py"]:::backend
            GeneratePlanUtil["generate_plan.py"]:::backend
            Requirements["requirements.txt"]:::backend
            RailwayConfig["railway.json"]:::deployment
        end
        PostgreSQLDB["PostgreSQL Database"]:::db
    end

    %% Connections
    Browser -->|"loads SPA"| ReactSPA
    ReactSPA -->|"renders via index.html & main.jsx"| IndexHTML
    ReactSPA --> SPAPages
    ReactSPA --> UIComponents
    ReactSPA --> FrontendRoutes
    FrontendRoutes --> APIWrapper
    APIWrapper -->|"REST API calls"| BackendApp
    BackendApp --> LoggingMiddleware
    LoggingMiddleware --> AuthRoutes
    LoggingMiddleware --> PlanRoutes
    LoggingMiddleware --> OtherAPIRoutes
    AuthRoutes --> UserController
    PlanRoutes --> GeneratePlanUtil
    UserController --> UserModel
    BackendApp --> PostgreSQLDB
    GeneratePlanUtil --> PostgreSQLDB

    %% Click Events
    click ReactSPA "https://github.com/abhay-kushwaha/study-planner/tree/main/frontend/"
    click IndexHTML "https://github.com/abhay-kushwaha/study-planner/blob/main/frontend/index.html"
    click MainJSX "https://github.com/abhay-kushwaha/study-planner/blob/main/frontend/src/main.jsx"
    click UIComponents "https://github.com/abhay-kushwaha/study-planner/tree/main/frontend/src/components/"
    click SPAPages "https://github.com/abhay-kushwaha/study-planner/tree/main/frontend/src/pages/"
    click FrontendRoutes "https://github.com/abhay-kushwaha/study-planner/blob/main/frontend/src/routes/index.jsx"
    click APIWrapper "https://github.com/abhay-kushwaha/study-planner/blob/main/frontend/src/services/api.js"
    click ViteConfig "https://github.com/abhay-kushwaha/study-planner/blob/main/frontend/vite.config.js"
    click TailwindConfig "https://github.com/abhay-kushwaha/study-planner/blob/main/frontend/tailwind.config.js"
    click NetlifyConfig "https://github.com/abhay-kushwaha/study-planner/blob/main/frontend/netlify.toml"

    click MainPY "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/app/main.py"
    click AuthRoutes "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/app/routes/auth.py"
    click PlanRoutes "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/app/routes/plan.py"
    click OtherAPIRoutes "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/app/routes/api.py"
    click UserController "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/app/controllers/user_controller.py"
    click UserModel "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/app/models/user.py"
    click LoggingMiddleware "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/app/middleware/logging.py"
    click GeneratePlanUtil "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/app/utils/generate_plan.py"
    click Requirements "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/requirements.txt"
    click RailwayConfig "https://github.com/abhay-kushwaha/study-planner/blob/main/backend/railway.json"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0288D1,color:#000;
    classDef backend fill:#E8F5E9,stroke:#388E3C,color:#000;
    classDef db fill:#FFF3E0,stroke:#F57C00,color:#000,stroke-width:2px,shape:cylinder;
    classDef external fill:#F3E5F5,stroke:#8E24AA,color:#000;
    classDef deployment stroke-dasharray: 5 5,stroke:#555,fill:none;
```
