This is a Food Delivery Application developed using Spring Boot for the backend and React for the frontend. The application facilitates food ordering, user authentication, and management of food items, categories, orders, and restaurants.
- User Authentication and Authorization (JWT based)
- Admin and User roles with role-based access control
- Food item management
- Category management
- Cart management
- Order processing
- Restaurant management
- Java
- Spring Boot
- Spring Security
- Spring Data JPA (Hibernate)
- JWT for security
- Maven
- React
- Axios for HTTP requests
- Redux for state management
src
├── main
│ ├── java
│ │ └── com.velamdir
│ │ ├── config
│ │ │ ├── AppConfig.java
│ │ │ ├── JwtConstant.java
│ │ │ ├── JwtProvider.java
│ │ │ └── JwtTokenValidator.java
│ │ ├── controller
│ │ │ ├── AdminFoodController.java
│ │ │ ├── AdminOrderController.java
│ │ │ ├── AdminRestaurantController.java
│ │ │ ├── AuthController.java
│ │ │ ├── CartController.java
│ │ │ ├── CategoryController.java
│ │ │ ├── FoodController.java
│ │ │ ├── HomeController.java
│ │ │ ├── IngredientController.java
│ │ │ ├── OrderController.java
│ │ │ ├── RestaurantController.java
│ │ │ └── UserController.java
│ │ ├── DTO
│ │ │ └── RestaurantDto.java
│ │ ├── model
│ │ │ ├── Address.java
│ │ │ ├── Cart.java
│ │ │ ├── CartItem.java
│ │ │ ├── Category.java
│ │ │ ├── ContactInformation.java
│ │ │ ├── Food.java
│ │ │ ├── IngredientItem.java
│ │ │ ├── IngredientCategory.java
│ │ │ ├── Order.java
│ │ │ ├── OrderItem.java
│ │ │ ├── Restaurant.java
│ │ │ ├── User.java
│ │ │ └── USER_ROLE.java
│ │ ├── repository
│ │ │ ├── AddressRepository.java
│ │ │ ├── CartItemRepository.java
│ │ │ ├── CartRepository.java
│ │ │ ├── CategoryRepository.java
│ │ │ ├── FoodRepository.java
│ │ │ ├── IngredientCategoryRepository.java
│ │ │ ├── IngredientItemRepository.java
│ │ │ ├── OrderItemRepository.java
│ │ │ ├── OrderRepository.java
│ │ │ ├── RestaurantRepository.java
│ │ │ └── UserRepository.java
│ │ ├── request
│ │ │ ├── AddCartItemRequest.java
│ │ │ ├── CreateRestaurantRequest.java
│ │ │ ├── CreateFoodRequest.java
│ │ │ ├── IngredientCategoryRequest.java
│ │ │ ├── IngredientRequest.java
│ │ │ ├── LoginRequest.java
│ │ │ └── UpdateCartItemRequest.java
│ │ ├── response
│ │ │ ├── AuthResponse.java
│ │ │ └── MessageResponse.java
│ │ └── service
│ │ ├── CartService.java
│ │ ├── CartServiceImpl.java
│ │ ├── CategoryService.java
│ │ ├── CategoryServiceImpl.java
│ │ ├── CustomerUserDetailsService.java
│ │ ├── FoodService.java
│ │ ├── FoodServiceImpl.java
│ │ ├── IngredientService.java
│ │ ├── IngredientServiceImpl.java
│ │ ├── OrderService.java
│ │ ├── OrderServiceImpl.java
│ │ ├── RestaurantService.java
│ │ ├── RestaurantServiceImpl.java
│ │ └── UserService.java
│ │ └── UserServiceImpl.java
│ │ └── OnlineFoodOrderingAppliaction.java
│ └── resources
│ └── application.properties
The frontend React application should follow a standard structure with components, services for API calls, and Redux for state management.
frontend/
├── node_modules/
├── public/
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
└── src/
├── component/
│ └── config/
│ | └── api.js
│ | └── logic.js
│ └── Auth/
│ | └── Auth.jsx
│ | └── RegisterForm.jsx
│ | └── LoginForm.jsx
│ └── Cart/
│ | └── AddressCard.jsx
│ | └── Cart.jsx
│ | └── CartItem.jsx
│ └── Home/
│ | └── Home.js
│ | └── Home.css
│ | └── Carasoul.jsx
│ | └── topMeel.js
│ | └── MutiItemCarasoul.jsx
│ └── Navbar/
│ | └── Navbar.js
│ | └── Navbar.css
│ └── Profile/
│ | └── EventCards.jsx
│ | └── Favorites.jsx
│ | └── Address.jsx
│ | └── Event.jsx
│ | └── Order.jsx
│ | └── OrderCard.jsx
│ | └── UserProfile.jsx
│ | └── Profile.jsx
│ | └── ProfileNavigation.jsx
│ └── Restaurant/
│ | └── RestaurantCard.jsx
│ | └── RestaurantDetails.jsx
│ | └── ManuCard.jsx
├── Routers/
│ | └── CustomerRouter.jsx
│ └── state/
│ | └── Authentication
| | | └── Action.js
| | | └── ActionType.js
| | | └── Reducer.js
| | └── store.js
│ | └── Manu
| | | └── Action.js
| | | └── ActionType.js
| | | └── Reducer.js
│ | └── Restaurant
| | | └── Action.js
| | | └── ActionType.js
| | | └── Reducer.js
├── Theme/
│ └── DarkTheme.js
├── App.css
├── App.js
├── App.test.js
├── index.css
├── index.js
├── logo.SVG
├── reportWebVitals.js
└── setupTests.js
- Clone the repository:
git clone <repository-url>
- Navigate to the backend directory:
cd backend
- Build the project using Maven:
mvn clean install
- Run the Spring Boot application:
mvn spring-boot:run
- Navigate to the frontend directory:
cd frontend
- Install the dependencies:
npm install
- Start the React application:
npm start
- Open your browser and navigate to
http://localhost:3000
to access the frontend. - Use the available features to register, log in, browse food items, manage the cart, and place orders.
POST /api/auth/login
: User loginPOST /api/auth/register
: User registration
GET /api/food
: Get all food itemsPOST /api/admin/food
: Create a new food item (Admin)PUT /api/admin/food/{id}
: Update a food item (Admin)DELETE /api/admin/food/{id}
: Delete a food item (Admin)
GET /api/categories
: Get all categoriesPOST /api/admin/categories
: Create a new category (Admin)PUT /api/admin/categories/{id}
: Update a category (Admin)DELETE /api/admin/categories/{id}
: Delete a category (Admin)
GET /api/cart
: Get cart itemsPOST /api/cart
: Add item to cartPUT /api/cart
: Update cart itemDELETE /api/cart/{id}
: Remove item from cart
GET /api/orders
: Get all ordersPOST /api/orders
: Create a new orderGET /api/orders/{id}
: Get order details
GET /api/restaurants
: Get all restaurantsPOST /api/admin/restaurants
: Create a new restaurant (Admin)PUT /api/admin/restaurants/{id}
: Update a restaurant (Admin)DELETE /api/admin/restaurants/{id}
: Delete a restaurant (Admin)
- Fork the repository.
- Create your feature branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature
- Open a pull request.
Feel free to contribute to the project by submitting pull requests or reporting issues. Your feedback and suggestions are highly appreciated!