A Spring Boot application for managing grocery lists with user authentication and a modern UI built with Thymeleaf and Bootstrap.
- 🔐 User Authentication (Login/Register)
- 📝 CRUD Operations for Groceries
- 🎲 Random Grocery Generator
- 💫 Modern, Responsive UI
- ⚡ Real-time Feedback Messages
- 🔄 Auto-dismissing Notifications
- 🎨 Professional UI with Bootstrap 5
- Username:
admin
- Password:
admin
- Java 17 or higher
- Maven
- H2 Database
The application will be available at http://localhost:9999
Method | Endpoint | Description |
---|---|---|
GET | /api/ping |
Server health check - returns "pong" |
Method | Endpoint | Description |
---|---|---|
GET | /login |
Show login page |
POST | /login |
Process login |
GET | /register |
Show registration page |
POST | /register |
Process registration |
GET | /logout |
Logout user |
Method | Endpoint | Description |
---|---|---|
GET | /groceries/list |
View all groceries |
GET | /groceries/showFormForAdd |
Show add form |
GET | /groceries/showFormForUpdate |
Show edit form |
POST | /groceries/save |
Save/Update grocery |
DELETE | /groceries/delete |
Delete grocery |
DELETE | /groceries/deleteAll |
Delete all groceries |
GET | /groceries/createRandomGrocery |
Add random grocery |
TestController
: Health check endpointGroceryController
: Handles grocery CRUD operationsLoginController
: Manages authentication and user registration
User
: User account model with fields:- id (Long)
- username (String, unique)
- password (String)
- isAdmin (boolean)
login.html
: Login page with default credentials displayregister.html
: User registration formlist-groceries.html
: Main grocery list viewgrocery-form.html
: Form for adding/editing groceries
- Spring Boot
- Spring MVC
- Spring Data JPA
- MySQL
- Thymeleaf
- Bootstrap 5
- Font Awesome
- HTML/CSS/JavaScript