# t-k-234/skill-match architecture

> Architecture diagram of the GitHub repository t-k-234/skill-match, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-03-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/t-k-234/skill-match
- Repository: https://github.com/t-k-234/skill-match

## Overview

##### What this project is (type + purpose)
This is a **monolithic Flask web application** (“Skill Matching Portal”) that serves **server-rendered HTML pages** for two user roles:

- **Students**: register/login, manage skill profiles, browse jobs, see match scores.
- **Employers**: register/login, post jobs with requirements, see matched students.

The “AI” portion is a **TF‑IDF vectorization + cosine similarity** scoring flow used to rank student↔job fit.

The persistence layer is **SQLite** (`skillmatch/users.db`). Auth is **session-based** (per README).

##### File structure signals (how to map code to components)
From the tree:

- `skillmatch/app.py`
Likely the **Flask application entrypoint**: routes, session/auth handling, request orchestration, HTML rendering.
- `skillmatch/ml_model.py`
Likely encapsulates **text preprocessing / TF‑IDF / cosine similarity** and match ranking logic.
- `skillmatch/users.db`
**SQLite** DB file; contains tables for users, roles, student skills, jobs, etc.
- `skillmatch/templates/*.html`
**Jinja2 templates** for server-side rendered UI: login/register/dashboards/job list/match results.
- `skillmatch/static/css/*.css`
Static styling served to the client.
- `skillmatch/model.ipynb`

- **Presentation** (HTML templates + CSS)
- **Application/Controller** (Flask routes in `app.py`)
- **Domain/Service** (matching logic in `ml_model.py`)
- **Data** (SQLite `users.db`)

##### Client (Web Browser)
- Student UI
- Employer UI
- (Same web app, different pages/flows)

##### Flask Web Server (skillmatch/app.py)
- **Auth & Session Manager** (login/register, role-based routing)
- **Student Controller/Routes**
- profile + skills CRUD
- view jobs
- request match results
- **Employer Controller/Routes**
- job posting CRUD
- view matched students
- **Template Renderer (Jinja2)** (renders `templates/*.html`)
- **Static File Server** (serves `static/css/*`)

##### Matching/ML Module (skillmatch/ml_model.py)
Split into steps (since README explains them):
- Text preprocessing (tokenization/normalization)
- TF‑IDF vectorizer
- Cosine similarity scorer
- Ranker (top-N matches + percentage formatting)

##### Database (SQLite: skillmatch/users.db)
- `users` (credentials, role)
- `student_profiles` (profile fields)
- `student_skills` (skill text or normalized list)
- `jobs` (job description + required skills)
- (Optional) `matches` (if persisted; if not, show as computed on-demand)

That it informs/validates `ml_model.py`, but is not on the runtime request path.

##### Registration/Login
- Browser → Flask `/register` or `/login`
- Flask → SQLite (create user / verify credentials)
- Flask → Session Store (Flask session cookie; typically cookie-based signed session)
- Flask → Browser (render `register.html` / `login.html`)

##### Student updates skills
- Browser → Flask “update profile/skills” route
- Flask → SQLite (persist skills)
- Flask → Browser (render `student_dashboard.html`)

##### Employer posts a job
- Browser → Flask “create job” route
- Flask → SQLite (persist job requirements/description)
- Flask → Browser (render `employee_dashboard.html` or `jobs.html`)

##### Matching request (key architecture path)
- Browser → Flask “match” route (e.g., view matches)
- Flask → SQLite (fetch job descriptions / student skills)
- Flask → `ml_model.py` (TF‑IDF + cosine similarity)
- `ml_model.py` → Flask (ranked results + scores)
- Flask → Browser (render `match_result.html` / results template)

Examples:
- “Credentials”, “Session cookie”
- “Student skill text”
- “Job description/requirements”
- “TF‑IDF vectors (in-memory)”
- “Similarity scores + ranked list”

- **Monolith / single deployable Flask app**: no separate backend services.
- **Server-side rendering (SSR)**: templates in `templates/` render HTML; not a SPA.
- **Layering**:
- Routes/controllers in `app.py`
- Matching service in `ml_model.py`
- Persistence in SQLite
- **On-demand inference/scoring**: cosine similarity computed at request time (likely not precomputed).
- **Role-based UX**: student vs employer dashboards and routes.

- `skillmatch/app.py` → “Flask App / Controllers / Session Auth / Routing”
- `skillmatch/ml_model.py` → “Similarity Engine (TF‑IDF + Cosine Similarity)”
- `skillmatch/users.db` → “SQLite Database”
- `skillmatch/templates/*.html` → “SSR Templates (Jinja2)”
- `skillmatch/static/css/*.css` → “Static CSS”
- `skillmatch/model.ipynb` → “Offline model exploration (non-runtime)”

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =======================
  %% Diagram 1: System Context (C4-ish)
  %% =======================
  subgraph "Diagram 1 — System Context"
    direction TB

    subgraph "People"
      direction TB
      Student["Student"]:::person
      Employer["Employer"]:::person
    end

    subgraph "Client"
      direction TB
      Browser["Web Browser\n(SSR pages + session cookie)"]:::client
    end

    subgraph "Server"
      direction TB
      FlaskApp["Skill Matching Portal\nFlask Web App (Monolith)"]:::service
    end

    subgraph "Data Store"
      direction TB
      SQLiteDB[("SQLite DB\nusers.db")]:::database
    end

    Student -->|"uses"| Browser
    Employer -->|"uses"| Browser

    Browser -->|"HTTP requests\nlogin/register/CRUD/match"| FlaskApp
    FlaskApp -->|"SSR HTML responses\n+ Set-Cookie (session)"| Browser

    FlaskApp -->|"read/write\nusers,skills,jobs"| SQLiteDB
  end

  %% =======================
  %% Diagram 2: Internal Architecture (Component-ish)
  %% =======================
  subgraph "Diagram 2 — Internal Architecture"
    direction TB

    subgraph "Client (Browser)"
      direction TB
      UI["Student UI + Employer UI\n(server-rendered pages)"]:::client
    end

    subgraph "Flask Process (Monolith)"
      direction TB

      AppEntrypoint["Flask App Entrypoint\n(app.py)"]:::service

      subgraph "Controllers / Routes"
        direction TB
        Auth["Auth & Session Manager\n/login /register /logout\n(role-based routing)"]:::service
        StudentRoutes["Student Routes\nProfile + Skills CRUD\nBrowse Jobs\nRequest Matches"]:::service
        EmployerRoutes["Employer Routes\nJob Posting CRUD\nView Matched Students"]:::service
        MatchingRoute["Matching Route\n(view match results)"]:::service
      end

      subgraph "Presentation (SSR + Static)"
        direction TB
        TemplateEngine["Template Renderer\n(Jinja2)"]:::template
        TemplatesDir["templates/ (Jinja2 views)"]:::template

        IndexT["index.html"]:::template
        LoginT["login.html"]:::template
        RegisterT["register.html"]:::template
        StudentDashT["student_dashboard.html"]:::template
        EmployerDashT["employee_dashboard.html"]:::template
        JobsT["jobs.html"]:::template
        MatchResultT["match_result.html"]:::template
        ResultsAltT["resullts.html\n(alt/typo page)"]:::template

        StaticServer["Static File Server"]:::static
        CssDir["static/css/"]:::static
        LoginCss["login.css"]:::static
        RegisterCss["register.css"]:::static
        StudentDashCss["student_dashboard.css"]:::static
        EmployerDashCss["employee_dashboard.css"]:::static
      end

      subgraph "Domain Service (Matching)"
        direction TB
        MLModule["Matching / ML Module\n(ml_model.py)"]:::ml

        Preprocess["Text preprocessing\n(tokenize/normalize)"]:::ml
        TFIDF["TF-IDF Vectorizer\n(in-memory vectors)"]:::ml
        Cosine["Cosine Similarity Scorer"]:::ml
        Ranker["Ranker\nTop-N + % formatting"]:::ml

        MLModule -->|"pipeline"| Preprocess
        Preprocess -->|"cleaned text"| TFIDF
        TFIDF -->|"TF-IDF vectors"| Cosine
        Cosine -->|"similarity scores"| Ranker
      end

      subgraph "Persistence"
        direction TB
        DBAccess["DB Access\n(queries in routes or helper funcs)"]:::service
        DB[("SQLite\nusers.db")]:::database

        subgraph "Logical Tables (conceptual)"
          direction TB
          TUsers["users\n(credentials,role)"]:::table
          TStudentProfiles["student_profiles"]:::table
          TStudentSkills["student_skills\n(skill text/list)"]:::table
          TJobs["jobs\n(description,requirements)"]:::table
          TMatches["matches\n(optional/on-demand)"]:::tableOptional
        end

        DB -->|"contains"| TUsers
        DB -->|"contains"| TStudentProfiles
        DB -->|"contains"| TStudentSkills
        DB -->|"contains"| TJobs
        DB -.->|"optional"| TMatches
      end

      subgraph "Offline / Dev Artifact (Non-runtime)"
        direction TB
        Notebook["model.ipynb\n(offline experimentation)"]:::offline
      end
    end

    %% Client -> Server (runtime flows)
    UI -->|"GET /login /register\nCredentials + session cookie"| Auth
    UI -->|"Student actions\nskill text updates"| StudentRoutes
    UI -->|"Employer actions\njob requirements/description"| EmployerRoutes
    UI -->|"GET /match\n(view matches)"| MatchingRoute

    %% Controllers -> App + Presentation
    AppEntrypoint -->|"wires routes"| Auth
    AppEntrypoint -->|"wires routes"| StudentRoutes
    AppEntrypoint -->|"wires routes"| EmployerRoutes
    AppEntrypoint -->|"wires routes"| MatchingRoute

    Auth -->|"render"| TemplateEngine
    StudentRoutes -->|"render"| TemplateEngine
    EmployerRoutes -->|"render"| TemplateEngine
    MatchingRoute -->|"render"| TemplateEngine

    TemplateEngine -->|"loads"| TemplatesDir
    TemplatesDir -->|"includes"| IndexT
    TemplatesDir -->|"includes"| LoginT
    TemplatesDir -->|"includes"| RegisterT
    TemplatesDir -->|"includes"| StudentDashT
    TemplatesDir -->|"includes"| EmployerDashT
    TemplatesDir -->|"includes"| JobsT
    TemplatesDir -->|"includes"| MatchResultT
    TemplatesDir -->|"includes"| ResultsAltT

    UI -->|"GET /static/css/*"| StaticServer
    StaticServer -->|"serves"| CssDir
    CssDir -->|"serves"| LoginCss
    CssDir -->|"serves"| RegisterCss
    CssDir -->|"serves"| StudentDashCss
    CssDir -->|"serves"| EmployerDashCss

    %% Persistence interactions
    Auth -->|"verify/create user\n(credentials,role)"| DBAccess
    StudentRoutes -->|"persist/retrieve\nprofile + skills"| DBAccess
    EmployerRoutes -->|"persist/retrieve\njobs"| DBAccess
    MatchingRoute -->|"fetch\nskills + jobs"| DBAccess

    DBAccess -->|"read/write"| DB

    %% Matching interactions
    MatchingRoute -->|"calls\nTF-IDF + cosine similarity"| MLModule
    DBAccess -->|"provides\nStudent skill text + Job descriptions"| MLModule
    MLModule -->|"returns\nranked matches + scores"| MatchingRoute

    %% Offline artifact relationship (non-runtime)
    Notebook -.->|"informs/validates\napproach used in ml_model.py"| MLModule
  end

  %% =======================
  %% Click Events (from component_mapping)
  %% =======================
  click AppEntrypoint "https://github.com/t-k-234/skill-match/blob/main/skillmatch/app.py"
  click MLModule "https://github.com/t-k-234/skill-match/blob/main/skillmatch/ml_model.py"
  click DB "https://github.com/t-k-234/skill-match/blob/main/skillmatch/users.db"
  click TemplatesDir "https://github.com/t-k-234/skill-match/tree/main/skillmatch/templates/"
  click IndexT "https://github.com/t-k-234/skill-match/blob/main/skillmatch/templates/index.html"
  click LoginT "https://github.com/t-k-234/skill-match/blob/main/skillmatch/templates/login.html"
  click RegisterT "https://github.com/t-k-234/skill-match/blob/main/skillmatch/templates/register.html"
  click StudentDashT "https://github.com/t-k-234/skill-match/blob/main/skillmatch/templates/student_dashboard.html"
  click EmployerDashT "https://github.com/t-k-234/skill-match/blob/main/skillmatch/templates/employee_dashboard.html"
  click JobsT "https://github.com/t-k-234/skill-match/blob/main/skillmatch/templates/jobs.html"
  click MatchResultT "https://github.com/t-k-234/skill-match/blob/main/skillmatch/templates/match_result.html"
  click ResultsAltT "https://github.com/t-k-234/skill-match/blob/main/skillmatch/templates/resullts.html"
  click CssDir "https://github.com/t-k-234/skill-match/tree/main/skillmatch/static/css/"
  click LoginCss "https://github.com/t-k-234/skill-match/blob/main/skillmatch/static/css/login.css"
  click RegisterCss "https://github.com/t-k-234/skill-match/blob/main/skillmatch/static/css/register.css"
  click StudentDashCss "https://github.com/t-k-234/skill-match/blob/main/skillmatch/static/css/student_dashboard.css"
  click EmployerDashCss "https://github.com/t-k-234/skill-match/blob/main/skillmatch/static/css/employee_dashboard.css"
  click Notebook "https://github.com/t-k-234/skill-match/blob/main/skillmatch/model.ipynb"
  click SQLiteDB "https://github.com/t-k-234/skill-match/blob/main/skillmatch/users.db"
  click FlaskApp "https://github.com/t-k-234/skill-match/blob/main/skillmatch/app.py"
  click StaticServer "https://github.com/t-k-234/skill-match/tree/main/skillmatch/static/css/"

  %% =======================
  %% Styles
  %% =======================
  classDef person fill:#E9F5FF,stroke:#1D4ED8,stroke-width:1px,color:#0B2559
  classDef client fill:#DBEAFE,stroke:#1D4ED8,stroke-width:1px,color:#0B2559
  classDef service fill:#BFDBFE,stroke:#1E40AF,stroke-width:1px,color:#0B2559
  classDef ml fill:#C7D2FE,stroke:#4338CA,stroke-width:1px,color:#1E1B4B
  classDef database fill:#FEF3C7,stroke:#B45309,stroke-width:1px,color:#3B2F00
  classDef table fill:#FFF7D6,stroke:#B45309,stroke-width:1px,color:#3B2F00
  classDef tableOptional fill:#FFF7D6,stroke:#B45309,stroke-width:1px,color:#3B2F00,stroke-dasharray:4 3
  classDef template fill:#E5E7EB,stroke:#374151,stroke-width:1px,color:#111827
  classDef static fill:#D1D5DB,stroke:#374151,stroke-width:1px,color:#111827
  classDef offline fill:#F3F4F6,stroke:#6B7280,stroke-width:1px,color:#111827,stroke-dasharray:5 4
```
