A modular C++ application connected to a MySQL database, designed to manage student records, course enrollments, and academic performance. The system supports user authentication (admin/student), GPA calculation, and role-based access to academic data.
- Role-Based Login (Admin / Student)
- Student Management: Add and view students
- Course Management: Add and list courses with credit weightage
- Enrollments: Enroll students in courses with marks
- GPA Calculation: Weighted GPA based on course credits and marks
- MySQL Database with structured relationships
- OOP Principles: Modular C++ code using classes
- Secure DB Configuration using external file
- C++ (OOP, STL)
- MySQL (Relational DB)
- MySQL Connector/C++
- Command-line Interface
- Modular Source Structure (Headers + Source Files)
├── src/
│ ├── main.cpp
│ ├── User.h / .cpp
│ ├── Student.h / .cpp
│ ├── Course.h / .cpp
│ ├── Enrollment.h / .cpp
│ ├── GPAEngine.h / .cpp
│ ├── Menu.h / .cpp
│ ├── ConfigLoader.h
│ ├── Database.h / .cpp
├── db_config.txt ← 🔐 Not included in GitHub
├── README.md
├── .gitignore
└── Makefile / CMakeLists.txt (optional)
-
Windows: Download
-
Linux (Debian):
sudo apt install libmysqlcppconn-dev
CREATE DATABASE StudentDB;
USE StudentDB;
CREATE TABLE Users (
user_id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(50) UNIQUE,
password VARCHAR(255),
role ENUM('admin', 'student')
);
CREATE TABLE Students (
student_id INT PRIMARY KEY,
name VARCHAR(100),
age INT,
email VARCHAR(100),
user_id INT,
FOREIGN KEY (user_id) REFERENCES Users(user_id)
);
CREATE TABLE Courses (
course_id INT PRIMARY KEY,
course_name VARCHAR(100),
credits INT
);
CREATE TABLE Enrollments (
student_id INT,
course_id INT,
marks FLOAT,
PRIMARY KEY (student_id, course_id),
FOREIGN KEY (student_id) REFERENCES Students(student_id),
FOREIGN KEY (course_id) REFERENCES Courses(course_id)
);This file should NOT be pushed to GitHub. Add it to
.gitignore.
host=127.0.0.1
user=root
password=yourpassword
database=StudentDBINSERT INTO Users (username, password, role) VALUES
('admin1', 'adminpass', 'admin'),
('student1', 'studpass', 'student');Using g++:
g++ -std=c++17 src/*.cpp -o student_sys -lmysqlcppconn
./student_sysOr use Makefile / CMakeLists.txt if available.
-
Admin
- Username:
admin1 - Password:
adminpass
- Username:
-
Student
- Username:
student1 - Password:
studpass
- Username: