Skip to content

Latest commit

 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

EDU System in C

Language Interface Platforms Status License

A terminal-based educational management system written in C.

EDU System is a simplified university management application that models the main academic workflows of students, faculty members, and educational administrators. It includes authentication, course management, course offerings, enrollment, grading, academic-calendar phases, surveys, and optional LMS features.

Project status: Final and stable course-project release.

Table of Contents

Overview

This project was developed as a Fundamentals of Programming course project. Its purpose is to demonstrate how a relatively complex information system can be implemented in the C programming language using structured programming, file handling, validation, dynamic memory management, and role-based workflows.

The application provides three main workspaces:

  • Administrator Console
  • Faculty Portal
  • Student Portal

The complete user interface runs inside the terminal.

Features

Authentication

  • Separate login flows for students, faculty members, and the administrator
  • Password recovery through predefined security questions
  • Password confirmation when resetting credentials
  • Limited authentication attempts
  • Validation of usernames and account status

Administrator

  • View, search, register, and remove students
  • View, search, register, and remove faculty members
  • Add, search, and remove courses
  • View and search course offerings by semester
  • Add or remove students from an offering
  • Increase offering capacity directly
  • Review faculty requests
  • Approve or reject:
    • new course-offering requests
    • offering-removal requests
    • capacity-increase requests
  • Manage academic-calendar phases:
    • course offering
    • unit selection
    • classes and examinations
    • grade recording
  • Start the next semester after the current semester is completed

Faculty

  • View all personal offerings
  • Browse courses and semester offerings
  • Request a new course offering
  • Request an offering removal
  • Request an increase in course capacity
  • View enrolled students
  • Record grades individually
  • Import grades from a CSV file
  • View course-survey results and statistical summaries
  • Publish and manage homework
  • Publish and manage examinations

Student

  • Browse the course catalog
  • Browse available offerings by semester
  • Search courses and offerings
  • Enroll in eligible offerings
  • Withdraw from offerings
  • View semester report cards
  • View semester GPA and cumulative GPA
  • Complete course surveys after grading
  • View and answer homework
  • View and answer examinations
  • Manage PhD thesis information where applicable

Academic Rules

The system validates several academic conditions, including:

  • active academic-calendar phase
  • offering capacity
  • course prerequisites
  • degree compatibility
  • field and department compatibility
  • duplicate enrollment prevention
  • grade range validation
  • PhD thesis and supervisor restrictions

Technical Highlights

  • Written in C11
  • Single-file implementation
  • Cross-platform terminal handling for Windows and POSIX systems
  • ANSI terminal colors with a plain-text fallback
  • Persistent JSON-based storage
  • Temporary, backup, and transaction-backup files
  • Data validation during startup
  • Recovery from reference and backup files
  • Dynamic enrollment storage to reduce static memory use
  • Transactional CSV grade import
  • Historical offering snapshots for stable report cards
  • Defensive input parsing and range checking
  • Search functions with case-insensitive matching

Requirements

You need:

  • a C11-compatible compiler
  • GCC, Clang, or MinGW-w64
  • a terminal or console
  • write permission in the directory where the program is executed

No third-party library is required.

Getting Started

1. Clone the repository

git clone https://github.com/S-Ali-Sayyadi/EDU_System_C.git
cd EDU_System_C

2. Compile

Linux

gcc -std=c11 -Wall -Wextra -Wpedantic -O2 edu_system.c -o edu_system -lm

macOS

clang -std=c11 -Wall -Wextra -Wpedantic -O2 edu_system.c -o edu_system -lm

Windows with MinGW-w64

gcc -std=c11 -Wall -Wextra -Wpedantic -O2 edu_system.c -o edu_system.exe -lm

3. Run

Linux or macOS

./edu_system

Windows PowerShell

.\edu_system.exe

Windows Command Prompt

edu_system.exe

First Run and Demo Data

When the application starts, it tries to load the previously saved data.

If no valid application data exists, the program automatically creates a sample educational dataset and saves it in the current working directory. This allows the system to be tested immediately after compilation.

For this reason, run the program from a directory in which it is allowed to create and update files.

Demo Accounts

The automatically generated sample data includes the following accounts:

Role Username Password
Administrator admin admin123
Student 404123456 123456
Faculty member FCS105 123456

Additional sample students and faculty members are also generated during the first run.

These credentials are only intended for local demonstration and testing.

Typical Academic Workflow

The main workflow of the system follows these stages:

  1. The administrator starts the course-offering phase.
  2. Faculty members submit requests to offer courses.
  3. The administrator approves or rejects the requests.
  4. The administrator starts the unit-selection phase.
  5. Eligible students enroll in available offerings.
  6. The administrator starts the classes and examinations phase.
  7. Faculty members publish learning activities and examinations.
  8. The administrator starts the grade-recording phase.
  9. Faculty members record student grades.
  10. Students view report cards and submit course surveys.
  11. After all required stages are completed, the administrator starts the next semester.

Some stages may overlap, but their required order is enforced by the application.

Data Storage

The program stores its state in JSON files in the current working directory.

File Purpose
edu_data.json Main combined application state
students.json Student reference data
faculty.json Faculty reference data
courses.json Course reference data
offerings.json Offering and enrollment data
requests.json Academic requests
calendar.json Current semester and calendar phases
edu_bonus.json LMS and bonus-feature data

The program may also create:

  • .tmp files during writes
  • .bak backup files
  • .txn.bak transaction-backup files

Do not manually edit these files while the program is running.

Runtime data files should not be committed to Git because they may contain account information, grades, security answers, and other local test data.

CSV Import Formats

The application supports three CSV-based import operations:

  1. bulk student registration by the administrator
  2. bulk faculty registration by the administrator
  3. bulk grade entry by a faculty member

CSV files must use a comma (,) as the delimiter. The header row is optional, but using the exact headers below is strongly recommended. UTF-8 files are recommended, and a UTF-8 BOM at the start of the file is accepted.

Blank lines are ignored. Every required field must contain a value. When a value contains a comma, a line break, or a double quote, enclose it in double quotes. A double quote inside a quoted value must be written twice.

Example:

"A thesis title, with a comma","A value containing ""quoted text"""

Relative and absolute file paths are accepted when the application asks for the CSV file path.

Bulk Student Registration

Menu path:

Administrator -> Student Management -> Import students from CSV

BSc and MSc students

Use exactly 14 columns in the following order:

first_name,last_name,student_id,national_code,field,entrance_year,section,mentor,department,answer_birth,answer_school,answer_book,answer_bike,password

Example:

first_name,last_name,student_id,national_code,field,entrance_year,section,mentor,department,answer_birth,answer_school,answer_book,answer_bike,password
Arman,Moradi,405700001,9012345678,Computer Engineering,405,BSc,Nima Rahimi,Computer Engineering,Tehran,Danesh School,The Little Prince,Blue,123456
Sara,Karimi,404700002,9234567890,Computer Engineering,404,MSc,Nima Rahimi,Computer Engineering,Isfahan,Farhang School,1984,Black,123456

PhD students

PhD records must use exactly 17 columns. The last three fields are required for the thesis:

first_name,last_name,student_id,national_code,field,entrance_year,section,mentor,department,answer_birth,answer_school,answer_book,answer_bike,password,thesis_title,thesis_abstract,thesis_citations

Example:

first_name,last_name,student_id,national_code,field,entrance_year,section,mentor,department,answer_birth,answer_school,answer_book,answer_bike,password,thesis_title,thesis_abstract,thesis_citations
Roya,Ahmadi,402700003,9345678901,Computer Engineering,402,PhD,Nima Rahimi,Computer Engineering,Shiraz,Shahid Beheshti School,The Alchemist,Green,123456,Secure Academic Systems,"A study of secure, file-based academic systems",0

Student import rules:

  • The number and order of columns must match one of the formats above.
  • student_id must contain digits only.
  • national_code must contain exactly 10 digits.
  • entrance_year must be a positive integer.
  • section is case-sensitive and must be exactly BSc, MSc, or PhD.
  • Student IDs, faculty IDs, and national codes must remain unique across the system.
  • All security-answer fields and the password are required.
  • For a PhD student, mentor must exactly match the full name of an active, already registered faculty member.
  • For a PhD student, thesis_title and thesis_abstract cannot be empty, and thesis_citations must be a non-negative integer.
  • Duplicate or invalid records are skipped and reported after the import.

Import faculty members before importing PhD students so that each PhD mentor can be resolved successfully.

Bulk Faculty Registration

Menu path:

Administrator -> Faculty Management -> Import faculty from CSV

Faculty files must use exactly 13 columns in this order:

first_name,last_name,faculty_id,national_code,field,entrance_year,degree,department,password,answer_birth,answer_school,answer_book,answer_bike

Example:

first_name,last_name,faculty_id,national_code,field,entrance_year,degree,department,password,answer_birth,answer_school,answer_book,answer_bike
Nima,Rahimi,FCS220,8901234567,Computer Engineering,399,PhD,Computer Engineering,123456,Tehran,Danesh School,1984,Black
Maryam,Sadeghi,FEE221,8456789012,Electrical Engineering,398,PhD,Electrical Engineering,123456,Tabriz,Farhang School,The Little Prince,Blue

Faculty import rules:

  • Exactly 13 non-empty fields are required for every record.
  • faculty_id may be alphanumeric.
  • national_code must contain exactly 10 digits.
  • entrance_year must be a positive integer.
  • Faculty IDs, student IDs, and national codes must remain unique across the system.
  • degree, field, and department must not be empty.
  • All security-answer fields and the password are required.
  • Duplicate or invalid records are skipped and reported after the import.

Bulk Grade Import

Menu path:

Faculty -> My Offerings -> Select Offering -> Record Grades -> Import grades from CSV

Grade files use exactly two columns:

student_id,grade

Example:

student_id,grade
404123456,18.25
403234567,16

Grade import rules:

  • student_id must belong to a student enrolled in the selected offering.
  • grade must be a valid number from 0 through 20.
  • The selected offering must belong to the logged-in faculty member.
  • The offering must belong to the current semester.
  • The grade-recording calendar phase must be active.
  • Invalid records and students not enrolled in the offering are skipped and reported.
  • If a student appears more than once, the last valid grade in the file is the value applied.

Recommended Import Order

For a clean data setup, use this order:

1. Import faculty members
2. Import BSc and MSc students
3. Import PhD students
4. Create or approve course offerings
5. Enroll students
6. Import grades during the grade-recording phase

Resetting the Application

Warning: Resetting permanently deletes locally saved application data.

Close the program before deleting any data files.

Linux or macOS

rm -f edu_data.json* students.json* faculty.json* courses.json* \
      offerings.json* requests.json* calendar.json* edu_bonus.json*

Windows PowerShell

Remove-Item edu_data.json*, students.json*, faculty.json*, courses.json*, `
  offerings.json*, requests.json*, calendar.json*, edu_bonus.json* `
  -ErrorAction SilentlyContinue

Run the application again to regenerate the sample dataset.

Troubleshooting

gcc or clang is not recognized

Install a C compiler:

  • Linux: GCC or Clang through the system package manager
  • macOS: Xcode Command Line Tools
  • Windows: MinGW-w64 or MSYS2

Linker errors related to mathematical functions

Make sure -lm is placed at the end of the compile command:

gcc -std=c11 -O2 edu_system.c -o edu_system -lm

The interface has no colors

Use a terminal with ANSI escape-sequence support. The application falls back to plain text when terminal-color support is unavailable.

The program cannot save files

Run it from a directory where your user account has write permission.

The program reports invalid or inconsistent data

Do not overwrite the files immediately. Check the corresponding .bak and .txn.bak files first. If the stored data is not needed, follow the reset instructions above.

The displayed layout is narrow or misaligned

Increase the terminal width and use a monospaced font.

Project Structure

EDU_System_C/
├── .gitignore
├── README.md
└── edu_system.c

The application generates its JSON data and backup files at runtime.

Security and Scope

This application is an educational project, not a production university system.

Important considerations:

  • The default administrator credentials are hardcoded for demonstration.
  • Demo usernames and passwords are publicly documented.
  • Runtime data is stored locally.
  • The application should not be used with real personal or academic data.
  • Production deployment would require stronger authentication, access control, encryption, auditing, database storage, and security review.

Author

Ali Sayyadi

GitHub: S-Ali-Sayyadi

License and Usage

No open-source license has been granted for this repository.

The source code is publicly visible for educational review and portfolio purposes. Public visibility does not make this project open source.

Unless the copyright holder gives prior written permission, no permission is granted to:

  • reproduce or republish the source code
  • modify and redistribute the source code
  • include the source code in another project
  • submit the source code, or substantial parts of it, as academic work
  • sell, sublicense, or commercially distribute the source code

GitHub users may view the repository and use GitHub's built-in forking functionality subject to GitHub's Terms of Service.

For permission requests, contact the repository owner.

Copyright © 2026 Ali Sayyadi. All rights reserved.

About

A terminal-based educational management system written in C.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages