This console application is designed to ease the routine of everyday school administration.
One can maintain student records, student assignments to groups, and course enrollments easily in one place.
Moreover, the system provides an easy search and filtering of information, hence making data management easier.
- Student Management: Helps to make CRUD operations on students.
- Groups & Courses: They are responsible for handling groups and courses.
- Data Filtering: Searching for groups by student number and filtering students by course name.
- Stack: Spring Boot 3.x, Spring Data JPA (Hibernate), Flyway, PostgreSQL, Testcontainers.
- Architecture: Migrate from manual dependency management to Spring IoC container.
It has Spring Boot for auto-configuration. that helps to enable autocinfigurations, component scanning and configuration annotations
- Main: The
@SpringBootApplicationannotation that helps to enable autocinfigurations, component scanning and configuration annotations - Runners (
StartupRunner,FacadeRunner): ImplementCommandLineRunnerin order to run logic (migrations, data seeding, menu) rwhen context has already started.
- Flyway: tool that helps to update a database from one version to the next using migrations.
- Entities: The
@Entityand@Tableannotations map Java classes to database tables, enabling JPA/Hibernate to handle Object-Relational Mapping (ORM) automatically. The@Idand@GeneratedValueannotations are used to manage the primary key on the database side. - JPA DAOs: Use
EntityManagerand@Repositoryfor Object-Relational Mapping (ORM) to remove dependence on hard-coded queries.
- Spring IoC: Classes annotated with
@Serviceor@Componentare treated as "beans" by Spring. - Constructor Injection: Spring automatically injects the dependencies into the constructor of the classes.
This promotes testability and immutable objects. - SchoolDataFacade: Orchestrates generators and services, encapsulating complex business logic from the UI layer.
- Generators: These are special components responsible for automatically populating students, groups, and enrollments randomly in the database during initial runtime.
- Real DB Testing: Spins up a real PostgreSQL in a Docker container at test time for environment parity.
- @ServiceConnection: Automatically configures Spring Boot connection details for the containerised database.
- JUnit 5 & Mockito: Used for unit testing business logic and verifying component interactions.
- HikariCP: The default connection pool library, automatically included via spring-boot-starter-data-jpa.
- @DataJpaTest: Provides a specialized environment for fast, isolated testing of the persistence layer.
- application.yaml: Central configuration for database connection, logging, and Hibernate settings.
- db/migration: Versioned SQL migration scripts managed by Flyway.