https://github.com/alexisrodriguezcs/ecommerce-infra
Infrastructure setup with Docker, CI/CD, ELK logging, Postman, and documentation.
https://github.com/alexisrodriguezcs/ecommerce-infra
ci-cd devops docker documentation elk-stack microservices postman
Last synced: about 1 month ago
JSON representation
Infrastructure setup with Docker, CI/CD, ELK logging, Postman, and documentation.
- Host: GitHub
- URL: https://github.com/alexisrodriguezcs/ecommerce-infra
- Owner: AlexisRodriguezCS
- Created: 2025-04-12T01:56:34.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-12T18:55:12.000Z (about 1 year ago)
- Last Synced: 2025-04-12T19:38:59.212Z (about 1 year ago)
- Topics: ci-cd, devops, docker, documentation, elk-stack, microservices, postman
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐๏ธ Infrastructure โ E-commerce Backend
This repository contains the foundational infrastructure and shared tooling for a production-grade **microservices-based e-commerce backend** built with Java Spring Boot. It follows best practices in architecture, DevOps, and observability to enable scalability and maintainability.
> โ ๏ธ **Note:** This project is under active development and evolving to meet real-world engineering standards.
---
## ๐ฆ What's Included
### ๐ง Development & Deployment Tooling
- **Docker Compose**: Local development environment for all services
- **PostgreSQL / Redis /RabbitMQ**: Core infrastructure services
- **Spring Cloud Config Server**: Centralized and externalized configuration
- **Service Discovery (Eureka)**: Dynamic service registry
- **API Gateway**: Powered by Spring Cloud Gateway with JWT validation and rate limiting
- **Secret Management**: `.env` templating and Vault integration
### ๐ CI/CD Tooling
- Pre-built **GitHub Actions** workflows for:
- Build and test pipelines
- Docker image publishing
- Integration testing with Testcontainers
- Code linting and formatting
### ๐ Observability Stack
- **ELK Stack**: Centralized logging using Elasticsearch, Logstash, and Kibana
- **Custom log configurations** in each microservice for consistency and traceability
---
## ๐ Project Structure
| Repository | Description |
|---------------------------------------------------------------------------------------------------------|------------------------------------------|
| [`ecommerce-auth-service`](https://github.com/AlexisRodriguezCS/ecommerce-auth-service) | JWT-based authentication and RBAC |
| [`ecommerce-user-service`](https://github.com/AlexisRodriguezCS/ecommerce-user-service) | User profile management and account details |
| [`ecommerce-product-service`](https://github.com/AlexisRodriguezCS/ecommerce-product-service) | Product catalog management |
| [`ecommerce-inventory-service`](https://github.com/AlexisRodriguezCS/ecommerce-inventory-service) | Inventory tracking and stock updates |
| [`ecommerce-order-service`](https://github.com/AlexisRodriguezCS/ecommerce-order-service) | Order creation and processing |
| [`ecommerce-payment-service`](https://github.com/AlexisRodriguezCS/ecommerce-payment-service) | Payment orchestration and workflows |
| [`ecommerce-notification-service`](https://github.com/AlexisRodriguezCS/ecommerce-notification-service) | Email and SMS notifications |
| [`ecommerce-api-gateway`](https://github.com/AlexisRodriguezCS/ecommerce-api-gateway) | Gateway layer with auth and throttling |
| [`ecommerce-discovery-server`](https://github.com/AlexisRodriguezCS/ecommerce-discovery-server) | Eureka Discovery Server |
| [`ecommerce-config-server`](https://github.com/AlexisRodriguezCS/ecommerce-config-server) | Spring Cloud Config Server |
| [`ecommerce-config-repo`](https://github.com/AlexisRodriguezCS/ecommerce-config-repo) | Centralized config files and secrets |
| **This Repo** | Infrastructure: Docker, ELK, CI/CD, docs |
---
## ๐ซ Postman Collections
Postman request collections and test suites are available in `/postman`. You can import these into Postman to test microservices during development.
---
## ๐งช Testing Strategy
Each microservice is built with a layered testing strategy:
- โ
**Unit tests** for business logic
- โ
**Integration tests** using **Testcontainers** for real dependencies (DB, MQ, etc.)
- ๐ **End-to-end smoke tests** using Postman & Newman (WIP)
---
## ๐๏ธ Documentation
All system documentation is maintained under `/docs`, including:
- ๐งฑ System Architecture (UML Diagrams)
- ๐งช Local Dev Setup Guide
- ๐ CI/CD Pipeline Reference
- ๐ Secret & Config Strategy
---
## ๐ฃ๏ธ Roadmap
- [ ] Docker Compose for full dev environment
- [ ] CI/CD GitHub Actions templates
- [ ] ELK logging infrastructure
- [ ] Rate limiting via Redis token buckets
- [ ] Vault-based secret management
---
## ๐ Secrets Management
This project uses a secure, real-world approach to secrets management for both local development and production environments.
### ๐ป Local Development
Secrets are managed using:
- **`.env` files** โ used by infrastructure like PostgreSQL and Redis
- **HashiCorp Vault** (dev mode via Docker) โ used by application services (e.g., `auth-service`, `user-service`)
- **Docker Compose** โ coordinates everything and runs the Vault bootstrap process
- **GitHub Actions** uses **Encrypted Secrets** to securely pass credentials during CI/CD workflows.
> โ
**Note:** Infrastructure (e.g., databases) read credentials from `.env`, while services read their secrets from Vault. Also, `.env` and `vault/secrets/*.json` are excluded from version control via `.gitignore` to prevent accidental leakage.
### โ๏ธ Vault Secret Initialization
The Vault container runs a custom `vault-init.sh` script to initialize secrets for each service.
Example `vault/secrets/auth-service/dev.json.example`
```json
{
"AUTH_DB" : "your_db_here",
"AUTH_DB_USERNAME": "your_username_here",
"AUTH_DB_PASSWORD": "your_password_here"
}
```
### ๐ **How to use it:**
1. Copy and fill in your values into:
```bash
vault/secrets/auth-service/dev.json.example
```
2. Ensure your `.env` file includes the corresponding values for the Vault:
```env
VAULT_DEV_ROOT_TOKEN_ID=root
VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200
VAULT_ADDR=http://127.0.0.1:8200
```
3. Run using makefile:
```bash
make up
```
### โ๏ธ Production (Planned)
---
## ๐ Contributions
This is a personal project designed with production-quality engineering practices. Contributions are welcome if aligned with the overall vision and architecture.
---
## ๐ฌ Contact
Maintained by [Alexis Rodriguez](https://github.com/AlexisRodriguezCS)