# harshitgupta2610/aicte-portal-f architecture

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

- Interactive diagram: https://gitdiagram.com/harshitgupta2610/aicte-portal-f
- Repository: https://github.com/harshitgupta2610/aicte-portal-f

## Overview

##### Project Type & Purpose
- This is a full-stack web application developed for the Smart India Hackathon 2023. Its purpose is to provide a unified, secure web portal for collaboratively designing and managing technical university curriculums. Major features include real-time chat and notifications, versioning of curriculum data, user authentication/authorization, feedback analysis, a central resource repository, PDF downloads for curriculums, and access control management.

##### Architectural Components Identified from the File Tree and README
a. Frontend Client
- Found under the “client” directory – A React-based application.
- Contains component hierarchies, pages (login, dashboard, curriculum editing, profile, etc.), context providers for state management (for courses, filters, subjects, and users), hooks, and styling (Tailwind CSS configuration).
- Typical folders: client/src/components, client/src/context, client/src/pages.

b. Backend Server
- Entry point: server.js along with app.js that appears to bootstrap the application.
- Uses Express (inferred by the “controllers”, “routes”, “middlewares”, and “models” directories), following an MVC-like pattern.
- Controllers handle core business logic (e.g., authController.js, courseController.js, subjectController.js) and interact with Models defining data structures.
- Routes (e.g., authRoute.js, courseRoute.js) expose RESTful endpoints.
- Middleware (errorHandler.js) and error utilities provide robust error management.
- Real-time aspects are covered by a “socket” directory (e.g., socket/index.js) for chat/notifications.

c. Auxiliary Services and Utilities
- PDF Generation: The “pdfCreation” directory contains HTML templates and scripts for generating downloadable PDF curriculums.
- Email & Other Utility Functions: The “utils” directory provides common functionality needed by the backend (e.g., email sending, pdfUtils, typeConversion).
- Docker & Deployment: Dockerfile, docker-compose.yml, and environment example files suggest containerization for deployment.

d. Implicit/Inferred Components
- Database: Though not explicitly defined, the models suggest a data store (likely MongoDB or a similar NoSQL database) used by the backend.
- External Services: Authentication and role management for AICTE staff and collaborators imply integration with external email systems or authentication providers.

- Below the API layer, branch out to:
- Database (CRUD operations)
- WebSocket/Real-Time Service (for live chats and notifications)
- PDF Generation Service (for curriculum downloads)
- External Email Service (for user notifications and verification)
- Enclose Docker symbols near both the frontend and backend to represent containerization.

## Diagram (Mermaid)

```mermaid
graph TD

%% User Interaction
U["User"]:::user

%% Frontend Layer
subgraph "Frontend Layer"
    FE["React Frontend"]:::frontend
    FE_Pages["Pages: Login, Dashboard, Curriculum Editing"]:::frontend
    FE_Components["Components: Forms, Modals, Navigation"]:::frontend
    FE_Context["Context Providers & Hooks"]:::frontend
    FE --> FE_Pages
    FE_Pages --> FE_Components
    FE_Pages --> FE_Context
end

%% Backend API Server Layer
subgraph "Backend API Server"
    BE_Entry["Express Server Entry Point (server.js, app.js)"]:::backend
    BE_Controllers["Controllers (Auth,Course,Subject)"]:::backend
    BE_Routes["Routes (authRoute.js,courseRoute.js)"]:::backend
    BE_Middleware["Middlewares (errorHandler.js)"]:::backend
    BE_Models["Models (courseModel.js,userModel.js)"]:::backend
    BE_Entry --> BE_Controllers
    BE_Entry --> BE_Routes
    BE_Entry --> BE_Middleware
    BE_Entry --> BE_Models
end

%% Auxiliary Services
DB["Database (NoSQL)"]:::database
WS["WebSocket Service"]:::backend
PDF["PDF Generation Service"]:::pdf
Email["External Email Service"]:::email

%% Docker Containers
FE_Docker["Frontend Docker Container"]:::docker
BE_Docker["Backend Docker Container"]:::docker

%% Relationships
U -->|"accesses"| FE
FE -->|"API call"| BE_Entry
BE_Entry -->|"CRUD"| DB
BE_Entry -->|"RealTime"| WS
BE_Entry -->|"PDFDownload"| PDF
BE_Entry -->|"Notification"| Email
FE --- FE_Docker
BE_Entry --- BE_Docker

%% Click Events
click FE "https://github.com/harshitgupta2610/aicte-portal-f/tree/main/client/"
click BE_Entry "https://github.com/harshitgupta2610/aicte-portal-f/blob/main/server.js"
click BE_Controllers "https://github.com/harshitgupta2610/aicte-portal-f/tree/main/controllers/"
click BE_Routes "https://github.com/harshitgupta2610/aicte-portal-f/tree/main/routes/"
click BE_Middleware "https://github.com/harshitgupta2610/aicte-portal-f/blob/main/middlewares/errorHandler.js"
click BE_Models "https://github.com/harshitgupta2610/aicte-portal-f/tree/main/models/"
click WS "https://github.com/harshitgupta2610/aicte-portal-f/blob/main/socket/index.js"
click PDF "https://github.com/harshitgupta2610/aicte-portal-f/tree/main/pdfCreation/"
click Email "https://github.com/harshitgupta2610/aicte-portal-f/blob/main/utils/email.js"
click FE_Docker "https://github.com/harshitgupta2610/aicte-portal-f/tree/main/client/Dockerfile"
click BE_Docker "https://github.com/harshitgupta2610/aicte-portal-f/tree/main/Dockerfile"

%% Styling
classDef frontend fill:#DCEEFB,stroke:#1F8EF1,stroke-width:2px;
classDef backend fill:#D1F2EB,stroke:#1ABC9C,stroke-width:2px;
classDef database fill:#FEF9E7,stroke:#F1C40F,stroke-width:2px;
classDef pdf fill:#FADBD8,stroke:#E74C3C,stroke-width:2px;
classDef email fill:#FCF3CF,stroke:#F39C12,stroke-width:2px;
classDef docker fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px;
classDef user fill:#FFF0F5,stroke:#D63384,stroke-width:2px;
```
