How carvalhoglc/loveclothes works
LoveClothes is a clothing e-commerce MVP: shoppers browse product variants, register or log in, create orders that reserve stock, and initiate Pix payments; they can also view order history. The frontend calls a FastAPI backend organized around routes, services, repositories, and a gateway adapter, with PostgreSQL as persistent storage. The README documents the main capabilities and layer structure. Some wiring is only documented, not shown in excerpts, so uncertain frontend-to-endpoint and repository-to-database links are omitted or identified as documented.
Main entry points: deps.py Dependency wiring · main.py App setup · juntos_gateway.py Juntos adapter · auth.py Auth routes
Components 24
Storefront
- Storefront UI
frontend/src/App.tsx - API client
frontend/src/api.ts
API and security
- App setup
backend/app/main.py - Auth routes
backend/app/api/routes/auth.py - Product routes
backend/app/api/routes/products.py - Order routes
backend/app/api/routes/orders.py - Dependency wiring
backend/app/api/deps.py - Request and response DTOs
backend/app/schemas/dtos.py - JWT and passwords
backend/app/core/security.py - Rate limiting
backend/app/core/limiter.py - Error handling
backend/app/core/errors.py
Commerce domain
- Authentication
backend/app/services/auth_service.py - Product catalog
backend/app/services/catalog_service.py - Order and stock
backend/app/services/order_service.py - Payment lifecycle
backend/app/services/payment_service.py - Order states
backend/app/domain/states.py
Persistence
- Data repositories
backend/app/repositories/repositories.py - Commerce entities
backend/app/models/entities.py - Database session
backend/app/db/session.py - PostgreSQL
Payment integration
- Juntos adapter
backend/app/gateways/juntos_gateway.py - Gateway contract
backend/app/gateways/base.py
Other components
- Shopper
- Juntos sandbox
Connections 31
- Shopper → Storefront UI: uses
README.md - Storefront UI → API client: calls
frontend/src/App.tsx - API client → App setup: sends requests
- App setup → Auth routes: registers
backend/app/main.py - App setup → Product routes: registers
backend/app/main.py - App setup → Order routes: registers
backend/app/main.py - Auth routes → Authentication: calls
backend/app/api/routes/auth.py - Product routes → Product catalog: calls
backend/app/api/routes/products.py - Order routes → Order and stock: calls
backend/app/api/routes/orders.py - Order routes → Payment lifecycle: calls
backend/app/api/routes/orders.py - Dependency wiring → Authentication: constructs
backend/app/api/deps.py - Dependency wiring → Product catalog: constructs
backend/app/api/deps.py - Dependency wiring → Order and stock: constructs
backend/app/api/deps.py - Dependency wiring → Payment lifecycle: constructs
backend/app/api/deps.py - Dependency wiring → Data repositories: constructs
backend/app/api/deps.py - Dependency wiring → Juntos adapter: provides
backend/app/api/deps.py - Authentication → JWT and passwords: hashes and verifies
backend/app/services/auth_service.py - Order and stock → Juntos adapter: cancels payments
backend/app/services/order_service.py - Payment lifecycle → Juntos adapter: creates payments
backend/app/services/payment_service.py - Order and stock → Order states: checks transitions
backend/app/services/order_service.py - Payment lifecycle → Order states: checks transitions
backend/app/services/payment_service.py - Juntos adapter → Gateway contract: implements
backend/app/api/deps.py - Juntos adapter → Juntos sandbox: sends HTTP requests
backend/app/gateways/juntos_gateway.py - Data repositories → Commerce entities: uses
backend/app/repositories/repositories.py - Database session → PostgreSQL: opens sessions
README.md - Auth routes → Request and response DTOs: validates and returns
backend/app/api/routes/auth.py - Product routes → Request and response DTOs: returns
backend/app/api/routes/products.py - Order routes → Request and response DTOs: validates and returns
backend/app/api/routes/orders.py - App setup → Error handling: registers handlers
backend/app/main.py - App setup → Rate limiting: configures
backend/app/main.py - Auth routes → Rate limiting: limits requests
backend/app/api/routes/auth.py