How glaybyonest/marketplace works
Marketplace is a full-stack platform for buyers, sellers, and administrators. Buyers browse and search products, manage favorites and a cart, then check out; accounts also cover profiles, delivery places, orders, sessions, and messaging. Seller and admin workflows manage storefronts, products, orders, and catalog categories. The React client calls a Go REST API backed by PostgreSQL. The backend also runs email and recommendation jobs, exposes health and metrics endpoints, and supports an optional OpenAI seller-product assistant. Some feature links rely on README documentation because their source was not sampled.
Main entry points: app.go App composition · router.go REST router · App.tsx Web app · postgres PostgreSQL repositories
Components 23
Marketplace client
- Web app
frontend/src/App.tsx - Client routes
frontend/src/routes/AppRouter.tsx - API services
frontend/src/services - Product service
frontend/src/services/productService.ts - Client state
frontend/src/store
HTTP API
- REST router
internal/http/router.go - Auth handlers
internal/http/handlers/auth.go - Feature handlers
internal/http/handlers - OpenAPI docs
apidocs/http.go
Domain services
- Authentication
internal/usecase/auth.go - Commerce services
internal/usecase - Seller AI assistant
internal/usecase/seller_ai.go - PostgreSQL repositories
internal/repository/postgres
Platform operations
- API process
cmd/api/main.go - App composition
internal/app/app.go - Background jobs
internal/jobs/tasks.go - Queued mail sender
internal/mailer/mailer.go - OpenAI client
internal/integrations/openai/client.go - Health and metrics
internal/observability
Other components
- Buyer
- Seller
- Administrator
- PostgreSQL
Connections 28
- Buyer → Web app: uses
README.md - Seller → Web app: uses
README.md - Administrator → Web app: uses
README.md - Web app → Client routes: renders
frontend/src/App.tsx - Client routes → API services: dispatches requests
- API services → REST router: calls REST API
README.md - Product service → REST router: calls REST API
README.md - Web app → Client state: dispatches actions
frontend/src/App.tsx - API process → App composition: starts
cmd/api/main.go - App composition → REST router: configures
internal/app/app.go - REST router → Auth handlers: routes auth
internal/http/router.go - REST router → Feature handlers: routes features
internal/http/router.go - Auth handlers → Authentication: delegates to
- Feature handlers → Commerce services: delegates to
- App composition → Authentication: constructs
internal/app/app.go - App composition → Commerce services: constructs
internal/app/app.go - App composition → Seller AI assistant: constructs
internal/app/app.go - Commerce services → PostgreSQL repositories: uses
- Authentication → PostgreSQL repositories: uses
- PostgreSQL repositories → PostgreSQL: reads and writes
- App composition → Background jobs: starts
internal/app/app.go - Background jobs → Queued mail sender: sends queued mail
internal/jobs/tasks.go - Background jobs → PostgreSQL repositories: refreshes data
- App composition → OpenAI client: configures optional provider
internal/app/app.go - Seller AI assistant → OpenAI client: requests generation
- App composition → Health and metrics: configures
- REST router → Health and metrics: exposes endpoints
internal/http/router.go - REST router → OpenAPI docs: serves docs
internal/http/router.go