The Online Food Ordering Backend is a Java Spring-based application that enables users to create restaurants, add food items with customizable ingredients, and place orders. The system includes role-based JWT authentication to manage user access securely.
- Role-Based JWT Authentication: Secure authentication and authorization using JSON Web Tokens (JWT).
- Restaurant Management: Users can create and manage their restaurants.
- Food Management: Add food items with various customizable ingredients.
- Cart API (In Progress): Users can add items to their cart before placing an order.
- Order API (In Progress): Handles order placement and processing.
- Backend: Java, Spring Boot
- Security: Spring Security with JWT
- Database: MySQL
- Build Tool: Maven
- Java 17+
- MySQL Database
- Maven
- Postman (for API testing)
- Clone the repository:
git clone https://github.com/Devansh-ds/online-food-ordering-backend.git cd online-food-ordering-backend
- Configure application properties:
- Update
src/main/resources/application.properties
with your MySQL credentials.
- Update
- Build and run the application:
mvn clean install mvn spring-boot:run
POST /auth/register
- Register a new userPOST /auth/login
- Authenticate user and retrieve JWT token
POST /restaurants
- Create a restaurantGET /restaurants
- Get all restaurants
POST /foods
- Add food item with customizable ingredientsGET /foods
- Get all available food items
Cart API
Order API
Feel free to contribute by opening a pull request or reporting issues.
MIT License