# sujal0910/ppa_sarvesh architecture

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

- Interactive diagram: https://gitdiagram.com/sujal0910/ppa_sarvesh
- Repository: https://github.com/sujal0910/ppa_sarvesh

## Overview

This repository is a placement-portal application split into two user-facing surfaces backed by one Python service and one shared database.

1. **Overall shape**
   - The repo contains a **backend** directory and a separate **frontend** directory.
   - The backend appears to be a **Python web app with server-rendered templates and JSON routes**.
   - The frontend is a **Vue 3 single-page application** built with **Vite**.

2. **Backend core**
   - `backend/app.py`, `backend/config.py`, `backend/models/`, and `backend/routes/` suggest a conventional Flask-style architecture.
   - The backend owns the domain logic for **authentication, students, companies, admins, drives, and applications**.
   - `backend/instance/placement_portal.db` indicates the primary datastore is **SQLite**.

3. **Backend route boundaries**
   - Route modules are split by responsibility:
     - `routes/auth.py` for login/register flows
     - `routes/student.py` for student-facing actions
     - `routes/company.py` for company-facing actions
     - `routes/admin.py` for admin management
     - `routes/api.py` for API endpoints
   - This separation is important for diagramming the backend as role-based modules rather than a single monolith.

4. **Backend presentation layer**
   - `backend/templates/` contains Jinja-style HTML templates for:
     - authentication pages
     - student dashboard/profile/drives/applications
     - company dashboard/profile/drives/create-drive/view-drive
     - admin dashboard/companies/students/drives/applications
   - This means the backend supports **server-side rendered pages** in addition to API responses.

5. **Frontend application**
   - `frontend/src/` is a Vue application with:
     - `views/` organized by role: `auth`, `student`, `company`, `admin`
     - `components/` for shared UI like `Navbar` and `DriveCard`
     - `router/` for page navigation
     - `store/` for centralized state
     - `services/api.js` as the API client boundary
   - The frontend is structured around the same domain concepts as the backend, which makes the UI a thin consumer of backend data.

6. **Frontend state and data flow**
   - Store modules are split into:
     - `auth.js`
     - `drives.js`
     - `applications.js`
   - That implies the main client-side data flows are:
     - authentication/session state
     - drive listings and details
     - application tracking
   - The frontend likely fetches JSON from the backend via `services/api.js` and hydrates the store from those calls.

7. **Domain model and main business objects**
   - The repeated naming across backend models, templates, and frontend views shows the core entities are:
     - **Student**
     - **Company**
     - **Admin**
     - **Drive** / placement drive
     - **Application**
   - Diagramming should center these entities and their relationships, especially how students apply to drives posted by companies and monitored by admins.

8. **Role-based access model**
   - The app is clearly segmented by persona:
     - students browse drives, manage profile, and track applications
     - companies manage profiles, create drives, and inspect drive details
     - admins oversee students, companies, drives, and applications
   - This role split is a key architectural boundary both in route organization and UI routing.

9. **Data persistence**
   - The application uses a local SQLite database file under `backend/instance/`.
   - No external datastore is visible in the tree, so the primary persistence boundary is internal and file-based.
   - `backend/models/` likely defines the database schema and ORM mappings that back both the HTML views and API responses.

10. **Background work**
   - `backend/tasks.py` indicates there is some non-request-driven processing, likely maintenance, notifications, or scheduled updates.
   - There is no visible queueing infrastructure in the tree, so this appears to be an internal task module rather than a separate worker service.

11. **Deployment/runtime split**
   - The backend and frontend have separate dependency and build surfaces:
     - `backend/requirements.txt` for Python dependencies
     - `frontend/package.json` and `vite.config.js` for the Vue build
   - `frontend/.env.example` and `backend/.env` show environment-based configuration on both sides.
   - Architecturally, this is a two-app setup even if they share the same domain model.

12. **How the pieces fit together**
   - A browser can either:
     - hit backend-rendered pages under the Python app, or
     - load the Vue SPA and call backend JSON endpoints.
   - In both cases, requests eventually converge on the backend’s route layer and the same SQLite-backed model layer.
   - The backend is therefore the system of record, while the Vue app is a separate presentation/client layer.

Main entry points: [`backend/app.py`](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/app.py) (App bootstrap), [`backend/models`](https://github.com/sujal0910/ppa_sarvesh/tree/main/backend/models) (Domain models), [`frontend/src/router/index.js`](https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/router/index.js) (Router), [`backend/templates`](https://github.com/sujal0910/ppa_sarvesh/tree/main/backend/templates) (Server pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Backend"]
  node_backend_app["App bootstrap<br/>Python entrypoint<br/>[app.py]"]
  node_backend_config["Config<br/>[config.py]"]
  node_backend_models[("Domain models<br/>ORM layer")]
  node_backend_routes_auth["Auth routes<br/>HTTP routes<br/>[auth.py]"]
  node_backend_routes_student["Student routes<br/>HTTP routes<br/>[student.py]"]
  node_backend_routes_company["Company routes<br/>HTTP routes<br/>[company.py]"]
  node_backend_routes_admin["Admin routes<br/>HTTP routes<br/>[admin.py]"]
  node_backend_routes_api["API routes<br/>JSON API<br/>[api.py]"]
  node_backend_tasks["Tasks<br/>background work<br/>[tasks.py]"]
  node_backend_templates["Server pages<br/>Jinja templates"]
  node_backend_db[("SQLite DB<br/>file datastore")]
end

subgraph group_frontend["Frontend"]
  node_frontend_app["SPA shell<br/>Vue entrypoint<br/>[App.vue]"]
  node_frontend_router["Router<br/>Vue routing<br/>[index.js]"]
  node_frontend_store["Store<br/>state modules<br/>[index.js]"]
  node_frontend_api["API client<br/>HTTP client<br/>[api.js]"]
  node_frontend_views_auth["Auth views<br/>Vue views"]
  node_frontend_views_student["Student views<br/>Vue views"]
  node_frontend_views_company["Company views<br/>Vue views"]
  node_frontend_views_admin["Admin views<br/>Vue views"]
  node_frontend_components["Shared UI<br/>Vue components"]
end

node_backend_app -->|"loads"| node_backend_config
node_backend_app -->|"registers"| node_backend_routes_auth
node_backend_app -->|"registers"| node_backend_routes_student
node_backend_app -->|"registers"| node_backend_routes_company
node_backend_app -->|"registers"| node_backend_routes_admin
node_backend_app -->|"registers"| node_backend_routes_api
node_backend_app -->|"renders"| node_backend_templates
node_backend_routes_auth -->|"uses"| node_backend_models
node_backend_routes_student -->|"uses"| node_backend_models
node_backend_routes_company -->|"uses"| node_backend_models
node_backend_routes_admin -->|"uses"| node_backend_models
node_backend_routes_api -->|"uses"| node_backend_models
node_backend_models -->|"persists to"| node_backend_db
node_backend_tasks -->|"uses"| node_backend_models
node_frontend_app -->|"navigates via"| node_frontend_router
node_frontend_app -->|"reads state"| node_frontend_store
node_frontend_app -->|"composes"| node_frontend_components
node_frontend_router -->|"routes to"| node_frontend_views_auth
node_frontend_router -->|"routes to"| node_frontend_views_student
node_frontend_router -->|"routes to"| node_frontend_views_company
node_frontend_router -->|"routes to"| node_frontend_views_admin
node_frontend_store -->|"fetches from"| node_frontend_api
node_frontend_api -->|"calls"| node_backend_routes_api
node_backend_routes_auth -->|"serves"| node_backend_templates
node_backend_routes_student -->|"serves"| node_backend_templates
node_backend_routes_company -->|"serves"| node_backend_templates
node_backend_routes_admin -->|"serves"| node_backend_templates

click node_backend_app "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/app.py"
click node_backend_config "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/config.py"
click node_backend_models "https://github.com/sujal0910/ppa_sarvesh/tree/main/backend/models"
click node_backend_routes_auth "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/auth.py"
click node_backend_routes_student "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/student.py"
click node_backend_routes_company "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/company.py"
click node_backend_routes_admin "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/admin.py"
click node_backend_routes_api "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/api.py"
click node_backend_tasks "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/tasks.py"
click node_backend_templates "https://github.com/sujal0910/ppa_sarvesh/tree/main/backend/templates"
click node_backend_db "https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/instance/placement_portal.db"
click node_frontend_app "https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/App.vue"
click node_frontend_router "https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/router/index.js"
click node_frontend_store "https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/store/index.js"
click node_frontend_api "https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/services/api.js"
click node_frontend_views_auth "https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/views/auth"
click node_frontend_views_student "https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/views/student"
click node_frontend_views_company "https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/views/company"
click node_frontend_views_admin "https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/views/admin"
click node_frontend_components "https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/components"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_backend_app,node_backend_config,node_backend_models,node_backend_routes_auth,node_backend_routes_student,node_backend_routes_company,node_backend_routes_admin,node_backend_routes_api,node_backend_tasks,node_backend_templates,node_backend_db toneBlue
class node_frontend_app,node_frontend_router,node_frontend_store,node_frontend_api,node_frontend_views_auth,node_frontend_views_student,node_frontend_views_company,node_frontend_views_admin,node_frontend_components toneAmber
```

## Components

### Backend

Python web app, route layer, templates, and SQLite-backed domain model.

- [App bootstrap](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/app.py): Python entrypoint · Initializes the backend web application and wires configuration and routes. · `backend/app.py`
- [Config](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/config.py): Python config · Runtime settings and environment-driven configuration for the backend. · `backend/config.py`
- [Domain models](https://github.com/sujal0910/ppa_sarvesh/tree/main/backend/models): ORM layer · Shared persistence and schema for portal entities. · `backend/models`
- [Auth routes](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/auth.py): HTTP routes · Login and registration flows for students and companies. · `backend/routes/auth.py`
- [Student routes](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/student.py): HTTP routes · Student dashboard, profile, drives, and applications actions. · `backend/routes/student.py`
- [Company routes](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/company.py): HTTP routes · Company dashboard, profile, and drive management actions. · `backend/routes/company.py`
- [Admin routes](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/admin.py): HTTP routes · Administrative oversight for students, companies, drives, and applications. · `backend/routes/admin.py`
- [API routes](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/routes/api.py): JSON API · Backend endpoints consumed by the SPA client. · `backend/routes/api.py`
- [Tasks](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/tasks.py): background work · Internal non-request processing and maintenance logic. · `backend/tasks.py`
- [Server pages](https://github.com/sujal0910/ppa_sarvesh/tree/main/backend/templates): Jinja templates · Rendered HTML views for auth, student, company, and admin screens. · `backend/templates`
- [SQLite DB](https://github.com/sujal0910/ppa_sarvesh/blob/main/backend/instance/placement_portal.db): file datastore · Primary persistent store for the placement portal. · `backend/instance/placement_portal.db`

### Frontend

Vue 3 SPA, routing, state, and API client.

- [SPA shell](https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/App.vue): Vue entrypoint · Client application bootstrap and root UI. · `frontend/src/App.vue`
- [Router](https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/router/index.js): Vue routing · Client-side navigation across role-based views. · `frontend/src/router/index.js`
- [Store](https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/store/index.js): state modules · Centralized client state for auth, drives, and applications. · `frontend/src/store/index.js`
- [API client](https://github.com/sujal0910/ppa_sarvesh/blob/main/frontend/src/services/api.js): HTTP client · Boundary used by the SPA to call backend JSON endpoints. · `frontend/src/services/api.js`
- [Auth views](https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/views/auth): Vue views · Login and registration screens for the SPA. · `frontend/src/views/auth`
- [Student views](https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/views/student): Vue views · Student dashboard, profile, drives, and applications screens. · `frontend/src/views/student`
- [Company views](https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/views/company): Vue views · Company dashboard, profile, and drive management screens. · `frontend/src/views/company`
- [Admin views](https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/views/admin): Vue views · Administrative screens for monitoring portal entities. · `frontend/src/views/admin`
- [Shared UI](https://github.com/sujal0910/ppa_sarvesh/tree/main/frontend/src/components): Vue components · Reusable interface elements such as navigation and drive cards. · `frontend/src/components`

## Connections

- App bootstrap → Config: loads · Application startup uses configuration.
- App bootstrap → Auth routes: registers · Bootstraps authentication routes.
- App bootstrap → Student routes: registers · Bootstraps student routes.
- App bootstrap → Company routes: registers · Bootstraps company routes.
- App bootstrap → Admin routes: registers · Bootstraps admin routes.
- App bootstrap → API routes: registers · Bootstraps API routes.
- App bootstrap → Server pages: renders · Serves server-rendered pages.
- Auth routes → Domain models: uses · Reads and writes user records.
- Student routes → Domain models: uses · Queries drives, profile, and applications.
- Company routes → Domain models: uses · Manages company records and drive postings.
- Admin routes → Domain models: uses · Oversees portal entities.
- API routes → Domain models: uses · Exposes model-backed JSON data.
- Domain models → SQLite DB: persists to · Stores portal state in SQLite.
- Tasks → Domain models: uses · Background processing depends on the domain model.
- SPA shell → Router: navigates via · Root SPA delegates screen selection to the router.
- SPA shell → Store: reads state · UI consumes centralized application state.
- SPA shell → Shared UI: composes · Root UI reuses shared interface components.
- Router → Auth views: routes to · Navigation to authentication screens.
- Router → Student views: routes to · Navigation to student screens.
- Router → Company views: routes to · Navigation to company screens.
- Router → Admin views: routes to · Navigation to admin screens.
- Store → API client: fetches from · State modules retrieve backend data through the API client.
- API client → API routes: calls · SPA consumes backend JSON endpoints.
- Auth routes → Server pages: serves · Auth pages are available as server-rendered views.
- Student routes → Server pages: serves · Student pages are available as server-rendered views.
- Company routes → Server pages: serves · Company pages are available as server-rendered views.
- Admin routes → Server pages: serves · Admin pages are available as server-rendered views.
