Grade Portal is a console application (TUI) for recording and viewing school marks. Teachers add students and enter grades for different subjects(English, Mathematics, and Science). Students look up their own result card by student id and see those scores.
Data is stored in PostgreSQL and mapped with Hibernate (JPA): a student has many mark rows. The code is split into a text menu, a service layer, and a repository that talks to the database.
- A teacher creates a student, adds subject scores, and saves. Hibernate assigns a numeric student id.
- A student enters that id and the app prints their marks (a result card).
- Student — one row in
students: generatedidandname. Holds a list of marks. - Marks — one row in
marksper subject for a student:score,subject, andstudent_id(foreign key tostudents). - Subjects — not a table. An enum (
ENGLISH,MATHEMATICS,SCIENCE) stored as text on each marks row.
One student has many marks. Saving a student also saves their marks.
- JDK 25
- Maven 3.8+
- PostgreSQL (this project was written against PostgreSQL 18; recent 16+ should work)
git clone https://github.com/abswoof/Grade-Portal.git
cd Grade-PortalConnection URL, username, and password are not in git. After clone, copy the example file and edit it:
copy src\main\resources\hibernate-local.cfg.xml.example src\main\resources\hibernate-local.cfg.xmlOn macOS/Linux:
cp src/main/resources/hibernate-local.cfg.xml.example src/main/resources/hibernate-local.cfg.xmlFill in every connection property in that file:
hibernate.connection.url— JDBC URL, including your database name, e.g.jdbc:postgresql://localhost:5432/your_databasehibernate.connection.usernamehibernate.connection.password
The database must already exist in PostgreSQL. Hibernate uses hbm2ddl.auto=update, so it will create or update the students and marks tables on first run. It will not create the database itself.
mvn compile exec:javaDo not run java -cp target/classes ... — Hibernate and the JDBC driver will be missing from the classpath.
- Teacher — enter a student name, then subjects (
English,Mathematics,Science) and scores (0–100). Typedoneto save that student,quitto return to the main menu. After a successful save, note the generated student id. - Student — enter that id to print a result card (subject and score). An empty result means no marks for that id (unknown id or no scores yet).
- Quit — close the Hibernate factory and exit.
src/main/java/com/abswoof/
Main.java # entry point
ui/TextInterface.java # menus and input
services/StudentService.java
repository/Database.java # Hibernate sessions
entity/ # Student, Marks, Subjects
src/main/resources/
hibernate.cfg.xml # Hibernate settings
hibernate-local.cfg.xml.example # Database credentials (example)