# aeriswispx/job-portal architecture

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

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

## Overview

##### Main Components

a) Client Layer:
- Three distinct web interfaces:
- Job Seeker Portal
- Company Portal
- Admin Portal

b) Application Layer:
- Core PHP Application Server
- Authentication System
- File Management System

c) Data Layer:
- MySQL Database
- File Storage System (for resumes and job images)

##### User Authentication Flow
- Login/register endpoints connecting to auth system
- Demonstrate role-based routing to respective dashboards

##### Job Seeker Flow
- Profile management
- Job search and application process
- Resume upload system

##### Company Flow
- Job posting system
- Application management
- Candidate tracking

##### Admin Flow
- User management
- Job approval system
- Company verification

##### Specific Implementation Details

Use these visual elements:
- Red lines for authentication flows
- Black lines for data flows

##### Component Breakdown

Frontend Components:
**Web Interface**
- Public Pages (index.php, about.php, contact.php)
- Authentication (login.php, register.php)
- Role-Based Dashboards
- Student Dashboard
- Company Dashboard
- Admin Dashboard

Backend Services:
**Application Layer**
- Authentication Service (utils.php)
- Database Connection (db_connect.php)
- File Management
- Business Logic
- Job Management
- Application Processing
- User Management

Data Storage:
**Storage Layer**
- MySQL Database
- Users Table
- Jobs Table
- Applications Table
- File Storage
- /uploads/resumes
- /uploads/job_images

##### Important Technical Elements

- PHP 7.4+ Runtime Environment
- MySQL 5.7+ Database
- Apache/Nginx Web Server
- SMTP Email Service
- File System Storage

##### Security Layer Representation

Security measures as a cross-cutting concern:
- Password hashing
- CSRF protection
- Input validation
- Session management
- File upload validation

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client_Layer
        JSP[Job Seeker Portal]
        CP[Company Portal]
        AP[Admin Portal]
        PP[Public Pages]
    end

    subgraph Application_Layer
        AS[Authentication System]
        FMS[File Management System]
        BL[Business Logic]
    end

    subgraph Data_Layer
        DB[(MySQL Database)]
        FS[File Storage]
    end

    %% Public Interface Connections
    PP --> AS
    PP --> |Browse Jobs| BL

    %% Job Seeker Flow
    JSP --> AS
    JSP --> BL
    JSP --> FMS

    %% Company Flow
    CP --> AS
    CP --> BL
    CP --> FMS

    %% Admin Flow
    AP --> AS
    AP --> BL
    AP --> FMS

    %% Backend Connections
    AS --> DB
    BL --> DB
    FMS --> FS

    %% File Storage Details
    FS --> RS[Resume Storage]
    FS --> JI[Job Image Storage]

    %% Database Tables
    DB --> UT[Users Table]
    DB --> JT[Jobs Table]
    DB --> AT[Applications Table]

    %% Styling
    style Client_Layer fill:#e6f3ff
    style Application_Layer fill:#e6ffe6
    style Data_Layer fill:#fff2cc

    %% Click Events
    click JSP "https://github.com/AerisWispX/Job-Portal/tree/main/pages/student/"
    click CP "https://github.com/AerisWispX/Job-Portal/tree/main/pages/company/"
    click AP "https://github.com/AerisWispX/Job-Portal/tree/main/pages/admin/"
    click PP "https://github.com/AerisWispX/Job-Portal/blob/main/index.php"
    click AS "https://github.com/AerisWispX/Job-Portal/blob/main/utils.php"
    click DB "https://github.com/AerisWispX/Job-Portal/blob/main/db_connect.php"
    click RS "https://github.com/AerisWispX/Job-Portal/tree/main/uploads/resumes/"
    click JI "https://github.com/AerisWispX/Job-Portal/tree/main/uploads/job_images/"

    %% Legend
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef storage fill:#fff2cc,stroke:#333,stroke-width:2px
    classDef interface fill:#e6f3ff,stroke:#333,stroke-width:2px
    classDef service fill:#e6ffe6,stroke:#333,stroke-width:2px

    %% Add Legend
    subgraph Legend
        L1[Client Interface]:::interface
        L2[Application Service]:::service
        L3[Data Storage]:::storage
    end
```
