Eatery Backend project is a Spring Boot-based backend designed to serve as the core application layer for managing customer eatery reservations, its data persistence, API services and notification about changes in their reservation status. It is built following modern architectural patterns such as RESTful services, MVC, Factory, Strategy, Command, and Memento pattern to ensure scalability, maintainability, and ease of testing.
The backend integrates with an H2 and PostgreSQL database through JPA for data persistence, and Spring Data for simplifying data access.
- REST API: Provides a set of RESTful endpoints for interacting with the backend services.
- Spring Data JPA: ORM-based database interaction with support for various relational databases (PostgreSQL, H2).
- Notification: Sending of notification using Twilio Java API.
- Logging: Integrated logging using SLF4J with Logback.
- Test Coverage: Integration tests using SpringBoot tests and JUnit.
- API Documentation: Auto-generated API documentation using Swagger (SpringDoc OpenAPI).
- Java 21+
- Maven as build tool
- Clone the repository
- Build the project with Maven
- Package the project with Maven
mvn -B package --file pom.xml
The application can be run locally with H2 database or PostgreSQL database:
- Run with H2 database without Twilio Notification using
application-local.yml
mvn spring-boot:run -Dspring-boot.run.profiles=local
- Run with PostgreSQL with Twilio Notification using
application.yml
- Install Docker Desktop, Docker CLI and Docker Compose
- Start PostgreSQL and pgAdmin docker containers
cd postgresql
docker compose up
- Open pgAdmin http://localhost:15433 and log in using the email and password specified in
docker-compose.yml. - Click on “Add New Server” under the “Quick Links” section.
- In the “General” tab, enter a name for the server.
- In the “Connection” tab, use the following details:
Host name/address: postgres
Username: The user specified in docker-compose.yml file
Password: The password specified in the docker-compose.yml file
- Click “Save” to add the server
- Register Twilio account to get account id, token and phone number
- Put your Twilio account id, token & phone number and enable notification in
application.yml - Run application
mvn spring-boot:run
- Check all the data stored in PostgreSQL database at
{serverName} -> Schemas -> public -> Tables - Once you finish running the application, do not forget to shutdown PostgreSQL & pgAdmin container
cd postgresql
docker compose down
mvn test
- Fork the repository.
- Create a feature branch
git checkout -b feature-branch. - Commit your changes
git commit -m 'Add new feature'. - Push to the branch
git push origin feature-branch. - Create a Pull Request.