Skip to content

About

A TUI for recording and viewing school marks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Grade Portal

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.

Basic workflow

  1. A teacher creates a student, adds subject scores, and saves. Hibernate assigns a numeric student id.
  2. A student enters that id and the app prints their marks (a result card).

Entities

  • Student — one row in students: generated id and name. Holds a list of marks.
  • Marks — one row in marks per subject for a student: score, subject, and student_id (foreign key to students).
  • 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.

Requirements

  • JDK 25
  • Maven 3.8+
  • PostgreSQL (this project was written against PostgreSQL 18; recent 16+ should work)

Clone and setup

git clone https://github.com/abswoof/Grade-Portal.git
cd Grade-Portal

Local database config (required)

Connection 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.xml

On macOS/Linux:

cp src/main/resources/hibernate-local.cfg.xml.example src/main/resources/hibernate-local.cfg.xml

Fill in every connection property in that file:

  • hibernate.connection.url — JDBC URL, including your database name, e.g. jdbc:postgresql://localhost:5432/your_database
  • hibernate.connection.username
  • hibernate.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.

Run

mvn compile exec:java

Do not run java -cp target/classes ... — Hibernate and the JDBC driver will be missing from the classpath.

How to use

  1. Teacher — enter a student name, then subjects (English, Mathematics, Science) and scores (0–100). Type done to save that student, quit to return to the main menu. After a successful save, note the generated student id.
  2. 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).
  3. Quit — close the Hibernate factory and exit.

Project layout

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)

About

A TUI for recording and viewing school marks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages