This is a Spring Boot application integrated with PostgreSQL, designed to manage restaurant-related functionalities. The project supports features such as user registration, authentication, feedback management, and password recovery.
The Restro Mini Project is aimed at providing a backend service for restaurant management. It offers various functionalities including:
- User Registration: Allows users to sign up with a unique email, username, and phone number.
- User Authentication: Supports secure login functionality.
- Feedback System: Collects and stores feedback for both the site and specific restaurants.
- Forgot Password: Users can reset their passwords through an email verification process.
- User registration
- User login
- Password reset (not implemented)
- Restaurant registration
- Restaurant details update
- Restaurant deletion
- Retrieve all restaurant details
- Submit site feedback
- Submit restaurant feedback
- Retrieve all site feedback
- Retrieve all restaurant feedback
- Swagger UI integration
This project requires Java, Maven, and a PostgreSQL database.
Prerequisites:
- Java 21
- Maven
- PostgreSQL
Steps:
-
Clone the repository:
git clone https://github.com/Shevadesuyash/Spring-Boot-practice.git cd Spring-Boot-practice
-
Configure your PostgreSQL database settings in the appropriate application-*.yml file located under src/main/resources (dev, prod, or uat).
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
Running Application:
Once running, access these endpoints:
- User Registration:
POST /users/register
- Body: User registration details (model:
UserRegistrationRequest
)
- Body: User registration details (model:
- User Login:
POST /users/login
- Body: User login credentials (model:
LoginRequest
)
- Body: User login credentials (model:
- Get User Details:
GET /users/details
- Forgot Password:
POST /users/forgot-password
- Body: User credentials for password reset (model:
ForgotPassword
)
- Body: User credentials for password reset (model:
- Submit Site Feedback:
POST /feedback/site_feedback
- Body: Site feedback details (model:
FeedbackSiteRequest
)
- Body: Site feedback details (model:
- Submit Restaurant Feedback:
POST /feedback/restro_feedback
- Body: Restaurant feedback details (model:
FeedbackRestroRequest
)
- Body: Restaurant feedback details (model:
- Get All Restaurant Feedback:
GET /feedback/feedback-restro
- Get All Site Feedback:
GET /feedback/feedback-site
- Delete Restaurant:
DELETE /restro/delete
- Body: Restaurant ID (model:
DeleteRequest
)
- Body: Restaurant ID (model:
- Update Restaurant Details:
PUT /restro/updateDetails
- Body: Updated restaurant details (model:
RestroOnlineRequestUpdate
)
- Body: Updated restaurant details (model:
- Add New Restaurant:
POST /restro/addNew
- Body: New restaurant details (model:
RestroOnlineRequest
)
- Body: New restaurant details (model:
- Get All Restaurant Details:
GET /restro/allRestro
Note: This is a basic overview of the endpoints. Refer to the project documentation for detailed information about request and response structures, error handling, and additional features.
- Application configuration is handled via YAML files for different environments (dev, prod, uat) located under
src/main/resources
. - Swagger configuration is handled through the
AppConfig
class for API documentation.
- Spring Boot Starter Data JPA (database interactions)
- Spring Boot Starter Web (web application building)
- Lombok (reduced boilerplate code)
- PostgreSQL (database)
- Springdoc OpenAPI (Swagger integration)
I have created a Docker image for this project, allowing anyone to run the application without the need for manual setup.
This project provides a convenient Docker image for simplified deployment and execution without extensive manual setup.
Image Details:
- Name:
suyash30/restro-mini-project
- Version:
1.2
(Replace with the actual version) - Repository: Docker Hub
Prerequisites:
- Docker: Ensure Docker is installed on your system. Refer to the official documentation for installation instructions: https://docs.docker.com/engine/install/
- Docker Compose: Install Docker Compose for streamlined multi-container management: https://docs.docker.com/compose/install/
Follow the steps below to run the application using Docker:
docker pull suyash30/restro-mini-project:1.3 # Replace with the actual version
a. Create a directory for PostgreSQL data and navigate to it:
mkdir -p /path/to/your/project/postgres_data # Replace with your desired location
b. Create a docker-compose.yml
File
Create a file named docker-compose.yml
in your working directory. You can use the following sample configuration as a starting point, customizing it as needed:
version: '3.8'
services:
db:
image: postgres
environment:
POSTGRES_USER: myuser # Replace with your desired username
POSTGRES_PASSWORD: mypassword # Replace with your desired password
POSTGRES_DB: mydb # Replace with your desired database name
ports:
- "5432:5432" # Map the container port to your host machine port (5432 is the default)
volumes:
- "/path/to/your/project/postgres_data:/var/lib/postgresql/data" # Adjust the path for persistent data storage
app:
image: suyash30/restro-mini-project:1.3 # Replace with the actual version
environment:
SPRING_PROFILES_ACTIVE: uat # Adjust the environment profile if needed
# Update the following environment variables according to your database configuration
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/mydb
SPRING_DATASOURCE_USERNAME: myuser
SPRING_DATASOURCE_PASSWORD: mypassword
ports:
- "8080:8081" # Map the container port (8081) to your desired host machine port (8080)
depends_on:
- db
c. Start the Services:
docker-compose up
- Database Connection Issues: Ensure the PostgreSQL service is running and accessible.
- Permissions Issues: Verify that the PostgreSQL data directory is writable by Docker.
- Port Conflicts: If the default ports are in use, modify the ports in the docker-compose.yml file.
For a detailed setup guide and additional information, refer to the full documentation.
For support or questions, please reach out to the project maintainer via Docker Hub or through the following contact details:
- Email: [email protected]
- LinkedIn: Suyash Shevade
- GitHub: Shevadesuyash
- Instagram shevadesuyash30
This project is maintained by Suyash Shevade.