Windows IntelliJ Guide: Logistics Service Setup - Wiz-DevTech/prettygirllz GitHub Wiki
Here's a step-by-step guide for Windows users using IntelliJ IDEA to implement the Logistics Service:
(With Screenshot References)
-
Java 17+
Download from Adoptium
Run installer → Add to PATH during installation
-
Verify:
cmdCopyDownloadjava -version
-
IntelliJ IDEA
Download Community Edition
Install with .java and .sh file associations
-
Docker Desktop
Download from Docker Hub
Enable WSL 2 Backend during installation
Post-install: Right-click tray icon → Settings → Resources → Set RAM ≥4GB
-
Git
cmdCopyDownloadwinget install --id Git.Git -e
-
In IntelliJ:
File → New → Project from Version ControltextCopyDownloadURL: https://github.com/your-org/logistics-service.git Directory: C:\Users\{YourUser}\logistics-service
Trust Project when prompted
File → Project Structure (Ctrl+Alt+Shift+S)
-
Under Project Settings → Project:
Set SDK: Java 17
Set Language Level: 17
Open Terminal in IntelliJ (Alt+F12)
-
Run:
powershellCopyDownloaddocker-compose up -d postgres kafka redis
-
Verify Containers:
Open Docker Desktop → Containers tab
Should show 3 containers running
Troubleshooting:
-
If ports conflict (e.g., 5432 already used):
powershellCopyDownloadnetstat -ano | findstr :5432 taskkill /PID {PID} /F
In IntelliJ:
View → Tool Windows → Database-
Click + → Data Source → PostgreSQL
textCopyDownloadHost: localhost Port: 5432 User: postgres Password: postgres Database: logistics
Test Connection → Apply
Right-click project → New → File named
init_db.sql
Paste the schema from original guide
Right-click the script → Run
Locate
LogisticsApp.java
Click gutter icon next to
main()
→ Run-
First Run Fixes:
If missing dependencies:
Right-click project → Maven → Reload ProjectIf Lombok errors:
File → Settings → Build → Compiler → Annotation Processors → Enable
Go to Run → Edit Configurations
-
Under Environment Variables:
textCopyDownloadSPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/logistics SPRING_DATASOURCE_USERNAME=postgres SPRING_DATASOURCE_PASSWORD=postgres
Open any test file (e.g.,
DeliveryServiceTest.java
)Click Run Test gutter icon
Install HTTP Client plugin if missing
-
Create
rest_test.http
file:httpCopyDownloadPOST http://localhost:8080/api/v1/deliveries Content-Type: application/json { "orderId": "win_test_1", "destinationType": "OFFICE" }
Click Run icon in the gutter
Use Search (Ctrl+F) in Run console tab
Filter by log level:
Set Breakpoints: Click gutter next to line numbers
Step Through Code: Use Debug mode (Shift+F9)
Monitor Containers: Use Docker Desktop's Logs tab
Pro Tip: Bookmark IntelliJ shortcuts:
Alt+1: Project view
Ctrl+Shift+F10: Run current file
Ctrl+Shift+A: Find any action
Windows/IntelliJ Guide: Logistics Service Setup (With Screenshot References)
- Prerequisites Installation 1.1 Install Required Software Java 17+
Download from Adoptium
Run installer → Add to PATH during installation
Verify:
cmd java -version IntelliJ IDEA
Download Community Edition
Install with .java and .sh file associations
Docker Desktop
Download from Docker Hub
Enable WSL 2 Backend during installation
Post-install: Right-click tray icon → Settings → Resources → Set RAM ≥4GB
Git
cmd winget install --id Git.Git -e 2. Project Setup in IntelliJ 2.1 Clone Repository In IntelliJ: File → New → Project from Version Control
text URL: https://github.com/your-org/logistics-service.git Directory: C:\Users{YourUser}\logistics-service Trust Project when prompted
2.2 Configure SDK File → Project Structure (Ctrl+Alt+Shift+S)
Under Project Settings → Project:
Set SDK: Java 17
Set Language Level: 17
- Docker Setup 3.1 Start Containers Open Terminal in IntelliJ (Alt+F12)
Run:
powershell docker-compose up -d postgres kafka redis Verify Containers:
Open Docker Desktop → Containers tab
Should show 3 containers running
Docker Desktop view
Troubleshooting:
If ports conflict (e.g., 5432 already used):
powershell netstat -ano | findstr :5432 taskkill /PID {PID} /F 4. Database Initialization 4.1 Connect to PostgreSQL In IntelliJ: View → Tool Windows → Database
Click + → Data Source → PostgreSQL
text Host: localhost Port: 5432 User: postgres Password: postgres Database: logistics Test Connection → Apply
4.2 Run SQL Script Right-click project → New → File named init_db.sql
Paste the schema from original guide
Right-click the script → Run
- Run the Application 5.1 Configure Run/Debug Locate LogisticsApp.java
Click gutter icon next to main() → Run
First Run Fixes:
If missing dependencies: Right-click project → Maven → Reload Project
If Lombok errors: File → Settings → Build → Compiler → Annotation Processors → Enable
5.2 Environment Variables Go to Run → Edit Configurations
Under Environment Variables:
text SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/logistics SPRING_DATASOURCE_USERNAME=postgres SPRING_DATASOURCE_PASSWORD=postgres 6. Testing in IntelliJ 6.1 Unit Tests Open any test file (e.g., DeliveryServiceTest.java)
Click Run Test gutter icon
6.2 API Testing Install HTTP Client plugin if missing
Create rest_test.http file:
http POST http://localhost:8080/api/v1/deliveries Content-Type: application/json
{ "orderId": "win_test_1", "destinationType": "OFFICE" } Click Run icon in the gutter
- Debugging Tips Common Issues & Fixes Problem Solution "Port already in use" Run: Stop-Process -Id (Get-NetTCPConnection -LocalPort 8080).OwningProcess -Force Docker errors In Docker Desktop → Troubleshoot → Restart Lombok warnings Install plugin: File → Settings → Plugins → Lombok Log Navigation Use Search (Ctrl+F) in Run console tab
Filter by log level:
IntelliJ log filtering
Next Steps Set Breakpoints: Click gutter next to line numbers
Step Through Code: Use Debug mode (Shift+F9)
Monitor Containers: Use Docker Desktop's Logs tab
Pro Tip: Bookmark IntelliJ shortcuts:
Alt+1: Project view
Ctrl+Shift+F10: Run current file
Ctrl+Shift+A: Find any action