# karanam-gowtham/fms architecture

> Architecture diagram of the GitHub repository karanam-gowtham/fms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karanam-gowtham/fms
- Repository: https://github.com/karanam-gowtham/fms

## Overview

FMS is an academic document-governance platform. Staff and students enter through the web front controller to authenticate, submit evidence, and move submissions through configurable review and approval; administrators govern users, departments, and workflows. Separate product branches provide NBA/NAAC accreditation dossiers, student-activity tracking, and public research analytics. The graph preserves core PDF and workflow services identified in the source index. Some subsystem connections are documented in the README rather than demonstrated in sampled controller code; those edges cite the README.

Main entry points: [`public/index.php`](https://github.com/karanam-gowtham/fms/blob/main/public/index.php) (Request router), [`src/Controllers/DocumentController.php`](https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/DocumentController.php) (Document management), [`core/workflow_engine.php`](https://github.com/karanam-gowtham/fms/blob/main/core/workflow_engine.php) (Approval engine), [`src/Controllers/DocumentActionController.php`](https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/DocumentActionController.php) (Document actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry and security"]
  node_router["Request router<br/>[index.php]"]
  node_request["Input validation<br/>[Request.php]"]
  node_auth["Authentication<br/>[auth.php]"]
end

subgraph group_governance["Document governance"]
  node_documents["Document management"]
  node_actions["Document actions"]
  node_workflow["Approval engine"]
  node_files["File handling<br/>[file_service.php]"]
  node_docservice["Document lifecycle"]
  node_adminworkflow["Workflow administration"]
end

subgraph group_accreditation["Accreditation and reports"]
  node_accredapi["Accreditation APIs"]
  node_accredpdf["Dossier generation"]
  node_pdfmerge["PDF merging"]
  node_pdfnorm["PDF normalization<br/>[pdf_normalizer.php]"]
end

subgraph group_analytics["Portals and analytics"]
  node_studentactivity["Student activities"]
  node_publicanalytics["Research analytics<br/>[index.php]"]
  node_statsapi["Public statistics API<br/>[public_stats.php]"]
end

node_client(("Browser users"))
node_mysql[("Relational database")]

node_client -->|"sends requests"| node_router
node_router -->|"routes requests"| node_documents
node_router -->|"routes actions"| node_actions
node_router -.->|"dispatches auth"| node_auth
node_router -.->|"validates input"| node_request
node_documents -->|"reads filters"| node_request
node_documents -->|"uses file service"| node_files
node_documents -->|"uses workflow"| node_workflow
node_actions -->|"executes transitions"| node_workflow
node_actions -.->|"stores files"| node_files
node_adminworkflow -.->|"configures approvals"| node_workflow
node_workflow -->|"reads and updates"| node_mysql
node_documents -.->|"manages lifecycle"| node_docservice
node_accredapi -.->|"generates dossiers"| node_accredpdf
node_accredpdf -->|"merges proofs"| node_pdfmerge
node_accredpdf -->|"normalizes PDFs"| node_pdfnorm
node_client -.->|"views activity"| node_studentactivity
node_client -->|"views research"| node_publicanalytics
node_publicanalytics -->|"fetches statistics"| node_statsapi

click node_router "https://github.com/karanam-gowtham/fms/blob/main/public/index.php"
click node_request "https://github.com/karanam-gowtham/fms/blob/main/src/Core/Request.php"
click node_auth "https://github.com/karanam-gowtham/fms/blob/main/core/auth.php"
click node_documents "https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/DocumentController.php"
click node_actions "https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/DocumentActionController.php"
click node_workflow "https://github.com/karanam-gowtham/fms/blob/main/core/workflow_engine.php"
click node_files "https://github.com/karanam-gowtham/fms/blob/main/core/file_service.php"
click node_docservice "https://github.com/karanam-gowtham/fms/blob/main/core/document_service.php"
click node_adminworkflow "https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/WorkflowController.php"
click node_accredapi "https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/AbstractAccreditationAPIController.php"
click node_accredpdf "https://github.com/karanam-gowtham/fms/blob/main/core/accreditation_pdf_service.php"
click node_pdfmerge "https://github.com/karanam-gowtham/fms/blob/main/core/pdf_merger_service.php"
click node_pdfnorm "https://github.com/karanam-gowtham/fms/blob/main/core/pdf_normalizer.php"
click node_studentactivity "https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/StudentActivityDashboardController.php"
click node_publicanalytics "https://github.com/karanam-gowtham/fms/blob/main/index.php"
click node_statsapi "https://github.com/karanam-gowtham/fms/blob/main/public/api/public_stats.php"

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_router,node_request,node_auth,node_client toneBlue
class node_documents,node_actions,node_workflow,node_files,node_docservice,node_adminworkflow,node_mysql toneAmber
class node_accredapi,node_accredpdf,node_pdfmerge,node_pdfnorm toneMint
class node_studentactivity,node_publicanalytics,node_statsapi toneRose
```

## Components

### Web entry and security

- [Request router](https://github.com/karanam-gowtham/fms/blob/main/public/index.php): `public/index.php`
- [Input validation](https://github.com/karanam-gowtham/fms/blob/main/src/Core/Request.php): `src/Core/Request.php`
- [Authentication](https://github.com/karanam-gowtham/fms/blob/main/core/auth.php): `core/auth.php`

### Document governance

- [Document management](https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/DocumentController.php): `src/Controllers/DocumentController.php`
- [Document actions](https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/DocumentActionController.php): `src/Controllers/DocumentActionController.php`
- [Approval engine](https://github.com/karanam-gowtham/fms/blob/main/core/workflow_engine.php): `core/workflow_engine.php`
- [File handling](https://github.com/karanam-gowtham/fms/blob/main/core/file_service.php): `core/file_service.php`
- [Document lifecycle](https://github.com/karanam-gowtham/fms/blob/main/core/document_service.php): `core/document_service.php`
- [Workflow administration](https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/WorkflowController.php): `src/Controllers/WorkflowController.php`

### Accreditation and reports

- [Accreditation APIs](https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/AbstractAccreditationAPIController.php): `src/Controllers/AbstractAccreditationAPIController.php`
- [Dossier generation](https://github.com/karanam-gowtham/fms/blob/main/core/accreditation_pdf_service.php): `core/accreditation_pdf_service.php`
- [PDF merging](https://github.com/karanam-gowtham/fms/blob/main/core/pdf_merger_service.php): `core/pdf_merger_service.php`
- [PDF normalization](https://github.com/karanam-gowtham/fms/blob/main/core/pdf_normalizer.php): `core/pdf_normalizer.php`

### Portals and analytics

- [Student activities](https://github.com/karanam-gowtham/fms/blob/main/src/Controllers/StudentActivityDashboardController.php): `src/Controllers/StudentActivityDashboardController.php`
- [Research analytics](https://github.com/karanam-gowtham/fms/blob/main/index.php): `index.php`
- [Public statistics API](https://github.com/karanam-gowtham/fms/blob/main/public/api/public_stats.php): `public/api/public_stats.php`

### Other components

- **Browser users**
- **Relational database**

## Connections

- Browser users → Request router: sends requests
- Request router → Document management: routes requests (evidence: `public/index.php`)
- Request router → Document actions: routes actions (evidence: `public/index.php`)
- Request router → Authentication: dispatches auth
- Request router → Input validation: validates input
- Document management → Input validation: reads filters (evidence: `src/Controllers/DocumentController.php`)
- Document management → File handling: uses file service (evidence: `src/Controllers/DocumentController.php`)
- Document management → Approval engine: uses workflow (evidence: `src/Controllers/DocumentController.php`)
- Document actions → Approval engine: executes transitions (evidence: `src/Controllers/DocumentActionController.php`)
- Document actions → File handling: stores files
- Workflow administration → Approval engine: configures approvals
- Approval engine → Relational database: reads and updates (evidence: `core/workflow_engine.php`)
- Document management → Document lifecycle: manages lifecycle
- Accreditation APIs → Dossier generation: generates dossiers
- Dossier generation → PDF merging: merges proofs (evidence: `core/accreditation_pdf_service.php`)
- Dossier generation → PDF normalization: normalizes PDFs (evidence: `core/accreditation_pdf_service.php`)
- Browser users → Student activities: views activity
- Browser users → Research analytics: views research (evidence: `index.php`)
- Research analytics → Public statistics API: fetches statistics (evidence: `index.php`)
