# sreelalchalil/online-job-portal architecture

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

- Interactive diagram: https://gitdiagram.com/sreelalchalil/online-job-portal
- Repository: https://github.com/sreelalchalil/online-job-portal

## Overview

##### Project type and purpose
- This is a monolithic full-stack web application (“Online Job Portal”) built with PHP on the server side, MySQL as the relational database, and HTML/JavaScript with Bootstrap for the frontend.
- Its core use cases: employers register/log in, post jobs, view/manage applicants; job seekers register/log in, search/browse/apply for jobs; location lookup via an internal API; file upload for resumes and logos.

##### File structure
- Top-level directories and files:
- Database/ – contains SQL scripts (JobPortal.sql, location.sql) to create schema
- bootstrap/ – entire Bootstrap 3 library (CSS, JS, fonts, docs)
- css/, js/ – application-specific static assets
- employer/, jobseeker/ – PHP modules implementing business logic for each user role
- location/ – a self-contained REST-style API (classes/dbconfig.php, classes/location.php, api.php) and a client JS
- uploads/ – file storage for images, logos, resumes
- config.php – central PHP configuration (database credentials, connection setup)
- index.php, login/logout/process_login.php, forgotpass.php – auth and landing pages
- Architectural patterns:
- Layered separation by concern (presentation vs. business logic vs. data)
- Functional partitioning into “employer,” “jobseeker,” and “location” modules
- Static asset folder structure for CSS/JS/Bootstrap vendor code

##### README for additional insights
- Confirms use of PHP, MySQL, HTML, JavaScript, Bootstrap
- Mentions academic usage (no production-grade microservices)
- References a future GraphQL/Mongo version (not relevant here)

##### Elements
- Clear, human-readable labels for each component (e.g., “Browser,” “PHP App Server,” “MySQL DB,” “Uploads Storage,” “Bootstrap CDN”)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    Client["Browser"]:::frontend
    subgraph "Static Assets Server"
        direction TB
        BS["Bootstrap Library"]:::frontend
        CSS["Application CSS"]:::frontend
        JS["Application JS"]:::frontend
    end
    Client -->|HTTP GET CSS/JS/Bootstrap| BS
    Client -->|HTTP GET CSS| CSS
    Client -->|HTTP GET JS| JS
    Client -->|HTTP Request| WebServer["PHP App Server"]:::backend

    %% Web Server and PHP Application
    subgraph "Web Server"
        direction TB
        CFG["config.php"]:::backend

        subgraph "Auth & Landing Pages"
            direction TB
            IDX["index.php"]:::backend
            LOGIN["login.php"]:::backend
            LOGOUT["logout.php"]:::backend
            PROC_LOGIN["process_login.php"]:::backend
            FORGOT["forgotpass.php"]:::backend
        end

        subgraph "Employer Module"
            direction TB
            EMP_REG["register_emp.php"]:::backend
            EMP_PROC_REG["process_regemp.php"]:::backend
            POST_JOB["post_jobs.php"]:::backend
            PROC_JOB["process_postjob.php"]:::backend
            MANAGE_JOBS["managejobs.php"]:::backend
            MANAGE_APPL["manage_applicants.php"]:::backend
            PROC_SEL["process_select.php"]:::backend
            PROC_REJ["process_reject.php"]:::backend
            NOTIFY["notify.php"]:::backend
            VIEW_JOB["view.php"]:::backend
            VIEW_JS["view_js.php"]:::backend
            DELETE_JOB["deletejob.php"]:::backend
            EMP_PROFILE["profile.php"]:::backend
        end

        subgraph "Jobseeker Module"
            direction TB
            JS_REG["register_user.php"]:::backend
            JS_PROC["process_user.php"]:::backend
            ADV_SEARCH["adv_search.php"]:::backend
            HOME_SEARCH_EP["home_search.php"]:::backend
            JS_SEARCH_JS["search.js"]:::frontend
            VIEW_JOBS["view_jobs.php"]:::backend
            VIEW_EMP["view_emp.php"]:::backend
            JOBS_BY_EMP["jobs_by_emp.php"]:::backend
            APPLY_JOB["apply_job.php"]:::backend
            REJECT_JOB["reject.php"]:::backend
            VIEW_APPLIED["view_applied.php"]:::backend
            VIEW_SELECTED["view_selected.php"]:::backend
            JS_PROFILE["profile.php"]:::backend
        end

        subgraph "Location Service"
            direction TB
            LOC_API["api.php"]:::backend
            LOC_DBCFG["dbconfig.php"]:::backend
            LOC_CLASS["location.php"]:::backend
            LOC_JS["location.js"]:::frontend
        end

        UPLOAD_HANDLER["upload.php"]:::backend
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        MySQL["MySQL Database"]:::db
        FileStorage["Uploads Storage"]:::storage
    end

    %% Connections
    WebServer -->|uses| CFG
    WebServer -->|routes| IDX
    WebServer --> LOGIN
    WebServer --> LOGOUT
    WebServer --> PROC_LOGIN
    WebServer --> FORGOT

    WebServer --> EMP_REG
    WebServer --> JS_REG
    WebServer --> LOC_API
    WebServer --> UPLOAD_HANDLER

    CFG -->|connects| MySQL
    EMP_REG -->|SQL Queries| MySQL
    EMP_PROC_REG -->|SQL Queries| MySQL
    POST_JOB -->|SQL Queries| MySQL
    PROC_JOB -->|SQL Queries| MySQL
    MANAGE_JOBS -->|SQL Queries| MySQL
    MANAGE_APPL -->|SQL Queries| MySQL
    VIEW_JOB -->|SQL Queries| MySQL
    VIEW_JS -->|SQL Queries| MySQL
    JS_REG -->|SQL Queries| MySQL
    JS_PROC -->|SQL Queries| MySQL
    ADV_SEARCH -->|SQL Queries| MySQL
    HOME_SEARCH_EP -->|SQL Queries| MySQL
    VIEW_JOBS -->|SQL Queries| MySQL
    APPLY_JOB -->|SQL Queries| MySQL

    UPLOAD_HANDLER -->|writes files| FileStorage

    JS_SEARCH_JS -->|AJAX GET /search| ADV_SEARCH
    LOC_JS -->|AJAX GET /location/api.php| LOC_API

    %% Click Events
    click BS "https://github.com/sreelalchalil/online-job-portal/tree/master/bootstrap/"
    click CSS "https://github.com/sreelalchalil/online-job-portal/tree/master/css/"
    click JS "https://github.com/sreelalchalil/online-job-portal/tree/master/js/"
    click CFG "https://github.com/sreelalchalil/online-job-portal/blob/master/config.php"
    click IDX "https://github.com/sreelalchalil/online-job-portal/blob/master/index.php"
    click LOGIN "https://github.com/sreelalchalil/online-job-portal/blob/master/login.php"
    click LOGOUT "https://github.com/sreelalchalil/online-job-portal/blob/master/logout.php"
    click PROC_LOGIN "https://github.com/sreelalchalil/online-job-portal/blob/master/process_login.php"
    click FORGOT "https://github.com/sreelalchalil/online-job-portal/blob/master/forgotpass.php"
    click EMP_REG "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/register_emp.php"
    click EMP_PROC_REG "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/process_regemp.php"
    click POST_JOB "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/post_jobs.php"
    click PROC_JOB "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/process_postjob.php"
    click MANAGE_JOBS "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/managejobs.php"
    click MANAGE_APPL "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/manage_applicants.php"
    click PROC_SEL "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/process_select.php"
    click PROC_REJ "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/process_reject.php"
    click NOTIFY "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/notify.php"
    click VIEW_JOB "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/view.php"
    click VIEW_JS "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/view_js.php"
    click DELETE_JOB "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/deletejob.php"
    click EMP_PROFILE "https://github.com/sreelalchalil/online-job-portal/blob/master/employer/profile.php"
    click JS_REG "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/register_user.php"
    click JS_PROC "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/process_user.php"
    click ADV_SEARCH "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/adv_search.php"
    click HOME_SEARCH_EP "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/home_search.php"
    click JS_SEARCH_JS "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/search.js"
    click VIEW_JOBS "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/view_jobs.php"
    click VIEW_EMP "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/view_emp.php"
    click JOBS_BY_EMP "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/jobs_by_emp.php"
    click APPLY_JOB "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/apply_job.php"
    click REJECT_JOB "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/reject.php"
    click VIEW_APPLIED "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/view_applied.php"
    click VIEW_SELECTED "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/view_selected.php"
    click JS_PROFILE "https://github.com/sreelalchalil/online-job-portal/blob/master/jobseeker/profile.php"
    click LOC_API "https://github.com/sreelalchalil/online-job-portal/blob/master/location/api.php"
    click LOC_DBCFG "https://github.com/sreelalchalil/online-job-portal/blob/master/location/classes/dbconfig.php"
    click LOC_CLASS "https://github.com/sreelalchalil/online-job-portal/blob/master/location/classes/location.php"
    click LOC_JS "https://github.com/sreelalchalil/online-job-portal/blob/master/location/location.js"
    click UPLOAD_HANDLER "https://github.com/sreelalchalil/online-job-portal/blob/master/upload.php"
    click MySQL "https://github.com/sreelalchalil/online-job-portal/blob/master/Database/JobPortal.sql"
    click MySQL "https://github.com/sreelalchalil/online-job-portal/blob/master/Database/location.sql"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#3399ff,color:#000;
    classDef backend fill:#d4edda,stroke:#28a745,color:#000;
    classDef db fill:#ffe5b4,stroke:#ff9900,color:#000;
    classDef storage fill:#f2f2f2,stroke:#666,color:#000;
```
