Experiment
Experiment
Project Overview
Project Idea
Your project idea is well-structured, but I will refine and elaborate on some key points to
ensure completeness and clarity while keeping it aligned with best practices.
Roles
Functionalities
User (role=user)
• Can sign up
log in (JWT token will be issued).
Admin (role=admin)
Corrections
Enhancements to Your Plan
Key Improvements
• Explicit Role Storage: Store roles in the ‘User‘ table, not just in the JWT.
• JWT Enhancements: Include ‘id‘, ‘email‘, and ‘role‘ in JWT. Set expiration time.
• Database Schema Update: Create ‘User‘ and ‘Todo‘ tables with a foreign key
(‘useri d‘).Security Middleware:RestrictAP IsusingJW T M iddlewareand‘@P reAuthorize‘.
1
Database Schema
User Table
To-Do Table
Step-by-Step Breakdown
Step 1: Setup Spring Boot Project
Use Spring Initializr with dependencies: Spring Web, Spring Security, Spring Data JPA,
MySQL Driver, Lombok.
Create ‘User‘ and ‘Todo‘ tables with proper foreign key relationships.
2
Final Project Flow Summary
1 Setup
Configuration
2 Database Design
Create ‘User‘
‘Todo‘ tables with foreign key relationships.
3 Authentication
Authorization
Implement JWT-based authentication. Apply role-based access control using Spring Security.
4 APIs
Track
log all API requests.
6 Testing
Deployment