Order Management System built with Spring Boot, Spring Security, and Stripe for realβtime payment processing.
- User authentication & authorization (JWT + Spring Security)
- Roleβbased access control (ADMIN / USER)
- Product management
- Order lifecycle management (CREATED β PAID)
- Stripe realβtime payment integration
- Secure REST APIs
- Docker & Docker Compose support
- Backend: Java, Spring Boot
- Security: Spring Security, JWT
- Database: PostgreSql (configurable)
- Payments: Stripe API
- Build Tool: Maven
- Deployment: Docker
- Docker
- Google Cloud Run
- Google Artifact Registry
- GCP IAM
- Environment Variables (Secrets)
Production URL:
π https://order-system-995861694342.asia-southeast1.run.app
src/main/java/com/vodica/order_system
βββ config # Security & application config
βββ controller # REST controllers
βββ dto # Request / Response DTOs
βββ entity # JPA entities
βββ repository # Spring Data JPA repositories
βββ security # JWT filter & security logic
βββ service # Business logic
βββ exceptions # Global exception handling
spring:
datasource:
url: jdbc:mysql://localhost:3306/order_db
username: root
password: password
stripe:
secret-key: sk_test_xxxxxxxxxxxxxxxxx
β οΈ Never commit your real Stripe secret key
DATABASE_USERNAME=database_username
DATABASE_PASSWORD=database_password
JWT_ACCESS_SECRET=base64_32bit_secret_key
JWT_REFRESH_SECRET=base64_32bit_secret_key
JWT_EXP=3600000 // 1hr example
JWT_REFRESH_EXP=604800000 // 7days example
STRIPE_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
STRIPE_WEBHOOK_SECRET=whsec_xxxxxxxxxxmvn clean install
mvn spring-boot:runApplication will start at:
http://localhost:8080
docker compose up --buildPOST /api/auth/sign-up
{
"email": "user@example.com",
"password": "password123",
"name": "Your_FULL_NAME",
"address": "YOUR_ADDRESS"
}POST /api/auth/sign-in
For test Admin login
{
"email": "admin@gmail.com",
"password": "123456"
}Response
{
"status": "success",
"message": "Login Successfully",
"data": {
"user": {
"email": "user@gmail.com",
"id": 1021,
"name": "user",
"role": "USER"
},
"tokens": {
"accessToken": "access_token_xxxxxxxxxxxx",
"refreshToken": "refresh_token_xxxxxxxxxxxxx"
}
}
}Use token as:
Authorization: Bearer <accessTOKEN>
| Method | Endpoint | Description | Role |
|---|---|---|---|
| GET | /api/products/lists | Get all products | USER |
| GET | /api/products/{id}/product | Get product by ID | USER |
| POST | /api/products/create | Create product | ADMIN |
| PUT | /api/products/{id}/update | Update product | ADMIN |
| DELETE | /api/products/{id}/delete | Delete product | ADMIN |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/orders | Create new order |
| GET | /api/orders/my | Get all orders |
| GET | /api/orders/{id} | Get order by ID |
| PATCH | /api/orders/{id}/status | Update order status |
POST /api/orders/{id}/pay
POST /api/orders/stripe/webhook
Handles Stripe payment events and updates order status to PAID.
You can test APIs using:
- Postman
- Insomnia
- curl
- All protected routes require JWT token
- Adminβonly endpoints are roleβrestricted
- Stripe webhook signature verification enabled
This project is openβsource.
Kyaw San Oo
GitHub: https://github.com/kyawsanoo2364