# suryans77/operating-system architecture

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

- Interactive diagram: https://gitdiagram.com/suryans77/operating-system
- Repository: https://github.com/suryans77/operating-system

## Overview

This is a C academic-management server with a TCP client, role-based authentication, and administrator, faculty, and student course workflows. The server accepts concurrent client connections, authenticates users, and routes each session to its role menu; menu handlers perform account and course operations against text-file records. The README documents semaphore-protected updates and temporary-file replacement. Source excerpts show server dispatch and selected operations, but not every handler or storage interaction, so unverified links are omitted; data-file nodes represent documented stores.

Main entry points: [`server.c`](https://github.com/suryans77/operating-system/blob/main/server.c) (TCP Server), [`functions.c`](https://github.com/suryans77/operating-system/blob/main/functions.c) (Student Course Registration), [`client.c`](https://github.com/suryans77/operating-system/blob/main/client.c) (TCP Client), [`headers.h`](https://github.com/suryans77/operating-system/blob/main/headers.h) (Shared Types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Client and Server Access"]
  node_client["TCP Client<br/>[client.c]"]
  node_server["TCP Server<br/>[server.c]"]
  node_protocol["Shared Types<br/>[headers.h]"]
end

subgraph group_identity["Identity and Accounts"]
  node_auth["Authentication<br/>[server.c]"]
  node_admin["Administrator Operations<br/>[functions.c]"]
end

subgraph group_academics["Academic Workflows"]
  node_faculty["Faculty Course Management<br/>[functions.c]"]
  node_student["Student Course Registration<br/>[functions.c]"]
end

subgraph group_records["Persistent Records"]
  node_accounts[("Account Records")]
  node_courses[("Course Records")]
  node_enrollments[("Enrollment Records")]
end

node_user(("Admin, Faculty, Student"))

node_user -->|"uses"| node_client
node_client -->|"connects and exchanges"| node_server
node_server -->|"authenticates"| node_auth
node_server -->|"routes admin"| node_admin
node_server -->|"routes faculty"| node_faculty
node_server -->|"routes student"| node_student
node_server -->|"uses declarations"| node_protocol
node_admin -.->|"manages"| node_accounts
node_faculty -->|"manages"| node_courses
node_student -->|"reads and updates"| node_courses
node_student -->|"reads and updates"| node_enrollments
node_auth -->|"checks credentials"| node_accounts

click node_client "https://github.com/suryans77/operating-system/blob/main/client.c"
click node_server "https://github.com/suryans77/operating-system/blob/main/server.c"
click node_protocol "https://github.com/suryans77/operating-system/blob/main/headers.h"
click node_auth "https://github.com/suryans77/operating-system/blob/main/server.c"
click node_admin "https://github.com/suryans77/operating-system/blob/main/functions.c"
click node_faculty "https://github.com/suryans77/operating-system/blob/main/functions.c"
click node_student "https://github.com/suryans77/operating-system/blob/main/functions.c"

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_client,node_server,node_protocol toneBlue
class node_auth,node_admin toneAmber
class node_faculty,node_student toneMint
class node_accounts,node_courses,node_enrollments toneRose
class node_user toneIndigo
```

## Components

### Client and Server Access

- [TCP Client](https://github.com/suryans77/operating-system/blob/main/client.c): `client.c`
- [TCP Server](https://github.com/suryans77/operating-system/blob/main/server.c): `server.c`
- [Shared Types](https://github.com/suryans77/operating-system/blob/main/headers.h): `headers.h`

### Identity and Accounts

- [Authentication](https://github.com/suryans77/operating-system/blob/main/server.c): `server.c`
- [Administrator Operations](https://github.com/suryans77/operating-system/blob/main/functions.c): `functions.c`

### Academic Workflows

- [Faculty Course Management](https://github.com/suryans77/operating-system/blob/main/functions.c): `functions.c`
- [Student Course Registration](https://github.com/suryans77/operating-system/blob/main/functions.c): `functions.c`

### Persistent Records

- **Account Records**
- **Course Records**
- **Enrollment Records**

### Other components

- **Admin, Faculty, Student**

## Connections

- Admin, Faculty, Student → TCP Client: uses (evidence: `README.md`)
- TCP Client → TCP Server: connects and exchanges (evidence: `client.c`)
- TCP Server → Authentication: authenticates (evidence: `server.c`)
- TCP Server → Administrator Operations: routes admin (evidence: `server.c`)
- TCP Server → Faculty Course Management: routes faculty (evidence: `server.c`)
- TCP Server → Student Course Registration: routes student (evidence: `server.c`)
- TCP Server → Shared Types: uses declarations (evidence: `server.c`)
- Administrator Operations → Account Records: manages
- Faculty Course Management → Course Records: manages (evidence: `functions.c`)
- Student Course Registration → Course Records: reads and updates (evidence: `functions.c`)
- Student Course Registration → Enrollment Records: reads and updates (evidence: `functions.c`)
- Authentication → Account Records: checks credentials (evidence: `server.c`)
