# adhithiya42/placement-portal architecture

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

- Interactive diagram: https://gitdiagram.com/adhithiya42/placement-portal
- Repository: https://github.com/adhithiya42/placement-portal

## Overview

#### Purpose and Runtime
This is a server-rendered Flask campus-placement portal. It centralizes company onboarding, recruitment-drive approval, student applications, and application-status decisions across Admin, Company, and Student roles. The executable entry point is `app.py`; it runs on Python 3.10+ with dependencies declared in `requirements.txt` and persists operational state in SQLite at `placement.db`.

#### Application Composition
The backend is concentrated in `app.py`, which is the Flask application, route/controller layer, authentication integration, validation boundary, and database-access layer. HTML is rendered through Jinja templates rather than a separate frontend service. Shared page structure and role-aware navigation originate in `templates/base.html`, with unauthenticated flows in `templates/login.html` and `templates/register.html`.

#### Identity, Sessions, and Authorization
Flask-Login provides session-based authentication and role-based route access. The system has three distinct actor models: a pre-seeded admin, registered companies subject to approval, and students. Login/registration transitions into role-specific dashboards; approval status is an access boundary for companies. Password/profile operations are surfaced separately for company and student users through `templates/company/change_password.html` and `templates/student/change_password.html`.

#### Company and Drive Lifecycle
Companies register and maintain their profile, then create recruitment drives. Admin approval gates company participation and drive visibility. Company users manage their own drives through `templates/company/create_drive.html` and `templates/company/edit_drive.html`; students see approved drives via `templates/student/dashboard.html` and `templates/student/drive_detail.html`. Blacklisting a company closes its drives, making company governance a cross-entity state transition.

#### Student Application Workflow
Students maintain placement information, browse approved drives, submit applications, and track outcomes. The application boundary enforces one application per student-drive pair. Companies consume applications for their drives and update statuses such as shortlisted, selected, or rejected; students view resulting history in `templates/student/history.html`, while company review occurs in `templates/company/applications.html`.

#### Administrative Control Plane
Admin is the global governance and reporting role: it approves/rejects companies and drives, manages students/companies, and exports application data. The primary admin views are `templates/admin/dashboard.html`, `templates/admin/companies.html`, `templates/admin/drives.html`, and `templates/admin/students.html`. The dashboard combines live aggregate data with Chart.js visualizations; management actions affect approval, blacklist, deletion, and downstream drive/application visibility.

#### Data and External Interfaces
SQLite stores the core entities: admin, companies, students, drives, and applications, in `placement.db`. `app.py` also exposes JSON read APIs for approved drives and admin-scoped students, companies, and applications, alongside the server-rendered UI. Browser-side infrastructure is Bootstrap 5 for responsive layout, Chart.js for dashboard charts, and Font Awesome for icons; no separate API server, queue, or cloud service is indicated.

Main entry points: [`templates/admin/dashboard.html`](https://github.com/adhithiya42/placement-portal/blob/main/templates/admin/dashboard.html) (Admin governance), [`app.py`](https://github.com/adhithiya42/placement-portal/blob/main/app.py) (Sessions and role access), [`templates/company/applications.html`](https://github.com/adhithiya42/placement-portal/blob/main/templates/company/applications.html) (Applications), [`templates/company/create_drive.html`](https://github.com/adhithiya42/placement-portal/blob/main/templates/company/create_drive.html) (Company workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Server-rendered UI"]
  node_base_template["Shared layout and navigation<br/>Jinja base template<br/>[base.html]"]
  node_public_auth_pages["Login and registration<br/>Jinja auth pages<br/>[login.html]"]
  node_admin_views["Admin management views<br/>Jinja pages<br/>[companies.html]"]
  node_student_drive_detail["Drive detail page<br/>Jinja page<br/>[drive_detail.html]"]
  node_password_pages["Password management pages<br/>Jinja pages"]
  node_chart_dashboard["Dashboard charts<br/>Chart.js visualization<br/>[dashboard.html]"]
end

subgraph group_actors["Role workflows"]
  node_auth["Sessions and role access<br/>Flask-Login<br/>[app.py]"]
  node_admin["Admin governance<br/>control plane<br/>[dashboard.html]"]
  node_company["Company workflow<br/>employer portal<br/>[create_drive.html]"]
  node_student["Student workflow<br/>candidate portal<br/>[dashboard.html]"]
  node_company_approval["Company approval<br/>participation gate"]
  node_drive_lifecycle["Recruitment drives<br/>drive lifecycle<br/>[edit_drive.html]"]
  node_applications["Applications<br/>student-drive records<br/>[applications.html]"]
  node_application_status["Application decisions<br/>status workflow<br/>[history.html]"]
end

node_app{{"Flask application<br/>[app.py]"}}
node_database[("Placement SQLite<br/>operational database<br/>[placement.db]")]
node_json_api["JSON read APIs<br/>Flask API routes<br/>[app.py]"]

node_app -->|"reads and writes"| node_database
node_app -->|"integrates"| node_auth
node_app -->|"renders"| node_base_template
node_app -->|"exposes"| node_json_api
node_public_auth_pages -->|"login and registration"| node_auth
node_auth -->|"admin session"| node_admin
node_auth -->|"company session"| node_company
node_auth -->|"student session"| node_student
node_admin -->|"approves or rejects"| node_company_approval
node_admin -->|"approves or rejects"| node_drive_lifecycle
node_admin -->|"exports and manages"| node_applications
node_company_approval -->|"gates participation"| node_company
node_company -->|"creates and manages"| node_drive_lifecycle
node_drive_lifecycle -->|"approved drives visible"| node_student
node_student_drive_detail -->|"submits"| node_applications
node_student -->|"creates and tracks"| node_applications
node_company -->|"reviews own drives"| node_applications
node_applications -->|"receives decision"| node_application_status
node_application_status -->|"shown in history"| node_student
node_admin -->|"uses"| node_admin_views
node_chart_dashboard -->|"visualizes aggregates"| node_admin
node_password_pages -->|"updates credentials"| node_auth
node_company_approval -->|"blacklisting closes drives"| node_drive_lifecycle
node_json_api -->|"reads"| node_database

click node_app "https://github.com/adhithiya42/placement-portal/blob/main/app.py"
click node_database "https://github.com/adhithiya42/placement-portal/blob/main/placement.db"
click node_auth "https://github.com/adhithiya42/placement-portal/blob/main/app.py"
click node_admin "https://github.com/adhithiya42/placement-portal/blob/main/templates/admin/dashboard.html"
click node_company "https://github.com/adhithiya42/placement-portal/blob/main/templates/company/create_drive.html"
click node_student "https://github.com/adhithiya42/placement-portal/blob/main/templates/student/dashboard.html"
click node_drive_lifecycle "https://github.com/adhithiya42/placement-portal/blob/main/templates/company/edit_drive.html"
click node_applications "https://github.com/adhithiya42/placement-portal/blob/main/templates/company/applications.html"
click node_application_status "https://github.com/adhithiya42/placement-portal/blob/main/templates/student/history.html"
click node_json_api "https://github.com/adhithiya42/placement-portal/blob/main/app.py"
click node_base_template "https://github.com/adhithiya42/placement-portal/blob/main/templates/base.html"
click node_public_auth_pages "https://github.com/adhithiya42/placement-portal/blob/main/templates/login.html"
click node_admin_views "https://github.com/adhithiya42/placement-portal/blob/main/templates/admin/companies.html"
click node_student_drive_detail "https://github.com/adhithiya42/placement-portal/blob/main/templates/student/drive_detail.html"
click node_password_pages "https://github.com/adhithiya42/placement-portal/blob/main/templates/company/change_password.html"
click node_chart_dashboard "https://github.com/adhithiya42/placement-portal/blob/main/templates/admin/dashboard.html"

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_base_template,node_public_auth_pages,node_admin_views,node_student_drive_detail,node_password_pages,node_chart_dashboard toneBlue
class node_auth,node_admin,node_company,node_student,node_company_approval,node_drive_lifecycle,node_applications,node_application_status toneAmber
class node_app,node_database,node_json_api toneNeutral
```

## Components

### Server-rendered UI

Jinja pages organized by shared and role-specific views.

- [Shared layout and navigation](https://github.com/adhithiya42/placement-portal/blob/main/templates/base.html): Jinja base template · Provides shared structure and role-aware navigation. · `templates/base.html`
- [Login and registration](https://github.com/adhithiya42/placement-portal/blob/main/templates/login.html): Jinja auth pages · `templates/login.html`
- [Admin management views](https://github.com/adhithiya42/placement-portal/blob/main/templates/admin/companies.html): Jinja pages · Dashboard, companies, drives, and student management. · `templates/admin/companies.html`
- [Drive detail page](https://github.com/adhithiya42/placement-portal/blob/main/templates/student/drive_detail.html): Jinja page · Presents approved drive details for applications. · `templates/student/drive_detail.html`
- [Password management pages](https://github.com/adhithiya42/placement-portal/blob/main/templates/company/change_password.html): Jinja pages · Separate company and student password flows. · `templates/company/change_password.html`
- [Dashboard charts](https://github.com/adhithiya42/placement-portal/blob/main/templates/admin/dashboard.html): Chart.js visualization · Visualizes live admin aggregates. · `templates/admin/dashboard.html`

### Role workflows

Role-specific portal capabilities.

- [Sessions and role access](https://github.com/adhithiya42/placement-portal/blob/main/app.py): Flask-Login · Authenticates users and gates role-specific routes. · `app.py`
- [Admin governance](https://github.com/adhithiya42/placement-portal/blob/main/templates/admin/dashboard.html): control plane · Approves entities, manages records, and exports application data. · `templates/admin/dashboard.html`
- [Company workflow](https://github.com/adhithiya42/placement-portal/blob/main/templates/company/create_drive.html): employer portal · Maintains profile, creates drives, and reviews applications. · `templates/company/create_drive.html`
- [Student workflow](https://github.com/adhithiya42/placement-portal/blob/main/templates/student/dashboard.html): candidate portal · Maintains placement data, applies, and tracks outcomes. · `templates/student/dashboard.html`
- **Company approval**: participation gate · Approval status controls company participation.
- [Recruitment drives](https://github.com/adhithiya42/placement-portal/blob/main/templates/company/edit_drive.html): drive lifecycle · Drives require approval before student visibility. · `templates/company/edit_drive.html`
- [Applications](https://github.com/adhithiya42/placement-portal/blob/main/templates/company/applications.html): student-drive records · Enforces one application per student-drive pair. · `templates/company/applications.html`
- [Application decisions](https://github.com/adhithiya42/placement-portal/blob/main/templates/student/history.html): status workflow · Companies mark shortlisted, selected, or rejected outcomes. · `templates/student/history.html`

### Other components

- [Flask application](https://github.com/adhithiya42/placement-portal/blob/main/app.py): routes, auth, validation, data access · Single backend boundary for UI routes and JSON APIs. · `app.py`
- [Placement SQLite](https://github.com/adhithiya42/placement-portal/blob/main/placement.db): operational database · Stores admins, companies, students, drives, and applications. · `placement.db`
- [JSON read APIs](https://github.com/adhithiya42/placement-portal/blob/main/app.py): Flask API routes · Exposes approved drives and admin-scoped records. · `app.py`

## Connections

- Flask application → Placement SQLite: reads and writes
- Flask application → Sessions and role access: integrates
- Flask application → Shared layout and navigation: renders
- Flask application → JSON read APIs: exposes
- Login and registration → Sessions and role access: login and registration
- Sessions and role access → Admin governance: admin session
- Sessions and role access → Company workflow: company session
- Sessions and role access → Student workflow: student session
- Admin governance → Company approval: approves or rejects
- Admin governance → Recruitment drives: approves or rejects
- Admin governance → Applications: exports and manages
- Company approval → Company workflow: gates participation
- Company workflow → Recruitment drives: creates and manages
- Recruitment drives → Student workflow: approved drives visible
- Drive detail page → Applications: submits
- Student workflow → Applications: creates and tracks
- Company workflow → Applications: reviews own drives
- Applications → Application decisions: receives decision
- Application decisions → Student workflow: shown in history
- Admin governance → Admin management views: uses
- Dashboard charts → Admin governance: visualizes aggregates
- Password management pages → Sessions and role access: updates credentials
- Company approval → Recruitment drives: blacklisting closes drives
- JSON read APIs → Placement SQLite: reads
