Spring Boot e-commerce backend with payment integration.
Windows:
# PowerShell
.\start.ps1
# Or Batch file
start.batLinux/Mac:
chmod +x start.sh
./start.shThis will automatically:
- Start MongoDB (Docker)
- Start E-Commerce API (Port 8080)
- Start Mock Payment Service (Port 8081)
-
Start MongoDB using Docker:
docker-compose up -d
Or install MongoDB locally and start it on port 27017
-
Build and run main application:
mvn clean install mvn spring-boot:run
-
Build and run mock payment service (in separate terminal):
cd mock-payment-service mvn clean install mvn spring-boot:run
Windows:
.\stop.ps1Linux/Mac:
./stop.shNote: Spring Boot applications need to be stopped manually in their terminal windows (Ctrl+C)
- POST /api/products - Create product
- GET /api/products - Get all products
- POST /api/cart/add - Add item to cart
- GET /api/cart/{userId} - Get user cart
- DELETE /api/cart/{userId}/clear - Clear cart
- POST /api/orders - Create order from cart
- GET /api/orders/{orderId} - Get order details
- POST /api/payments/create - Create payment
- POST /api/webhooks/payment - Payment webhook endpoint
- Create products: POST /api/products
- Add to cart: POST /api/cart/add
- Create order: POST /api/orders
- Create payment: POST /api/payments/create
- Wait 3 seconds for webhook
- Check order status: GET /api/orders/{orderId}