A full-stack Smart Recipe web application built with React, Spring Boot, and MySQL.
| Layer | Technology |
|---|---|
| Frontend | React 18, React Router v6, Axios, Bootstrap 5 |
| Backend | Spring Boot 3.2, Spring Security, Spring Data JPA |
| Database | MySQL 8 |
| Auth | JWT (JSON Web Tokens) |
| API Docs | Swagger / OpenAPI 3 |
| Build Tool | Maven |
smart-recipe/
├── backend/ # Spring Boot Application
│ ├── src/main/java/com/smartrecipe/
│ │ ├── SmartRecipeApplication.java
│ │ ├── config/ # Security & OpenAPI config
│ │ ├── controller/ # REST Controllers
│ │ ├── dto/ # Request/Response DTOs
│ │ ├── entity/ # JPA Entities
│ │ ├── exception/ # Global exception handling
│ │ ├── repository/ # Spring Data JPA Repositories
│ │ ├── security/ # JWT Auth, Filters
│ │ └── service/ # Business Logic
│ └── src/main/resources/
│ └── application.properties
│
└── frontend/ # React Application
├── public/
│ └── index.html
└── src/
├── App.js
├── index.js
├── index.css
├── context/ # Auth Context (global state)
├── services/ # Axios API service layer
├── components/ # Reusable UI components
└── pages/ # Route-level page components
- Java 17+
- Node.js 18+
- MySQL 8
- Maven 3.8+
Open MySQL and run:
CREATE DATABASE smart_recipe_db;Hibernate will auto-create all tables on first run (
spring.jpa.hibernate.ddl-auto=update).
- Open
backend/src/main/resources/application.properties - Update DB credentials if needed:
spring.datasource.username=root
spring.datasource.password=root- From the
backend/directory, run:
mvn spring-boot:runBackend starts at → http://localhost:8080
Swagger UI → http://localhost:8080/swagger-ui.html
From the frontend/ directory:
npm install
npm startFrontend starts at → http://localhost:3000
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/auth/register | Register user | No |
| POST | /api/auth/login | Login user | No |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/recipes | Get all recipes | No |
| GET | /api/recipes/{id} | Get recipe by ID | No |
| GET | /api/recipes/search | Search & filter | No |
| POST | /api/recipes | Create recipe | Yes |
| PUT | /api/recipes/{id} | Update recipe | Yes |
| DELETE | /api/recipes/{id} | Delete recipe | Yes |
| GET | /api/recipes/my-recipes | Get logged-in user's recipes | Yes |
| POST | /api/recipes/{id}/save | Save / unsave recipe | Yes |
| GET | /api/recipes/saved | Get saved recipes | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/recipes/{recipeId}/reviews | Get reviews | No |
| POST | /api/recipes/{recipeId}/reviews | Add review | Yes |
| DELETE | /api/recipes/{recipeId}/reviews/{id} | Delete review | Yes |
- ✅ User Registration & Login with JWT Authentication
- ✅ Browse all recipes with search and filters (diet, cuisine, difficulty)
- ✅ Create, Edit, Delete your own recipes
- ✅ Add ingredients with quantity and unit
- ✅ Step-by-step cooking instructions
- ✅ Save / Unsave recipes (favourites)
- ✅ Star rating & review system (one review per user per recipe)
- ✅ Recipe detail page with full info
- ✅ Responsive UI with Bootstrap 5
- ✅ Swagger API documentation
- ✅ Global exception handling
- ✅ Form validation (frontend + backend)