# jeevanba273/vehicle-parking-system architecture

> Architecture diagram of the GitHub repository jeevanba273/vehicle-parking-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeevanba273/vehicle-parking-system
- Repository: https://github.com/jeevanba273/vehicle-parking-system

## Overview

##### Project Type and Purpose
- This is a full-stack Vehicle Parking System.
- Frontend: Vue.js 3 SPA with TypeScript, Pinia, Vue Router, Bootstrap, Chart.js.
- Backend: Flask REST API with SQLAlchemy, SQLite, Flask-Security (auth), optional Redis cache, Celery tasks.
- Purpose: Allow users to sign up/login, book/release parking spots, view history; allow admins to manage lots, users, and view analytics in real time.

##### File Structure
- Top level:
- `/frontend`: source of the Vue.js SPA
- `/backend`: Flask API server
- Deployment guides and configs (Netlify, Railway, Dockerfile, Procfile)
- Frontend details:
- `src/components`, `views`, `router`, `stores` indicate an SPA with component-based UI, state management via Pinia, and client-side routing
- `config/api.ts` defines the base API URL
- Backend details:
- Single entry `app.py` exposing `/api/*` routes (auth, parking-lots, bookings, analytics)
- SQLAlchemy models and Flask-Security for RBAC
- Celery integration for background jobs (e.g., scheduled occupancy metrics)
- Deployment artifacts:
- `frontend/netlify.toml`, `_redirects` for SPA routing on Netlify
- `backend/railway.json`, `Procfile`, `Dockerfile` for containerized/Railway deploy

##### README for Additional Insights
- API endpoints: clear REST routes for auth, parking lots, spots, bookings, analytics
- Tech stack reinforces components: Vue UI, Flask API, SQLite DB, Redis, Celery
- Real-time updates likely via polling or WebSocket/local refresh (not explicitly in code, but implied by “Real-time Updates”)

##### Detail
- User roles (Admin vs. User) and their UI entry points (AdminDashboard.vue vs. UserDashboard.vue)
- Real-time/update mechanism (polling or WebSocket if present)
- Deployment specifics: how CI/CD pushes changes to Netlify and Railway

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    Browser["User's Browser"]:::external

    subgraph "Presentation Layer"
        VueSPA["Vue.js SPA"]:::frontend
    end

    Browser -->|"renders"| VueSPA

    %% Client-side Logic
    subgraph "Client-side Logic"
        Router["Vue Router"]:::frontend
        AuthStore["Auth Store"]:::frontend
        ParkingStore["Parking Store"]:::frontend
        APIConfig["API Config (VITE_API_URL)"]:::frontend
        ChartJS["Chart.js Library"]:::frontend
        Bootstrap["Bootstrap Styling"]:::frontend
    end

    VueSPA --> Router
    VueSPA --> AuthStore
    VueSPA --> ParkingStore
    VueSPA --> APIConfig
    VueSPA --> ChartJS
    VueSPA --> Bootstrap

    %% UI Layer Components
    subgraph "UI Layer"
        subgraph "Components"
            PG["ParkingGrid Component"]:::frontend
            HW["HelloWorld Component"]:::frontend
        end
        subgraph "Views / Pages"
            subgraph "Authentication Views"
                Login["Login Page"]:::frontend
                Signup["Signup Page"]:::frontend
            end
            subgraph "User Views"
                BookSpot["Book Spot"]:::frontend
                BookingHistory["Booking History"]:::frontend
                ProfilePage["Profile Page"]:::frontend
                SettingsPage["Settings Page"]:::frontend
                UserDashboard["User Dashboard"]:::frontend
            end
            subgraph "Admin Views"
                AdminDashboard["Admin Dashboard"]:::frontend
                ParkingLots["Parking Lots Management"]:::frontend
                RegisteredUsers["Registered Users"]:::frontend
                Analytics["Analytics Dashboard"]:::frontend
                AdminProfile["Admin Profile"]:::frontend
                AdminSettings["Admin Settings"]:::frontend
            end
        end
        GlobalCSS["Global CSS"]:::frontend
        Assets["Assets Folder"]:::frontend
    end

    VueSPA --> PG
    VueSPA --> HW
    VueSPA --> Login
    VueSPA --> Signup
    VueSPA --> BookSpot
    VueSPA --> BookingHistory
    VueSPA --> ProfilePage
    VueSPA --> SettingsPage
    VueSPA --> UserDashboard
    VueSPA --> AdminDashboard
    VueSPA --> ParkingLots
    VueSPA --> RegisteredUsers
    VueSPA --> Analytics
    VueSPA --> AdminProfile
    VueSPA --> AdminSettings
    VueSPA --> GlobalCSS
    VueSPA --> Assets

    %% API Layer
    subgraph "API Layer"
        API["Flask REST API (app.py)"]:::backend
        AuthMod["Authentication Module (Flask-Security)"]:::backend
        Controllers["Business Logic & Controllers"]:::backend
    end

    VueSPA -->|"HTTP /api/*"| API
    API --> AuthMod
    API --> Controllers

    %% Data Layer
    subgraph "Data Layer"
        DB["SQLite Database"]:::database
        Cache["Redis Cache"]:::cache
    end

    API -->|"CRUD via SQLAlchemy"| DB
    API -->|"cache read/write"| Cache

    %% Integration Layer
    subgraph "Integration Layer"
        Broker["Redis (Broker)"]:::cache
        Celery["Celery Worker"]:::tasks
    end

    API -->|"enqueue tasks"| Broker
    Broker -->|"consume tasks"| Celery
    Celery --> DB
    Celery --> Cache

    %% Deployment
    subgraph "Deployment"
        CI["GitHub CI/CD"]:::external
        Netlify["Netlify (Frontend Host)"]:::external
        Railway["Railway (Backend Host)"]:::external
    end

    CI -->|"deploy frontend"| Netlify
    CI -->|"deploy backend"| Railway

    %% Click Events
    click VueSPA "https://github.com/jeevanba273/vehicle-parking-system/tree/main/frontend/src"
    click Router "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/router/index.ts"
    click AuthStore "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/stores/auth.ts"
    click ParkingStore "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/stores/parking.ts"
    click APIConfig "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/config/api.ts"
    click PG "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/components/ParkingGrid.vue"
    click HW "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/components/HelloWorld.vue"
    click BookSpot "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/user/BookSpot.vue"
    click BookingHistory "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/user/BookingHistory.vue"
    click ProfilePage "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/user/ProfilePage.vue"
    click SettingsPage "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/user/SettingsPage.vue"
    click UserDashboard "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/UserDashboard.vue"
    click AdminDashboard "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/AdminDashboard.vue"
    click ParkingLots "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/admin/ParkingLots.vue"
    click RegisteredUsers "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/admin/RegisteredUsers.vue"
    click Analytics "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/admin/Analytics.vue"
    click AdminProfile "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/admin/AdminProfile.vue"
    click AdminSettings "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/admin/AdminSettings.vue"
    click Login "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/LoginPage.vue"
    click Signup "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/views/SignupPage.vue"
    click GlobalCSS "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/src/style.css"
    click Assets "https://github.com/jeevanba273/vehicle-parking-system/tree/main/frontend/src/assets"
    click Netlify "https://github.com/jeevanba273/vehicle-parking-system/blob/main/.frontend/netlify.toml"
    click Netlify "https://github.com/jeevanba273/vehicle-parking-system/tree/main/frontend/_redirects"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/.env.example"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/blob/main/frontend/vite.config.ts"
    click API "https://github.com/jeevanba273/vehicle-parking-system/blob/main/backend/app.py"
    click AuthMod "https://github.com/jeevanba273/vehicle-parking-system/blob/main/backend/templates/index.html"
    click Controllers "https://github.com/jeevanba273/vehicle-parking-system/blob/main/backend/requirements.txt"
    click Controllers "https://github.com/jeevanba273/vehicle-parking-system/blob/main/backend/runtime.txt"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/blob/main/backend/.env.example"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/tree/main/backend/Dockerfile"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/blob/main/backend/railway.json"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/tree/main/backend/Procfile"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/blob/main/backend/nixpacks.toml"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/blob/main/DEPLOYMENT_GUIDE.md"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/blob/main/DEPLOYMENT_SETUP.md"
    click CI "https://github.com/jeevanba273/vehicle-parking-system/blob/main/README.md"

    %% Styles
    classDef frontend fill:#FFD6E8,stroke:#C2185B,stroke-width:2px
    classDef backend fill:#D1E8FF,stroke:#1565C0,stroke-width:2px
    classDef database fill:#E8FFD1,stroke:#558B2F,stroke-width:2px
    classDef cache fill:#FFF3D1,stroke:#F57F17,stroke-width:2px
    classDef tasks fill:#F8D7DA,stroke:#C62828,stroke-width:2px
    classDef external fill:#ECEFF1,stroke:#607D8B,stroke-width:2px
```
