How shurco/mycart works
myCart is a self-hosted shopping cart with an embedded SQLite default (or PostgreSQL), an admin dashboard, and a public storefront. The main journey is a buyer browsing products, creating a cart, paying through a supported provider, and retrieving purchases; store operators install the app and manage catalog, content, customers, and settings through the dashboard. Routes dispatch to Go handlers, which use query/database services for persistent state. The README documents digital goods, customer accounts, variants, multilingual UI, and payment integrations. Some subsystem links are documented rather than verified in unsampled source.
Main entry points: cart.go Cart and checkout · api_public_routes.go Public API routes · queries.go Data queries · app.go HTTP application
Components 24
Application Runtime
- HTTP application
internal/app.go - Admin API routes
internal/routes/api_private_routes.go - Public API routes
internal/routes/api_public_routes.go - Storefront routes
internal/routes/site_routes.go
Storefront and Catalog
- Public storefront
web/site/src/routes - Catalog and pages
internal/handlers/public/product.go
Checkout and Accounts
- Cart and checkout
internal/handlers/public/cart.go - Customer accounts
internal/handlers/public/customer.go - Digital goods
internal/digitalfiles/digitalfiles.go - Payment providers
pkg/litepay/provider.go - Payment webhooks
internal/webhook/payment.go - Customer email
internal/mailer/mailer.go
Administration
- Admin dashboard
web/admin/src/routes - Admin handlers
internal/handlers/private/product.go - Product variants
web/admin/src/lib/components/product/VariantManager.svelte - Product CSV import
pkg/csvimport/importer.go
Persistence and Integrations
- Domain models
internal/models/products.go - Data queries
internal/queries/queries.go - SQLite / PostgreSQL
internal/database/open.go - Database transfer
internal/dbtransfer/copy.go
Other components
- Store operator
- Shopper
- SMTP service
- Payment gateway
Connections 27
- Store operator → Admin dashboard: manages store
README.md - Shopper → Public storefront: browses and buys
README.md - HTTP application → Admin API routes: registers routes
internal/app.go - HTTP application → Public API routes: registers routes
internal/app.go - HTTP application → Storefront routes: registers routes
internal/app.go - Admin API routes → Admin handlers: dispatches requests
internal/routes/api_private_routes.go - Public API routes → Cart and checkout: dispatches checkout
internal/routes/api_public_routes.go - Public API routes → Catalog and pages: dispatches browsing
internal/routes/api_public_routes.go - Public API routes → Customer accounts: dispatches account API
internal/routes/api_public_routes.go - Storefront routes → Public storefront: serves app
internal/routes/site_routes.go - Admin dashboard → Admin API routes: calls admin API
- Public storefront → Public API routes: calls public API
- Product variants → Admin dashboard: edits product data
- Admin handlers → Product CSV import: imports products
- Admin handlers → Data queries: reads and writes
- Catalog and pages → Data queries: reads catalog
- Cart and checkout → Data queries: reads and writes
internal/handlers/public/cart.go - Cart and checkout → Payment providers: requests payment
internal/handlers/public/cart.go - Cart and checkout → Payment webhooks: sends notifications
internal/handlers/public/cart.go - Cart and checkout → Customer email: sends purchase mail
internal/handlers/public/cart.go - Customer accounts → Data queries: reads purchases
- Digital goods → Domain models: uses digital records
internal/digitalfiles/digitalfiles.go - Payment providers → Payment gateway: integrates payments
- Payment webhooks → Payment gateway: receives callbacks
- Customer email → SMTP service: delivers email
- Data queries → SQLite / PostgreSQL: persists data
- Database transfer → SQLite / PostgreSQL: copies database