The NexusFood API is the backbone of a sophisticated food delivery system designed to streamline and enhance the food ordering and delivery experience. Built with Spring Boot, this API serves as the communication bridge between various components within the food delivery ecosystem.
At its core, the NexusFood API provides a comprehensive set of endpoints and functionalities that enable seamless interaction between users, restaurants, delivery personnel, and admin involved in the food delivery system.
Key features of the NexusFood API include:
- Order Management: Users can browse menus, place orders, and track the status of their deliveries.
- Restaurant Integration: Allows sellers to manage menus, update item availability, and receive/fulfill orders efficiently.
- Delivery Logistics: Manages the logistics of food delivery, assigning orders to delivery personnel.
- User Authentication and Profiles: Users can create and manage their profiles.
This project uses the following technologies:
- Java 25: A versatile programming language known for its portability and performance.
- Spring Boot 3: A robust Java framework for building scalable and maintainable applications.
- PostgreSQL: Advanced relational database for efficient data storage.
- Spring Data JPA: For ORM and database interactions.
- Local File Storage: Images are stored locally in the
uploads/directory and served via the API. - Postman: API client for testing and documenting endpoints.
Before running the application, ensure you have the following installed:
- Java Development Kit (JDK) 25 or higher
- PostgreSQL (running on port 5432)
- Maven (optional, wrapper is included)
Create a PostgreSQL database named nexusfood:
# Log in to postgres CLI
psql -U postgres
# Create database
CREATE DATABASE nexusfood;Note: The application defaults to username postgres and password password. You can change these in src/main/resources/application.properties.
You can run the application using the Maven wrapper:
Windows:
.\mvnw.cmd spring-boot:runLinux/Mac:
./mvnw spring-boot:runThe server will start on http://localhost:8080.
- Open the project in IntelliJ IDEA.
- Wait for Maven to sync dependencies.
- Locate
src/main/java/com/foodsense/demo/Main.java. - Click the Run (green play) button next to the
mainmethod.
- Security Enhancement (JWT/OAuth2)
- Containerization (Docker)
- Cloud Storage
- Testing
- Caching (Redis)
- CI/CD
POST /register: Register a new user.- Payload:
User(JSON)
- Payload:
POST /login: Login a user.- Payload:
User(JSON)
- Payload:
GET /get: Get all products.GET /get/{id}: Get product by ID.POST /insert: Insert a new product.- Query Param:
sellerId - Payload:
Product(JSON)
- Query Param:
DELETE /delete/{id}: Delete product by ID.PUT /update/image/{id}: Upload product image.- Payload:
MultipartFile(key:file)
- Payload:
PUT /update/{id}: Update product info.- Payload:
Product(JSON)
- Payload:
PUT /update/stock/{id}: Update product stock.- Payload:
Product(JSON)
- Payload:
GET /get: Get all orders.GET /get/{id}: Get order by ID.POST /placeOrder: Place a new order.- Query Param:
customerId - Payload:
OrderRequestDTO(JSON)
- Query Param:
GET /get: Get all admins.GET /get/{id}: Get admin by ID.POST /insert: Create admin.- Payload:
Admin(JSON)
- Payload:
DELETE /delete/{id}: Delete admin.PUT /update/{id}: Update admin.- Payload:
Admin(JSON)
- Payload:
GET /get: Get all couriers.GET /get/{id}: Get courier by ID.POST /insert: Create courier.- Payload:
Courier(JSON)
- Payload:
DELETE /delete/{id}: Delete courier.PUT /update/image/{id}: Upload courier image.- Payload:
MultipartFile(key:file)
- Payload:
PUT /update/{id}: Update courier.- Payload:
Courier(JSON)
- Payload:
PUT /takeOrder/{courierId}/order/{orderId}: Courier takes an order.
GET /get: Get all customers.GET /get/{id}: Get customer by ID.POST /insert: Create customer.- Payload:
Customer(JSON)
- Payload:
DELETE /delete/{id}: Delete customer.PUT /update/image/{id}: Upload customer image.- Payload:
MultipartFile(key:file)
- Payload:
PUT /update/{id}: Update customer.- Payload:
Customer(JSON)
- Payload:
GET /get: Get all sellers.GET /get/{id}: Get seller by ID.POST /insert: Create seller.- Payload:
Seller(JSON)
- Payload:
DELETE /delete/{id}: Delete seller.PUT /update/image/{id}: Upload seller image.- Payload:
MultipartFile(key:file)
- Payload:
PUT /update/{id}: Update seller.- Payload:
Seller(JSON)
- Payload:
GET /get/product/{id}: Get products by seller ID.
GET /: Welcome message.