Skip to content

Latest commit

 

History

History
126 lines (89 loc) · 5.06 KB

File metadata and controls

126 lines (89 loc) · 5.06 KB

Java Backend Developer Training – Reference Implementation

📌 This repository contains the reference implementation of the application developed step-by-step during the Java Backend Developer Training.
Each subsequent branch adds more functionality on top of the previous one, allowing participants to explore and compare their solutions.

📖 Project Overview

This is a Spring Boot 3 backend application named Appointment Booking System, created as part of hands-on backend development training.
It follows modern architectural and coding practices, including clean code, layered structure, and modular design.

📄 Specification: AppointmentBookingAppDoc.md

🌱 Branch Progression

The repository grows in complexity and functionality across branches:

Branch Description
main Base Spring Boot setup with basic health endpoints
feature/1-create-new-application (Almost) same as main
feature/2-dataaccess Persistence layer with Spring Data JPA and H2, part 1
feature/2-dataaccess-repositories Persistence layer with Spring Data JPA and H2, part 2
feature/3-business-logic Service layer and business logic introduced
feature/4-services OpenAPI/Swagger setup for live API documentation and testing
feature/5-security Spring Security integration for basic authentication and authorization

🌐 Useful Endpoints

After starting the application, you can access the following in your browser:

URL Available from Description
http://localhost:8080/actuator/health main Basic application health check
http://localhost:8080/h2-console feature/2-dataaccess In-memory H2 database console
http://localhost:8080/swagger-ui/index.html feature/4-services OpenAPI UI for testing and exploring REST API

🛠 Tech Stack

  • Java 21
  • Spring Boot 3
  • Maven 3.9+
  • JUnit 5 & AssertJ
  • H2 Database
  • OpenAPI & Swagger UI
  • Spring Security
  • GitHub Actions for CI/CD

📁 Project Structure

java-backend-developer-app/
├── .github/workflows/ci.yml    # CI/CD pipeline configuration
├── .mvn/                       
│   │   ├── wrapper/maven-wrapper.properties  # Maven wrapper properties
│   │   ├── maven.config                      # Maven configuration options
│   │   └── settings.xml                      # Custom Maven settings
├── api/openapi.yml             # OpenAPI specification for API documentation
├── src/
│   ├── main/
│   │   ├── java/com/example/   # Application source code
│   │   └── resources/          # Configuration files (e.g., application.yml, templates)
│   ├── test/
│   │   ├── java/com/example/   # Unit and integration tests
│   │   └── resources/          # Test-related configurations and test data
├── pom.xml                     # Maven project configuration and dependencies
└── README.md                   # Project documentation

🚀 Getting Started

✅ Prerequisites

Ensure you have the following installed:

  • JDK 21
  • Maven 3.9+
  • Git

🔧 Build and Run

To build the project, run:

mvn clean install

To start the application:

mvn spring-boot:run

🧪 Testing

Run all tests with:

mvn test

🔄 CI/CD Pipeline

GitHub Actions is used for CI/CD, configured in `.github/workflows/ci.yml`. The pipeline executes on:

  • Every push and pull request to `main` and feature branches.
  • Runs tests and generates reports.

🙋 Who Is This For?

This reference repo is intended for trainers and mentors to demonstrate completed solutions. 🧑‍💻 Each training participant works independently in a separate student repository. This repository serves as a working example.

🤝 Contribution Guidelines

  1. Create a feature branch for any changes from a particular, possibly smallest "main" feature branch, e.g. 'feature/2-data-access'.
  2. Ensure the code follows project conventions and is properly tested.
  3. Open a Pull Request to particular, corresponding "main" feature branch, e.g. 'feature/2-data-access'. Direct pushes are restricted.
  4. Wait for CI to pass and a review before merging.
  5. Rebase higher feature branches onto changed one, e.g. if you merged to 'feature/3-business-logic', then you should rebase 'feature/4-services' and 'feature/5-security' to have your changes there as well.

License

This project is licensed under the terms of the GNU General Public License v3.0.
See the LICENSE file for details.