Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rajmalpankaj786/swiggy_application

Swiggy is a leading food delivery app, connecting users with a diverse range of restaurants. With a user-friendly interface, it offers quick and convenient ordering, real-time tracking, and secure payments. Swiggy ensures a seamless food delivery experience, making it a go-to platform for satisfying culinary cravings with speed and reliability.
https://github.com/rajmalpankaj786/swiggy_application

hibernate-jpa java javascript logging maven mysql-database spring-boot swagger-ui

Last synced: about 3 hours ago
JSON representation

Swiggy is a leading food delivery app, connecting users with a diverse range of restaurants. With a user-friendly interface, it offers quick and convenient ordering, real-time tracking, and secure payments. Swiggy ensures a seamless food delivery experience, making it a go-to platform for satisfying culinary cravings with speed and reliability.

Awesome Lists containing this project

README

        

# swiggy_Application
# Swagger Ui Representation
## Controller
![controller](readmepng/swgger.png.png)
(readmepng/swgger.png.png)
Additional Features
Pagination and Sorting: For GET APIs that may return a large amount of data, implement pagination to allow fetching the data in chunks rather than all at once. This can be done by adding query parameters to the API to indicate the page number and page size. Also, add sorting functionality so that the data can be ordered by specific fields. This can improve the user experience and efficiency of the application.
Logging: Use a logging framework like Logback or SLF4J to record important events that occur during the execution of the application. This can include data-related operations, errors, or other significant occurrences. Logging is crucial for debugging and monitoring the application's health.
Swagger Documentation: Implement Swagger, a tool for documenting RESTful APIs. This includes listing all endpoints, showing input/output models, and allowing users to try out the APIs directly from the browser. Swagger provides a user-friendly interface and is a great way to ensure your API is well-documented and easy to use.
Develop a robust Spring Boot application to manage a food delivery system like Swiggy, which incorporates Restaurants, Customers, Orders, and Delivery Partners. The application should support the following operations:

Add new Restaurants, Customers, and Delivery Partners
Place an order from a Customer to a Restaurant
Assign a Delivery Partner to an Order
Update the order status (e.g., cooking, on the way, delivered)
Fetch a Customer's order history
Entity Classes
Restaurant: The Restaurant entity should have a unique restaurantId, name, and address.
Customer: The Customer entity should have a unique customerId, name, email, and address.
Order: The Order entity should have a unique orderId, customerId, restaurantId, deliveryPartnerId (nullable), items (a list of menu items), and orderStatus.
DeliveryPartner: The DeliveryPartner entity should have a unique deliveryPartnerId, name, and phone number.
Backend Requirements
Implement a method to add new Restaurants, Customers, and Delivery Partners to the system. Use JPA to establish relationships between these entities. Exception handling and data validation should be used to ensure that the provided data is complete and valid (e.g., email format, non-empty fields, etc.).
Implement a method for a Customer to place an order to a specific Restaurant. Validate the customerId and restaurantId, and handle the case where either of them does not exist.
Implement a method to assign a Delivery Partner to an existing Order. Validate the deliveryPartnerId and orderId, and handle the case where either of them does not exist. Also, handle the case where the order is already assigned to another Delivery Partner or has been delivered.
Implement a method to update the order status (e.g., cooking, on the way, delivered). Validate the orderId and handle the case where the orderId does not exist. Use exception handling to manage invalid order status transitions (e.g., from "delivered" back to "preparing").
Implement a method to fetch a Customer's order history based on their customerId. Handle the case where the customerId does not exist.
Frontend Requirements
Develop a basic frontend interface using HTML, CSS, and JavaScript for interaction with some of the application's APIs. This should include:

User-friendly forms for adding new Restaurants, Customers, and Delivery Partners, placing orders, and assigning delivery partners to orders. The form data should be sent to the backend via requests.
An interface to display the status of an order and allow status updates. The status updates should be sent to the backend when initiated by the user.
A page to display a customer's order history. This page should send a GET request to the backend and display the fetched data.
Exception Handling and Data Validation
Create custom exception classes (e.g., InvalidEmailException, NotFoundException) to manage specific validation and exception cases, and return suitable error messages to the frontend.
In the controller class, use appropriate HTTP status codes for error handling. For example, use the @ResponseStatus annotation to map specific exceptions to HTTP status codes, such as 400 Bad Request for invalid input and 404 Not Found for non-existent resources.
Implement input validation on both the backend (using Java) and the frontend (using JavaScript) to ensure the user provides correct and consistent data. For example, check if the email is in a valid format and if the required fields are not empty on the frontend before sending to the backend.
Handle backend validation errors (Java) by displaying error messages received from the backend on the frontend. This can be done by using JavaScript to parse the error message and display it to the user in a user-friendly format.
In this problem, you will be working with a food delivery schema involving Restaurants, Customers, Orders, and Delivery Partners. You will design a Swiggy-like application, properly handling exceptions and validating user input while implementing JPA for managing relationships among entities.