Automotive Ecommerce Learning Map
This guide gives you a study path through the real project so you can absorb every Spring Boot and React concept in context. Work through the backend first, then the frontend. Each section lists the scenario to explore, the files to read, the Spring/React concepts involved, and a small practice idea.
Part 1 – Backend (Spring Boot)
0. Groundwork & Tooling
Files to Explore:
backend/pom.xml
What to Learn:
- Skim to see Spring Boot 3.1, Java 21, security, validation, JWT, Lombok
- Look up any unfamiliar dependency in the Spring docs
- Run the app once (
./mvnw spring-boot:runfrombackend/) - Make sure the H2 database and auto data setup are clear
- Open the H2 console at
/h2-consolewith the JDBC URL fromapplication.properties
Concepts:
- Maven dependencies and Spring Boot starters
- H2 in-memory database for development
- Application properties configuration
Practice:
- Document each major dependency and its purpose
- Access H2 console and explore the schema
1. Project Skeleton & Entry Point
Files to Explore:
backend/src/main/java/com/automotive/ecommerce/AutomotiveEcommerceApplication.java- Package layout under
business/,config/,exception/
Concepts:
@SpringBootApplicationannotation- Component scanning mechanism
- Layered architecture: controller → service → repository → entity
Practice:
- Draw a quick diagram of the package structure
- List what each layer owns
- Document the responsibility of each layer
2. Configuration & Infrastructure Beans
Files to Explore:
config/SecurityConfig.javaJwtAuthenticationFilter.javaJwtUtil.javaCustomAuthenticationEntryPoint.javaCustomAccessDeniedHandler.javaDataInitializer.java
Concepts:
- Bean creation with
@Bean - Dependency injection
SecurityFilterChainconfiguration- Stateless JWT authentication
- Filter ordering in Spring Security
CommandLineRunnerfor initialization
Practice:
- Trace a request for
/api/cart - Note each security component involved: CORS → JWT filter → DaoAuthenticationProvider
- Document the security filter chain order
3. Domain Model & JPA Mapping
Files to Explore:
entity/User.javaentity/Role.javaentity/Product.javaentity/Cart.javaentity/CartItem.javaentity/CartAuditLog.java
Concepts:
@Entityannotation and JPA basics- Field constraints and validation
- Relationships:
@OneToMany,@ManyToOne,@ElementCollection - Lifecycle callbacks:
@PrePersist - Lombok usage for reducing boilerplate
UserimplementingUserDetailsinterface
Practice:
- Sketch the ER diagram: Users ↔ Carts ↔ CartItems ↔ Products
- List which side owns each relationship
- Document cascade operations and fetch types
4. Data Access Layer
Files to Explore:
repository/*Repository.java
Concepts:
JpaRepositoryinterface- Custom queries with
@Queryand JPQL - Optional handling for null safety
- Pagination with
PageandPageable
Practice:
- Write down what each repository method returns
- Document which service calls each repository method
- Try writing a JPQL query that fetches carts by date
5. Authentication Scenario (Login)
Files to Explore:
controller/AuthController.javadto/LoginRequest.javadto/LoginResponse.javaservice/AuthService.javaservice/UserService.java
Concepts:
AuthenticationManagerusageUsernamePasswordAuthenticationToken- Error handling:
BadCredentialsException UserDetailsServiceimplementation- Password encoding with BCrypt
Flow:
- User submits
/api/auth/login - Controller validates input
- Service authenticates credentials
- JWT generated by
JwtUtil - Failed attempts tracked via
UserService
Practice:
- Using Postman, send a login request
- Decode the JWT payload to see the subject
- Test failed login attempts and observe tracking
6. Registration Scenario (Sign Up)
Files to Explore:
controller/AuthController.javadto/UserRegistrationDto.javaservice/AuthService.javaservice/UserService.java
Concepts:
- DTO validation with
@Valid - Transaction boundaries
- Role assignment with
Set<Role> - Password hashing before storage
Practice:
- Register a new user via API
- Inspect the
userstable via H2 console - Verify password is hashed, not plain text
- Document the registration flow step by step
7. Authorization & Role Checks
Files to Explore:
SecurityConfig.java(revisited)- Annotations in
controller/ProductController.java controller/CartController.javacontroller/PublicProductController.java
Concepts:
@PreAuthorizefor method-level security- Role hierarchy:
ROLE_ADMINvsROLE_USER - Exposing public vs protected endpoints
- Spring Security expression language
Practice:
- Try hitting an admin endpoint with a user token
- Observe the
CustomAccessDeniedHandlerresponse - Document which endpoints require which roles
8. Product Management Scenario (Admin + Public Catalog)
Admin Flow Files:
controller/ProductController.javaservice/ProductService.javadto/ProductRequestDTO.javadto/ProductResponseDTO.java
Public Flow Files:
controller/PublicProductController.java
Concepts:
- Pagination with
Pageable - DTO mapping between layers
- Soft delete pattern with
isActive - Validation:
@DecimalMin,@Pattern - Service method reuse
Practice:
- Modify a product through the API
- Verify
updatedAtchanges automatically - Confirm
CartAuditlogs stay untouched - Document the difference between admin and public endpoints
9. Cart Lifecycle Scenario (Add/Update/Remove)
Files to Explore:
controller/CartController.javaservice/CartService.javaservice/CartServiceImpl.java- Cart DTOs (request/response)
service/CartAuditService.javaservice/CartAuditServiceImpl.java
Concepts:
@Transactionalwith isolation levels- Custom exceptions:
InsufficientStockException,CartItemNotFoundException - Business logging with
lombok.extern.slf4j.Slf4j - Asynchronous audit logging:
@Async,@Transactional(REQUIRES_NEW) - DTO assembly and mapping
Flow:
- Identify how
CartServiceImplorchestrates:- Repository calls
- Validations (stock check, active product)
- DTO conversions
- Transaction boundaries
Practice:
- Step through the add-to-cart method
- Note every guard (stock check, active product)
- Document transaction boundaries
- Test edge cases (insufficient stock, inactive product)
10. Cross-Cutting Concerns
Files to Explore:
exception/GlobalExceptionHandler.java- Individual exception classes
Concepts:
@RestControllerAdvicefor global error handling- Building consistent error payloads
- Validation error handling:
MethodArgumentNotValidException - Fallback exception handling
Practice:
- Trigger a validation error (e.g., missing
productId) - Annotate the JSON response fields
- Document the error response structure
- Test different exception types
11. Initialization & Seed Data
Files to Explore:
config/DataInitializer.java
Concepts:
CommandLineRunnerinterface- Conditional user creation
- Logging best practices
- Idempotent initialization logic
Practice:
- Adapt the initializer to add a sample product
- Guard against duplicates
- Document initialization order
- Test with empty vs populated database
12. Testing & Quality Checks
Files to Explore:
backend/src/test/java/...- Exception tests
- Integration tests
Concepts:
- Spring test slices
- Security test utilities
- Verifying exception paths
- Test data builders
Practice:
- Run
./mvnw test - Read one test to understand assertions
- Review security layer tests
- Document test patterns used
13. OOP & Design Patterns Review
Patterns to Observe:
Interfaces & Polymorphism:
CartServiceinterface withCartServiceImplUserServiceimplementingUserDetailsService
Abstraction:
- DTO layer decoupling controllers from entities
- Service interfaces abstracting implementation details
Encapsulation:
- Entity private fields with getters/setters
Cartmanaging internal consistency via helper methods
SOLID Principles:
- Single Responsibility: Each service has one purpose
- Open/Closed: Exception hierarchy allows extension
- Liskov Substitution: Interface implementations are interchangeable
- Interface Segregation: Focused service interfaces
- Dependency Inversion: Controllers depend on interfaces, not implementations
Practice:
- List which SOLID rule each layer satisfies
- Identify areas that could improve
- Document design pattern usage
14. Suggested Deep Dives
Deep Dive 1: Login Sequence
- Trace the entire login sequence end-to-end
- Controller → Service → Auth Manager → User Repository → JWT
- Document each step with code references
Deep Dive 2: Admin Product Creation
- Walk through "add product as admin"
- Document every object created
- Note validation steps
- Observe transaction handling
Deep Dive 3: Code Cleanup Opportunities
- Inspect how repeated code (e.g., logging) could be extracted
- Reinforces clean code thinking
- Practice refactoring techniques
Deep Dive 4: Order Placement Extension
- Explore how to add "order placement"
- Mimic the cart patterns (great exercise in reuse)
- Design the order entity and relationships
- Plan the service layer methods
Part 2 – Frontend (React)
0. Prep
Setup:
- Review
frontend/package.jsonto see core libraries - Libraries: React 18, React Router 6, axios, react-hot-toast
- Start the dev server:
npm startinfrontend/ - Interact with the UI while reading components
Practice:
- Document each major dependency
- Note version numbers
- Understand dev vs prod builds
1. Application Skeleton & Routing
Files to Explore:
src/index.jssrc/App.js
Concepts:
- React Router v6:
Routes,Route,Navigate - Nested providers pattern
- Protected routes implementation
- Admin-only routes
Practice:
- Map each route to its component
- Note which routes require authentication
- Document the route hierarchy
- Test navigation between routes
2. Global State – Authentication
Files to Explore:
context/AuthContext.js
Concepts:
- React Context API
useContexthookuseEffectfor bootstrapping fromlocalStorage- Helper methods:
isAdmin,isUser - Authentication state management
Practice:
- Log the stored user object after login
- See the JWT payload in local storage
- Document the auth context shape
- Test logout behavior
3. Global State – Cart Management
Files to Explore:
context/CartContext.jshooks/useCartPersistence.js
Concepts:
useReducerfor complex state- Action constants pattern
- Async actions calling the API layer
- Toast notifications for feedback
- Custom hooks reacting to auth changes
Practice:
- Trace
addToCartflow:- Button click → Context action → API call → Reducer state update
- Document each action type
- Note optimistic vs pessimistic updates
4. Shared UI Building Blocks
Files to Explore:
components/Header.jscomponents/CartIcon.jscomponents/AddToCartButton.jscomponents/CartItem.js
Concepts:
- Prop-driven UI components
- Conditional rendering patterns
- Inline styling vs CSS classes
- Controlled inputs
useNavigatefor programmatic routing
Practice:
- Document which props each component expects
- Note how components interact with contexts
- Test different prop combinations
- Observe re-render behavior
5. Authentication Screens
Files to Explore:
components/Login.jscomponents/Register.jscomponents/Login.css
Concepts:
- Controlled forms with
useState - Form validation patterns
- Using contexts inside forms
- Error handling and display
- Test account shortcuts
Practice:
- Replicate the login form in a minimal sandbox
- Reinforce form handling patterns
- Test validation errors
- Document form submission flow
6. Dashboard Experience
Files to Explore:
components/Dashboard.jscomponents/AdminDashboard.jscomponents/UserDashboard.js
Concepts:
- Role-based rendering
- Effect-driven data loading
- Basic statistics display
- Navigation shortcuts
Practice:
- Note which API calls power each dashboard
- Document how dashboards differ between roles
- Test with different user types
- Observe data loading patterns
7. Product Browsing Scenario (User)
Files to Explore:
components/products/ProductCatalog.jscomponents/products/ProductFilters.jscomponents/products/ProductList.jscomponents/products/ProductCard.jscomponents/products/ProductDetail.js
Concepts:
- Local filter state management
useEffectdependencies- Pagination UI implementation
- Component composition (ProductList uses ProductCard)
- Formatting utilities
Practice:
- Simulate applying filters
- Observe query param construction in
productAPI.getProducts - Document filter logic
- Test pagination behavior
8. Admin Product Management Scenario
Files to Explore:
components/admin/AdminProductList.jscomponents/admin/ProductForm.js
Concepts:
- Shared list component in admin mode (
isAdminView) - Form reuse for create vs edit (
isEditflag) - Optimistic UI vs re-fetching
- Datalist for suggestions
- Form validation
Practice:
- Switch form between create and edit modes
- Document which fields need pre-filling
- Test form validation
- Observe data refresh patterns
9. Cart Page Scenario
Files to Explore:
components/CartPage.js
Concepts:
- Gated access via auth checks
- Conditional rendering: empty cart vs filled cart
- Checkout placeholder for future work
- Cart summary calculations
Practice:
- Explore how
clearCartdispatches actions - Document
removeFromCartflow - Test with empty and full carts
- Note calculation logic
10. API Layer & Networking
Files to Explore:
services/api.jsservices/cartApi.js- Other API service files
Concepts:
- Configuring axios instances
- Interceptors for auth headers & error handling
- Splitting REST concerns (auth, user, product, cart)
- Request/response transformations
Practice:
- Add a temporary interceptor log
- Watch every request path and status
- Document API service structure
- Test error handling scenarios
11. Styling & UI Consistency
Files to Explore:
index.cssstyles/cart.css
Concepts:
- Global resets and base styles
- Utility classes:
.container,.card,.btn - CSS modules vs plain CSS
- Inline styles for component-specific tweaks
- Responsive design patterns
Practice:
- Pick one component (e.g.,
ProductCard) - Convert inline styles to CSS classes
- Document styling strategies
- Test responsive behavior
12. Testing & Quality (Future Work)
Setup:
- Library:
@testing-library/reactis already installed - Identify candidate components for tests
Concepts:
- Component testing patterns
- Context mocking
- User interaction simulation
- Assertion strategies
Practice:
- Outline one test for
AddToCartButton - Mock context values
- Simulate click events
- Document test structure
13. Integration with Backend
Cross-Reference Scenario Flows:
Login Flow:
Login.js→authAPI.login→ Backend/api/auth/login
Product Listing:
ProductCatalog→productAPI.getProducts→ BackendPublicProductController
Cart Actions:
CartContext→cartApi→ BackendCartController
Practice:
- For each flow, keep both frontend and backend open side by side
- Annotate the request/response shape
- Document data transformations
- Test the complete flow
14. Suggested Deep Dives
Deep Dive 1: Admin User Management
- Implement "unlock account" admin action on frontend
- Use existing
adminAPI.unlockUser - Add UI components
- Test the complete flow
Deep Dive 2: Product Images
- Add product images end-to-end
- Use
ProductFormandProductDetail - See
utils/updateProductImages.jsfor hints - Implement upload functionality
Deep Dive 3: Tailwind Refactoring
- Refactor inline styles into Tailwind classes
- Advanced exercise to meet Tailwind learning goal
- Maintain existing functionality
- Document the migration process
Deep Dive 4: Performance Optimization
- Memoize heavy components
- Inspect re-renders with React DevTools
- Implement code splitting
- Measure performance improvements
How to Use This Map
Study Session Structure
-
Commit to one scenario per study session
- Example: "Tonight: Cart lifecycle"
- Read the listed files
- Run the flow in the app
- Take comprehensive notes
-
Explain the flow
- Explain aloud or in a journal
- Focus on which objects interact and why
- Document the data flow
- Note design decisions
-
Rebuild the flow
- Recreate in a scratch project
- Write pseudo-code to cement logic
- Test your understanding
- Document challenges
-
Keep a glossary
- Track Spring/React terms you encounter
- Link terms to exact files in this project
- Build your reference guide
- Review regularly
Learning Outcomes
By the end of this journey, you will have walked through:
✅ Authentication & Authorization
- JWT-based authentication
- Role-based access control
- Spring Security configuration
- React authentication context
✅ Product Management
- CRUD operations
- Validation patterns
- Admin vs public access
- Search and filtering
✅ Cart Handling
- State management
- Optimistic updates
- Async operations
- Audit logging
✅ Spring Boot Concepts
- Dependency injection
- JPA and Hibernate
- RESTful API design
- Security configuration
- Transaction management
✅ React Concepts
- Context API
- Hooks (useState, useEffect, useReducer, useContext)
- Component composition
- Routing
- API integration
Happy Learning! 🚀
Each concept is grounded in working code, making it easier to understand and retain. Take your time with each section and build sub-pages as you progress through your learning journey.