π Java Spring Boot Learning Plan
Duration: 3 Days Γ 2 Hours = 6 Hours Total
Goal: Migrate MobikulApiTransformer from Laravel to Spring Boot
π οΈ Prerequisites - Install Before Day 1
- JDK 17 or 21: Oracle JDK or OpenJDK
- Windsurf IDE: Already installed (AI-powered IDE with Java support)
- Postman: Download Here
- MySQL: Already in XAMPP
- Maven: Will be configured in Windsurf
π
DAY 1: Java Fundamentals & Environment Setup
Hour 1: Introduction to Java (60 min)
Session 1 (30 min): What is Java?
- Platform-independent language: "Write Once, Run Anywhere"
- Strongly typed vs PHP dynamic typing
- JDK, JRE, JVM concepts
- Maven/Gradle (like Composer)
Session 2 (30 min): Environment Setup
- Install JDK β Verify:
java -version
- Configure Windsurf for Java development
- Set JAVA_HOME environment variable
- Install Java Extension Pack in Windsurf (if needed)
- Create & run HelloWorld.java in Windsurf
Hour 2: Java Syntax & OOP (60 min)
Session 1 (30 min): Java Syntax
- Data types: int, double, String, boolean
- Arrays:
int[] numbers = {1,2,3};
- Methods:
public int add(int a, int b) { return a + b; }
- Control structures: if-else, for, while
Session 2 (30 min): Object-Oriented Programming
- Classes and Objects
- Constructors
- Getters and Setters
- Access modifiers: public, private, protected
- Static vs Instance methods
Practice: Create Product, Customer, and Order classes in Windsurf
π‘ Windsurf Tip: Use Cascade AI to help you write and debug Java code!
β
Day 1 Checklist
- JDK installed and working
- Windsurf configured for Java development
- Can create and run Java programs in Windsurf
- Understand data types and methods
- Can create classes with properties
π
DAY 2: Spring Boot Fundamentals
Hour 1: Spring Boot Introduction (60 min)
Session 1 (30 min): Understanding Spring Boot
- Spring Framework = Enterprise Java framework (like Laravel)
- Spring Boot = Spring + Auto-config + Embedded Server
- No XML configuration needed
- Production-ready features
Laravel vs Spring Boot
| Feature | Laravel | Spring Boot |
| Server | php artisan serve | Embedded Tomcat |
| ORM | Eloquent | Spring Data JPA |
| Routes | routes/web.php | @RequestMapping |
| Controllers | Controller | @RestController |
| Config | .env | application.properties |
| Dependencies | composer.json | pom.xml |
Session 2 (30 min): Create Project
- Go to start.spring.io
- Maven, Java 17/21, Spring Boot 3.2.0
- Group: com.mobikul, Artifact: api
- Add: Spring Web, JPA, MySQL, Lombok, DevTools
- Generate β Extract β Open folder in Windsurf
- Windsurf will auto-detect Maven project and download dependencies
Hour 2: Architecture & First API (60 min)
Session 1 (30 min): Three-Layer Architecture
π‘ Windsurf Advantage: Use Cascade to generate Controller, Service, and Repository classes automatically!
- Controller: Handles HTTP requests (@RestController)
- Service: Business logic (@Service)
- Repository: Database access (@Repository)
Key Annotations
| Annotation | Laravel Equivalent |
| @RestController | Controller class |
| @GetMapping | Route::get() |
| @PostMapping | Route::post() |
| @RequestBody | $request->all() |
| @PathVariable | {id} parameter |
Session 2 (30 min): Create Hello API
Create controller/HelloController.java with GET and POST endpoints
π‘ Windsurf Tip: Ask Cascade to create REST endpoints for you!
Run Spring Boot app: Right-click on main class β Run
Test with browser and Postman
β
Day 2 Checklist
- Created Spring Boot project in Windsurf
- Understand Controller-Service-Repository
- Know key annotations
- Created and tested REST endpoints
- Can use Postman for testing
- Comfortable using Cascade AI for code generation
π
DAY 3: Database Integration & CRUD API
Hour 1: MySQL Integration (60 min)
Session 1 (20 min): Configure Database
- Create database:
CREATE DATABASE mobikul_db;
- Edit
application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/mobikul_db
spring.datasource.username=root
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
Session 2 (40 min): Create Entity & Repository
Entity: @Entity class with @Id, @Column
Repository: Interface extending JpaRepository<Product, Long>
Auto-provides: findAll(), findById(), save(), delete()
Hour 2: Complete CRUD API (60 min)
Create ProductService with methods:
- getAllProducts()
- getProductById(Long id)
- createProduct(Product product)
- updateProduct(Long id, Product details)
- deleteProduct(Long id)
Create ProductController with endpoints:
- GET /api/products - Get all
- GET /api/products/{id} - Get by ID
- POST /api/products - Create
- PUT /api/products/{id} - Update
- DELETE /api/products/{id} - Delete
Test all endpoints with Postman
π‘ Windsurf Pro Tip: Use Cascade to debug errors and optimize your code!
β
Day 3 Checklist
- Configured MySQL connection
- Created Entity and Repository
- Created Service layer
- Created complete CRUD Controller
- Tested all endpoints successfully
π Next Steps After 3 Days
Week 1-2: Practice
- Build complete Product Management API
- Add Categories with relationships
- Implement search and pagination
Week 3: Authentication
- Learn Spring Security
- Implement JWT (like Laravel Sanctum)
- Add user registration/login
Week 4+: Start Migration
- Analyze MobikulApi.php structure
- Map Laravel routes to Spring Boot
- Migrate one endpoint at a time
- Test thoroughly
π Essential Resources
π¬π§ English:
πΈπ¦ Arabic:
π‘ Quick Reference
Laravel β Spring Boot Mapping
| Laravel | Spring Boot |
| Route::get('/api/products') | @GetMapping("/api/products") |
| $request->all() | @RequestBody Product product |
| Product::all() | productRepository.findAll() |
| Product::find($id) | productRepository.findById(id) |
| Product::create($data) | productRepository.save(product) |
| $product->delete() | productRepository.delete(product) |
π How to Save as DOCX:
1. Open this HTML file in Microsoft Word
2. File β Save As β Choose "Word Document (.docx)"
3. Done!