██╗ ██╗███╗ ██╗██╗ ██████╗ ██████╗ ████████╗██╗ ██████╗███████╗
██║ ██║████╗ ██║██║ ██╔══██╗██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
██║ ██║██╔██╗ ██║██║█████╗██████╔╝██║ ██║ ██║ ██║██║ ███████╗
██║ ██║██║╚██╗██║██║╚════╝██╔══██╗██║ ██║ ██║ ██║██║ ╚════██║
╚██████╔╝██║ ╚████║██║ ██████╔╝╚██████╔╝ ██║ ██║╚██████╗███████║
╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
A console-based university management system built in Java. Supports three roles (admin, professor, student), course enrollment, grading, notifications, messaging, a rule-based chatbot, and data export.
| Area | What it does |
|---|---|
| Auth | PBKDF2+salt password hashing, role-based login |
| Users | Create, edit, delete, search users across all roles |
| Courses | Add courses, assign professors, search by code or name |
| Enrollment | Students enroll in courses; duplicate enrollment blocked at DB level |
| Grading | Professors submit grades per enrollment (A–F with +/−) |
| Notifications | Send to one user or broadcast to all; mark read, delete |
| Messaging | Send a subject+body message to any user |
| Chatbot | Rule-based assistant — enroll by code, view grades, grade distribution, professor lookup |
| Export | Dump users/courses/enrollments to a timestamped .txt file under ~/university_exports/ |
| Connection pool | HikariCP with prepared-statement cache |
You need three things installed before you build:
- JDK 17+ — Adoptium / Eclipse Temurin is the easiest pick
- Apache Maven 3.6+ — maven.apache.org
- MySQL 8.x — easiest via XAMPP (see below) or a standalone install
- Download XAMPP from apachefriends.org
- Install and open the XAMPP Control Panel
- Click Start next to MySQL
- Open phpMyAdmin (button in the panel) and create a database:
CREATE DATABASE university;Default XAMPP credentials: user root, no password. That matches the defaults in config.properties — nothing to change.
Install MySQL, then:
CREATE DATABASE university;Update src/main/resources/config.properties with your credentials (see Configuration below).
git clone https://github.com/your-username/university-management.git
cd university-managementEdit src/main/resources/config.properties:
db.url=jdbc:mysql://localhost:3306/university
db.user=root
db.password= # leave blank for XAMPP default, or fill yours in
db.pool.size=10You can also set environment variables instead if you prefer not to touch the file:
DB_URL DB_USER DB_PASSWORD
mvn compileTables are created automatically on first run — no need to run the .sql file manually.
mvn exec:javamvn package
java -jar target/university-management-1.0-SNAPSHOT-jar-with-dependencies.jarThe fat jar bundles MySQL connector and HikariCP, so the only requirement on the target machine is JDK 17+ and a running MySQL instance.
| Username | Password | Role |
|---|---|---|
admin |
admin123 |
Administrator |
The admin account is seeded automatically if no admin exists in the database. Change the password after first login via Manage Users → Edit User.
src/main/java/com/university/
├── Main.java
├── config/ Database connection (HikariCP) + table initializer
├── model/ Plain POJOs: User, Course, Enrollment, Notification, Message
├── dao/ All SQL lives here, prepared statements only
├── service/ Business logic layer
├── security/ PBKDF2 password hashing, input validation
├── ui/ Console menus per role + shared helpers
├── util/ File exporter, logger wrapper
└── datastructures/ Custom ArrayList, LinkedList, Queue, Stack (coursework)
The chatbot accepts natural-language-ish input. Type help inside it for the full list.
enroll me in CS101
show my grades
my courses
show grade distribution for CS101
what courses does Smith teach
list students with grades below C in CS101
assign Dr Smith to course CS101 (admin only)
help
exit
Exports land in ~/university_exports/<role>/ as timestamped .txt files. Available for all three roles; students only see their own enrollment data.
| What | Why |
|---|---|
| Java 17 | LTS, records and sealed classes available if needed later |
| Maven | Standard build tool, reproducible builds |
| MySQL 8 | FK constraints, ENUM type, ON DELETE CASCADE all handled at the DB layer |
| HikariCP 5 | Fastest JDBC pool available; prepared-statement cache baked in |
| PBKDF2WithHmacSHA256 | JDK stdlib crypto, no extra dependency needed |
-
Layered architecture in practice. Splitting one large file into dao / service / ui layers made each piece individually testable and easy to read. The DAO layer being the single place all SQL lives meant fixing a query fixed it everywhere.
-
Connection pooling matters even locally. Swapping raw
DriverManager.getConnection()for HikariCP removed per-query connection overhead and made the app noticeably snappier during bulk operations like "send to all users." -
Push constraints to the database. Duplicate enrollment prevention started as an
if (exists) return falsecheck in Java. TheUNIQUE KEY unique_enrollmentconstraint in the schema means the database enforces it even if the application code has a bug or two concurrent requests slip through. -
PBKDF2 over MD5/SHA. Storing a simple SHA-256 hash is breakable with a rainbow table in seconds. PBKDF2 with a random salt and 65536 iterations makes offline brute-force attacks genuinely expensive, and the entire thing is in the JDK standard library.
-
Custom data structures vs stdlib. Writing
MyArrayList,MyLinkedList,MyQueue, andMyStackfrom scratch was useful for understanding what those structures are doing under the hood. In production code you would always usejava.util— the JDK implementations are battle-tested and handle edge cases that hand-rolled versions typically miss. -
Config over hardcoding. Putting DB credentials in
config.propertieswith environment variable overrides means the same jar can be pointed at a dev, staging, or production database without a recompile. -
Reading before writing. Every bug I chased came from touching a function without first tracing all its callers. The fix was always smaller and in a more central place than the symptom suggested.
MIT