# ayush-k-das/hiremind-job_searching_and_hiring_platform architecture

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

- Interactive diagram: https://gitdiagram.com/ayush-k-das/hiremind-job_searching_and_hiring_platform
- Repository: https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform

## Overview

1. **Project shape**
   - This is a small monolithic Flask application for a role-based hiring marketplace.
   - The repo is organized into a single Python backend, a MySQL schema dump, and server-rendered HTML templates with static CSS/JS assets.

2. **Runtime entrypoint**
   - `app.py` is the main application entrypoint and likely defines the Flask app, route handlers, session logic, and request/response flow.
   - The app runs on Flask’s development server, matching the README’s local setup.

3. **Persistence boundary**
   - `DB_handler.py` appears to encapsulate all database access.
   - The backend uses PyMySQL against MySQL/MariaDB, so the architecture is not ORM-driven; it is direct SQL over a relational schema.

4. **Configuration boundary**
   - `config.py` holds database connection settings such as host, username, password, and database name.
   - This keeps environment-specific values separate from application logic, though the project is still configured manually rather than via environment variables.

5. **Data model and relational core**
   - `mamaar.sql` is the authoritative schema definition and seed structure.
   - The core tables are `client`, `worker`, `job`, `requested`, and `accepted`, which form the main workflow graph:
     - users are split by role,
     - workers create job listings,
     - clients request jobs,
     - requests can be accepted/rejected,
     - accepted jobs move into a confirmed state.
   - Cascading deletes are part of the integrity model, so relationships are central to the app’s behavior.

6. **Role-based business flows**
   - The application has three distinct user surfaces:
     - **Client**: search workers, submit hire requests, review requested/confirmed jobs.
     - **Worker**: post jobs, manage incoming requests, accept/reject, close jobs, receive ratings.
     - **Admin**: system-wide overview and administrative access.
   - These are not separate services; they are separate Flask route groups and templates within one application.

7. **Authentication and session state**
   - Login is session-based rather than token-based.
   - Access control is role-driven, so the same backend likely checks session role before rendering templates or permitting actions.
   - The README notes plain-text passwords, which means auth is simple and tightly coupled to database records.

8. **Presentation layer**
   - `templates/` contains the server-rendered pages:
     - `index.html`, `login.html`, `newaccount.html`, `newuser.html`
     - `client.html`, `worker.html`, `admin.html`, `dashboard.html`
   - This suggests a classic Flask/Jinja architecture where most pages are rendered on the server and populated from backend query results.

9. **Front-end behavior**
   - `static/style.css` provides styling and `static/script.js` supports client-side interaction.
   - The README mentions AJAX-based dynamic loading, so JavaScript is used to refresh parts of the UI without full page reloads, likely for search, request status, and workflow updates.

10. **Key interaction boundaries**
   - The main architectural boundary is between:
     - browser UI → Flask routes,
     - Flask routes → database helper,
     - database helper → MySQL schema.
   - Most business logic appears to live in the backend rather than in the browser, with the frontend mainly responsible for display and lightweight interactions.

11. **Deployment context**
   - This is a local/dev-oriented stack: Flask server, MySQL/MariaDB database, and static files served by Flask.
   - No separate API service, queue, worker process, or external cloud dependency is indicated in the repo.

12. **What to show in an architecture diagram**
   - A good diagram would center on one Flask application connected to a MySQL database, with three UI branches for client, worker, and admin.
   - Include `DB_handler.py` as the database access layer, `config.py` as configuration input, `templates/` as server-side views, and `static/` as the browser-side asset layer.

Main entry points: [`mamaar.sql`](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql) (mamaar.sql), [`app.py`](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py) (app.py), [`templates`](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/tree/main/templates) (templates), [`DB_handler.py`](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/DB_handler.py) (DB_handler.py)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_app["Flask app"]
  node_n_app["app.py<br/>Flask entrypoint<br/>[app.py]"]
  node_n_auth(("Login flow<br/>session auth<br/>[app.py]"))
  node_n_client_routes["Client flow<br/>role routes<br/>[app.py]"]
  node_n_worker_routes["Worker flow<br/>role routes<br/>[app.py]"]
  node_n_admin_routes["Admin flow<br/>role routes<br/>[app.py]"]
end

subgraph group_g_data["Data layer"]
  node_n_dbh["DB_handler.py<br/>SQL access<br/>[DB_handler.py]"]
  node_n_config["config.py<br/>db config<br/>[config.py]"]
  node_n_schema[("mamaar.sql<br/>schema dump<br/>[mamaar.sql]")]
  node_n_client_tbl[("client<br/>table<br/>[mamaar.sql]")]
  node_n_worker_tbl[("worker<br/>table<br/>[mamaar.sql]")]
  node_n_job_tbl[("job<br/>table<br/>[mamaar.sql]")]
  node_n_requested_tbl[("requested<br/>table<br/>[mamaar.sql]")]
  node_n_accepted_tbl[("accepted<br/>table<br/>[mamaar.sql]")]
end

subgraph group_g_ui["Presentation"]
  node_n_templates["templates<br/>Jinja views"]
  node_n_static["static assets<br/>css/js assets"]
  node_n_dashboard["Dashboard<br/>landing view<br/>[dashboard.html]"]
end

node_n_app -->|"checks session"| node_n_auth
node_n_app -->|"serves"| node_n_client_routes
node_n_app -->|"serves"| node_n_worker_routes
node_n_app -->|"serves"| node_n_admin_routes
node_n_app -->|"queries"| node_n_dbh
node_n_dbh -->|"reads"| node_n_config
node_n_dbh -->|"targets"| node_n_schema
node_n_schema -->|"defines"| node_n_client_tbl
node_n_schema -->|"defines"| node_n_worker_tbl
node_n_schema -->|"defines"| node_n_job_tbl
node_n_schema -->|"defines"| node_n_requested_tbl
node_n_schema -->|"defines"| node_n_accepted_tbl
node_n_client_routes -->|"renders"| node_n_templates
node_n_worker_routes -->|"renders"| node_n_templates
node_n_admin_routes -->|"renders"| node_n_templates
node_n_templates -->|"uses"| node_n_static
node_n_templates -->|"includes"| node_n_dashboard
node_n_client_routes -->|"creates"| node_n_requested_tbl
node_n_worker_routes -->|"publishes"| node_n_job_tbl
node_n_worker_routes -->|"confirms"| node_n_accepted_tbl
node_n_worker_routes -->|"reviews"| node_n_requested_tbl
node_n_client_routes -->|"views"| node_n_accepted_tbl

click node_n_app "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py"
click node_n_auth "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py"
click node_n_client_routes "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py"
click node_n_worker_routes "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py"
click node_n_admin_routes "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py"
click node_n_dbh "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/DB_handler.py"
click node_n_config "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/config.py"
click node_n_schema "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql"
click node_n_client_tbl "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql"
click node_n_worker_tbl "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql"
click node_n_job_tbl "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql"
click node_n_requested_tbl "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql"
click node_n_accepted_tbl "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql"
click node_n_templates "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/tree/main/templates"
click node_n_static "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/tree/main/static"
click node_n_dashboard "https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/templates/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_n_app,node_n_auth,node_n_client_routes,node_n_worker_routes,node_n_admin_routes toneBlue
class node_n_dbh,node_n_config,node_n_schema,node_n_client_tbl,node_n_worker_tbl,node_n_job_tbl,node_n_requested_tbl,node_n_accepted_tbl toneAmber
class node_n_templates,node_n_static,node_n_dashboard toneMint
```

## Components

### Flask app

Request handling, session logic, and role-based route flow.

- [app.py](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py): Flask entrypoint · Main Flask application, routes, sessions, and request flow. · `app.py`
- [Login flow](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py): session auth · Session-based authentication and role checks inside the app. · `app.py`
- [Client flow](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py): role routes · Client-facing search, request, and status views. · `app.py`
- [Worker flow](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py): role routes · Worker-facing posting, request handling, and job closure views. · `app.py`
- [Admin flow](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/app.py): role routes · Administrative overview and privileged access paths. · `app.py`

### Data layer

Database access and relational persistence.

- [DB_handler.py](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/DB_handler.py): SQL access · Encapsulates direct database operations using PyMySQL. · `DB_handler.py`
- [config.py](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/config.py): db config · Database connection settings for host, user, password, and schema. · `config.py`
- [mamaar.sql](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql): schema dump · Authoritative MySQL schema and seed structure. · `mamaar.sql`
- [client](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql): table · Client accounts and role-specific records. · `mamaar.sql`
- [worker](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql): table · Worker accounts and posted job records. · `mamaar.sql`
- [job](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql): table · Job listings and job lifecycle state. · `mamaar.sql`
- [requested](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql): table · Pending job requests from clients. · `mamaar.sql`
- [accepted](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/mamaar.sql): table · Confirmed jobs after acceptance. · `mamaar.sql`

### Presentation

Server-rendered templates and browser assets.

- [templates](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/tree/main/templates): Jinja views · Server-rendered HTML pages for the main user surfaces. · `templates`
- [static assets](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/tree/main/static): css/js assets · Browser-side styling and lightweight dynamic behavior. · `static`
- [Dashboard](https://github.com/ayush-k-das/hiremind-job_searching_and_hiring_platform/blob/main/templates/dashboard.html): landing view · Shared landing and navigation surface. · `templates/dashboard.html`

## Connections

- app.py → Login flow: checks session · Flask routes authenticate users and enforce role-based access.
- app.py → Client flow: serves · Handles client-facing workflow pages and actions.
- app.py → Worker flow: serves · Handles worker-facing workflow pages and actions.
- app.py → Admin flow: serves · Handles administrative views and controls.
- app.py → DB_handler.py: queries · Routes delegate persistence work to the database helper.
- DB_handler.py → config.py: reads · Database connection settings are loaded from config.
- DB_handler.py → mamaar.sql: targets · SQL operations run against the MySQL schema.
- mamaar.sql → client: defines · Schema includes client records.
- mamaar.sql → worker: defines · Schema includes worker records.
- mamaar.sql → job: defines · Schema includes job listings.
- mamaar.sql → requested: defines · Schema includes pending requests.
- mamaar.sql → accepted: defines · Schema includes accepted jobs.
- Client flow → templates: renders · Client pages are server-rendered from templates.
- Worker flow → templates: renders · Worker pages are server-rendered from templates.
- Admin flow → templates: renders · Admin pages are server-rendered from templates.
- templates → static assets: uses · Templates rely on CSS and JavaScript assets.
- templates → Dashboard: includes · Shared dashboard view ties the UI together.
- Client flow → requested: creates · Client actions create new hire requests.
- Worker flow → job: publishes · Workers create and manage job listings.
- Worker flow → accepted: confirms · Accepted requests move into confirmed state.
- Worker flow → requested: reviews · Workers process incoming requests from clients.
- Client flow → accepted: views · Clients inspect accepted or confirmed jobs.
