Marketplace Consumer-to-Consumer desarrollado con arquitectura de microservicios. Plataforma que conecta compradores y vendedores para transacciones de productos de segunda mano con geolocalización.
- Autenticación segura con JWT en cookies HttpOnly + bcrypt
- Geolocalización de usuarios y productos con PostGIS
- Chat en tiempo real con WebSockets (Socket.IO)
- Gestión de imágenes con conversión automática a WebP
- API Gateway con rate limiting y headers de seguridad
┌─────────────────────────────────────────────────────────────┐
│ Frontend │
│ React + TypeScript + Vite │
└─────────────────────────┬───────────────────────────────────┘
│ HTTPS
▼
┌─────────────────────────────────────────────────────────────┐
│ Nginx Gateway │
│ SSL/TLS • Rate Limiting • Security Headers │
└─────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ BFF (Backend For Frontend) │
│ Proxy Reverso • Helmet • Error Handling │
└────┬──────────────┬──────────────┬──────────────┬───────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌─────────┐ ┌──────────┐
│ Auth │ │ Catalog │ │ Media │ │ Chat │
│ :3001 │ │ :3002 │ │ :3003 │ │ :3004 │
└────┬────┘ └────┬─────┘ └────┬────┘ └────┬─────┘
│ │ │ │
└─────────────┴──────┬───────┴──────────────┘
│
▼
┌───────────────────────┐
│ PostgreSQL + PostGIS │
│ auth_db │
│ catalog_db │
│ chat_db │
└───────────────────────┘
| Capa | Tecnología |
|---|---|
| Frontend | React, TypeScript, Vite |
| Gateway | Nginx (SSL, Rate Limiting) |
| Backend | Fastify (Node.js) |
| Base de Datos | PostgreSQL + PostGIS |
| Mensajería | Socket.IO (WebSockets) |
| Imágenes | Sharp (WebP conversion) |
| Contenedores | Docker + Docker Compose |
| CI/CD | GitHub Actions |
- Docker & Docker Compose
- Make
# Clonar repositorio
git clone https://github.com/your-org/vento.git
cd vento
# Levantar todos los servicios
make build
make up
# Acceder a la aplicación
open https://localhostmake up # Iniciar servicios
make down # Detener servicios
make logs # Ver logs en tiempo real
make re # Rebuild completo
make fclean # Limpieza total (volumes, images)| Servicio | Puerto | Responsabilidad |
|---|---|---|
| Auth | 3001 | Autenticación, usuarios, JWT |
| Catalog | 3002 | Productos, categorías, favoritos |
| Media | 3003 | Upload de imágenes, conversión WebP |
| Chat | 3004 | Mensajería en tiempo real |
| BFF | 3000 | Proxy reverso, orquestación |
- Passwords: bcrypt con 10 rondas de salt
- Autenticación: JWT en cookies HttpOnly + Secure + SameSite
- SQL Injection: Prepared statements en todas las queries
- XSS: HttpOnly cookies, Content-Type validation
- CSRF: SameSite=Lax, headers de seguridad
- DDoS: Rate limiting 500 req/min por IP
- Headers: HSTS, X-Frame-Options, X-Content-Type-Options
Nginx → Rate Limit + Security Headers
↓
BFF → Helmet + Error Handler
↓
Services → JWT Verify + Schema Validation + Prepared Statements
- Sprints: 2 semanas
- Daily Standups: 15 minutos
- Sprint Planning y Retrospectivas
- Product Backlog en GitHub Projects
# .github/workflows/ci.yml
- Lint (ESLint)
- Commit format (Commitlint)
- Build Docker images
- Run tests| Branch | Propósito |
|---|---|
main |
Producción estable |
develop |
Integración |
feature/* |
Nuevas funcionalidades |
fix/* |
Corrección de bugs |
feat: add user registration endpoint
fix: resolve login validation bug
docs: update API documentation
refactor: simplify auth middlewarevento/
├── docker-compose.yml # Orquestación de servicios
├── Makefile # Comandos de desarrollo
├── .github/ # CI/CD workflows
├── infra/
│ ├── nginx/ # Gateway configuration
│ └── postgres/ # Database initialization
└── services/
├── auth/ # Authentication service
├── bff/ # Backend for Frontend
├── catalog/ # Product listings
├── chat/ # Real-time messaging
├── media/ # Image processing
└── frontend/ # React application
# Test de endpoints Auth
curl -X POST https://localhost/api/auth/signup \
-H "Content-Type: application/json" \
-d '{"email":"test@test.com","password":"12345678","name":"Test","lastNames":"User","lat":40.4,"lng":-3.7}'
# Test de upload Media
curl -F "files=@image.jpg" https://localhost/api/media/upload
# Verificar servicios
curl https://localhost/api/media/ # Health check
curl https://localhost/api/catalog/categories # CategoríasCada microservicio tiene su propio README con:
- Endpoints disponibles
- Medidas de seguridad implementadas
- Guía de integración para otros servicios
- Variables de entorno
Ver:
- Auth Service
- BFF Service
- Media Service
- Catalog Service
- Chat Service (en desarrollo)
Este proyecto está bajo la licencia MIT. Ver LICENSE para más detalles.