A clean, modern Spring Boot web app that allows users to find the top 10 restaurants by UK postcode.
Built with Clean Architecture, SOLID principles, Thymeleaf UI, and fully Dockerized for production-readiness.
- Search first 10 restaurants by postcode
- Beautiful UI with TailwindCSS + Thymeleaf
- Clickable embedded Google Maps
- REST API + optional Swagger docs
- Docker-ready
- Domain Layer: Pure business logic & model (
Restaurant) - Use Case Layer: Application logic (
RestaurantService) - Infrastructure Layer: API client for Just Eat API (
RestaurantApiClient) - Presentation Layer: REST + Thymeleaf controllers
- Single Responsibility: Layers and classes have clear roles
- Open/Closed: Easy to add new data sources without modifying existing logic
- Liskov Substitution: Swap/mock
RestaurantDataProviderin tests - Interface Segregation: Small, focused domain interfaces
- Dependency Inversion: Use case depends on abstraction, not API client
restaurant-finder/
├── controller/ # REST + Thymeleaf controllers
├── usecase/ # Business logic layer
├── domain/ # Core domain model & interfaces
├── infrastructure/ # API call logic (Just Eat)
├── config/ # WebClient config
├── templates/ # Thymeleaf views (HTML)
├── Dockerfile # For containerization
├── build.gradle # Gradle config
└── README.md # This file
./gradlew bootRunThen open: http://localhost:8080
docker pull arc007arnob/restaurant-finder
docker run -p 8080:8080 arc007arnob/restaurant-finderNo need for Java or setup — just pull and run.
./gradlew testIncludes:
- Unit tests for business logic
- Mockito usage for data provider mocking
| Method | Endpoint | Description |
|---|---|---|
| GET | /restaurants |
Get top 10 restaurants |
| GET | /view?postcode=... |
Web UI for postcode search |
Swagger UI (if enabled): http://localhost:8080/swagger-ui/index.html
This project includes a GitHub Actions workflow that:
- Builds the project with Gradle
- Runs unit tests
- Builds and pushes a Docker image to Docker Hub (
arc007arnob/restaurant-finder)
See .github/workflows/ci.yml for the pipeline config.
- Consistent API Response:
- It is assumed that the Just Eat API consistently returns complete and valid data for each request. This includes essential fields such as restaurant name, rating, cuisines, and address.
- Abstracted Data Source:
- Since the data source may evolve over time (e.g., switching from Just Eat to a different provider), the system is designed with Dependency Injection to ensure flexibility and ease of integration with new data providers.
- Backend-Centric Architecture:
- The responsibility of processing, validating, and preparing data for display lies with the backend. This assumption enables a clean separation of concerns and ensures that the frontend remains lightweight, relying on the backend to provide robust and reliable data structures for frontend.
- Add exception handling
- Add client-side interactivity (Vue)
- Add caching layer (e.g., Redis)
- Add Database Support
Made by Arnob Chowdhury
- GitHub Copilot for autocompletion and boilerplate generation
- ChatGPT for debugging and UI suggestions