Adam Głowacki Jan Sarba
A comprehensive web application for managing a basketball league. The system allows for full CRUD management of teams, players, and seasons. It features game scheduling, live game statistics tracking, and automatically updated league standings.
- Team & Player Management: Full CRUD operations for teams and players, including player details like position, physical attributes, and team assignment.
- Season & Game Scheduling: Create seasons and schedule games between teams.
- Live Game Statistics: An interactive interface to track and update player statistics (points, rebounds, assists, etc.) in real-time during an active game.
- Dynamic Standings: League standings are automatically calculated and displayed, updating after each completed game.
- Player Career Tracking: View a player's statistics and team history across multiple seasons.
- Data Integrity: Robust validation and database constraints to ensure logical and consistent data (e.g., a team cannot play against itself).
- Backend: Java 21, Spring Boot 3, Spring MVC, Spring Data JPA
- Database: Oracle Database (with Oracle JDBC Driver)
- ORM: Hibernate
- Frontend: Thymeleaf, Bootstrap 5
- Build Tool: Maven
- Validation: Jakarta Bean Validation (used for entity and request validation)
This project demonstrates several key software engineering principles and modern development practices:
- Layered MVC Architecture: A clear separation of concerns with a well-defined structure:
@Controllerfor handling web requests and UI interaction.@Servicefor encapsulating all business logic.@Repository(Spring Data JPA) for the data access layer.
- Optimistic Locking: The use of
@Versionon entities (likePlayerandGame) to prevent data corruption from concurrent updates. The application gracefully handlesObjectOptimisticLockingFailureExceptionto inform the user about the conflict. - Transactional Integrity:
@Transactionalannotation is used on service methods to ensure that complex operations (e.g., finishing a game and updating two team records) are atomic. If any part of the operation fails, the entire transaction is rolled back, maintaining data consistency. - Advanced JPA/Hibernate Mappings:
- Effective use of relationships (
@ManyToOne,@OneToMany) with proper cascade types (CascadeType.REMOVE). - Database-level constraints using Hibernate's
@Checkannotation to enforce business rules directly in the DDL (e.g.,HOME_TEAM_ID != AWAY_TEAM_ID). - Composite keys implemented via a separate ID class (
PlayerStatsViewId) for views or complex join tables. - Custom Oracle
SequenceGeneratorfor primary key generation.
- Effective use of relationships (
- Modular Frontend with Thymeleaf: The user interface is built with reusable components using Thymeleaf Fragments (
th:replace,th:fragment), leading to clean and maintainable HTML code. - Complex Business Logic in Services: The service layer contains non-trivial logic, such as:
- Dynamically creating
GameStatsentries when a game starts. - Calculating game winners and updating team records upon game completion.
- Reversing team record changes when a game is deleted.
- Managing player team history when a player is reassigned.
- Dynamically creating
- Configure Database: Ensure you have an Oracle Database instance running. Update the connection details in
application.properties. - Build the Project:
mvn clean install
- Run the Application:
mvn spring-boot:run
- The application will be available at
http://localhost:8080.


