How rodrigomoliani/sistemas-distribuidos works
Trabalho 3 is a web e-commerce system composed of REST microservices, local SQLite state, RabbitMQ event transport, SSE updates, and a simulated payment provider with signed webhooks. The main flow starts in the browser, enters the Principal gateway, and coordinates order processing across stock, payment, and delivery; promotions provide a separate email-campaign capability. Some service wiring and event routes are documented but not fully sampled, so those links are marked as documented or left unverified rather than inferred from module names.
Main entry points: mensageria.py AMQP workers · api.py REST and SSE gateway · banco.py Service SQLite · modelo.py Payment state
Components 22
Web client
- Web interface
Trabalho_3/frontend/app.js - Frontend server
Trabalho_3/frontend/server.mjs
Commerce services
- REST and SSE gateway
Trabalho_3/principal/api.py - Order state
Trabalho_3/principal/modelo.py - Stock API
Trabalho_3/estoque/api.py - Stock reservations
Trabalho_3/estoque/modelo.py - Payment API
Trabalho_3/pagamento/api.py - Payment state
Trabalho_3/pagamento/modelo.py - Delivery and invoice
Trabalho_3/entrega/modelo.py - Mock payment provider
Trabalho_3/mock_pagamento/api.py
Shared platform
- Service SQLite
Trabalho_3/comum/banco.py - AMQP workers
Trabalho_3/comum/mensageria.py - Web utilities
Trabalho_3/comum/web.py - Product catalog
Trabalho_3/comum/catalogo.py - Runtime configuration
Trabalho_3/comum/config.py - Event signatures
Trabalho_3/comum/seguranca.py - Service lifecycle
Trabalho_3/comum/processos.py - Webhook verification
Trabalho_3/comum/webhook.py
Promotions
- Campaign worker
Trabalho_3/promocoes/__main__.py - Promotion state
Trabalho_3/promocoes/modelo.py - Email delivery
Trabalho_3/promocoes/email.py
Other components
- Customer
Connections 31
- Customer → Web interface: uses
- Web interface → Frontend server: serves through
- Web interface → REST and SSE gateway: sends REST
- REST and SSE gateway → Order state: updates state
Trabalho_3/principal/api.py - REST and SSE gateway → Stock API: fetches products
Trabalho_3/principal/api.py - Stock API → Stock reservations: routes requests
Trabalho_3/estoque/api.py - REST and SSE gateway → AMQP workers: publishes commands
Trabalho_3/principal/api.py - AMQP workers → REST and SSE gateway: delivers events
Trabalho_3/principal/api.py - AMQP workers → Stock reservations: dispatches events
- AMQP workers → Payment state: dispatches events
- AMQP workers → Delivery and invoice: dispatches events
- Payment API → Payment state: handles payment
Trabalho_3/pagamento/api.py - Payment state → Mock payment provider: creates charge
Trabalho_3/pagamento/modelo.py - Mock payment provider → Payment API: posts webhook
Trabalho_3/mock_pagamento/api.py - Payment API → Webhook verification: verifies signature
Trabalho_3/pagamento/api.py - REST and SSE gateway → Web utilities: uses web utilities
Trabalho_3/principal/api.py - REST and SSE gateway → Service SQLite: reads and writes
Trabalho_3/principal/api.py - Order state → Service SQLite: persists state
Trabalho_3/principal/modelo.py - Stock reservations → Service SQLite: persists reservations
Trabalho_3/estoque/modelo.py - Payment state → Service SQLite: persists charges
Trabalho_3/pagamento/modelo.py - Delivery and invoice → Product catalog: validates orders
Trabalho_3/entrega/modelo.py - Stock reservations → Product catalog: validates products
Trabalho_3/estoque/modelo.py - Payment state → Product catalog: validates orders
Trabalho_3/pagamento/modelo.py - AMQP workers → Event signatures: signs events
Trabalho_3/comum/mensageria.py - AMQP workers → Service SQLite: uses outbox
Trabalho_3/comum/mensageria.py - Webhook verification → Runtime configuration: loads secret
Trabalho_3/comum/webhook.py - Campaign worker → Promotion state: uses promotion state
Trabalho_3/promocoes/__main__.py - Campaign worker → Email delivery: sends campaigns
Trabalho_3/promocoes/__main__.py - Campaign worker → AMQP workers: consumes events
Trabalho_3/promocoes/__main__.py - Campaign worker → Service SQLite: stores campaign data
Trabalho_3/promocoes/__main__.py - REST and SSE gateway → Web interface: streams SSE