Full-stack microservices backend built with Spring Cloud and Docker. Features a central API Gateway for routing, Netflix Eureka for service discovery, and a fully decoupled architecture. Includes a secure Stripe payment flow using webhooks and Cloudinary integration for cloud-based file management. The entire environment is containerized for one-command deployment.
The system follows a distributed microservices architecture using Spring Cloud, fully containerized with Docker.
| Component | Responsibility |
|---|---|
| API Gateway | Single entry point for all client requests. Handles routing and load balancing via lb:// |
| Eureka Server | Service registry for dynamic discovery of all microservices |
| Demand Service | Manages document requests and handles file uploads via Cloudinary |
| Payment Service | Processes payments via Stripe and handles incoming Stripe webhooks |
| MySQL Database | Automatically provisioned via Docker Compose |
| Ngrok | Exposes local services to the internet for Stripe webhook testing |
| Category | Technologies |
|---|---|
| Backend | Java, Spring Boot 3.x, Spring Cloud |
| Database | MySQL 8.0 |
| DevOps | Docker, Docker Compose |
| Payments | Stripe API |
| File Storage | Cloudinary API |
| Documentation | Swagger / OpenAPI 3 |
This project is fully Dockerized. No local Java, Maven, or MySQL installation required.
- Docker Desktop installed and running
- Git installed
git clone https://github.com/ayoubchwt/document-demand-microservices
cd document-demand-microservicesCopy the example environment file and fill in your credentials:
cp .env.example .env| Variable | Where to find it |
|---|---|
CLOUDINARY_CLOUD_NAME |
Cloudinary Dashboard |
CLOUDINARY_API_KEY |
Cloudinary Dashboard |
CLOUDINARY_API_SECRET |
Cloudinary Dashboard |
NGROK_AUTH_TOKEN |
Ngrok Dashboard |
STRIPE_KEY_SECRET |
Stripe Dashboard → Developers → API Keys |
STRIPE_WEBHOOK_SECRET |
Leave empty for now — configured in step 4 |
docker compose up -d --buildOnce the application is running, Ngrok will generate a public HTTPS URL that Stripe uses to deliver webhook events.
- Open the Ngrok inspector at
http://localhost:4040 - Copy your public HTTPS URL (e.g.
https://abcd-1234.ngrok-free.app) - Go to Stripe Dashboard → Developers → Webhooks → Add endpoint
- Set the endpoint URL to:
https://<your-ngrok-url>/payment/webhook - Reveal the signing secret (
whsec_...) and add it to your.env:STRIPE_WEBHOOK_SECRET=whsec_xxx
- Restart the payment service to apply the new secret:
docker compose restart payment-service
| Service | Port | Access |
|---|---|---|
| API Gateway | 8087 | http://localhost:8087 |
| Swagger UI | 8087 | http://localhost:8087/swagger-ui/index.html |
| Eureka Dashboard | 8761 | http://localhost:8761 |
| Demand Service | 8082 | Internal only |
| Payment Service | 8083 | Internal only |
| MySQL | 3306 | localhost:3306 |
| Ngrok Inspector | 4040 | http://localhost:4040 |
All client requests should go through the API Gateway on port 8087. The individual service ports are internal to the Docker network and not intended for direct access.
docker compose down- All inter-service communication happens over the internal Docker network
- Credentials are managed exclusively through the
.envfile and never committed to version control - Stripe webhooks require a running Ngrok instance to reach your local environment
- Each microservice is independently scalable
- JWT / OAuth2 authentication and authorization
- CI/CD pipeline via Jenkins
- Kubernetes deployment manifests
- Centralized logging with Grafana
Distributed under the MIT License. See LICENSE for more information.

