How manuelord21/carrito-compras-go works
Carrito-Compras-GO is a Go web shopping-cart application backed by MySQL. A shopper browses products, adds items to a cart, changes or removes quantities, submits the cart as an order, and views order history. The Go HTTP server routes requests to handlers, which query or update the database and render the corresponding templates. The README identifies Go and MySQL; template details and some UI wiring are inferred only where supported by the sampled handlers and file tree.
Main entry points: main.go HTTP server and routes · header.html Shared templates · footer.html Footer template · public Static assets
Components 17
Web interface
- HTTP server and routes
main.go - Static assets
public - Catalog template
pagina/index.html - Cart template
pagina/lista.html - Orders template
pagina/pedidos.html - Shared templates
pagina/header.html - Footer template
pagina/footer.html
Shopping workflow
- Browse products
main.go - Add to cart
main.go - View cart
main.go - Change quantities
main.go - Remove item
main.go - Submit order
main.go
Order history
- View orders
main.go
Persistence
- Database connection
main.go - MySQL database
Other components
- Shopper
Connections 33
- Shopper → HTTP server and routes: HTTP requests
- HTTP server and routes → Browse products: routes requests
- HTTP server and routes → Add to cart: routes requests
- HTTP server and routes → View cart: routes requests
- HTTP server and routes → Change quantities: routes requests
- HTTP server and routes → Remove item: routes requests
- HTTP server and routes → Submit order: routes requests
- HTTP server and routes → View orders: routes requests
- HTTP server and routes → Static assets: serves files
- Browse products → Database connection: opens connection
- Add to cart → Database connection: opens connection
- View cart → Database connection: opens connection
- Change quantities → Database connection: opens connection
- Remove item → Database connection: opens connection
- Submit order → Database connection: opens connection
- View orders → Database connection: opens connection
- Database connection → MySQL database: connects to
- Browse products → MySQL database: reads products
- Browse products → Catalog template: renders
- Add to cart → MySQL database: inserts cart items
- View cart → MySQL database: reads cart totals
- View cart → Cart template: renders
- Change quantities → MySQL database: updates quantities
- Remove item → MySQL database: deletes cart item
- Submit order → MySQL database: stores order and clears cart
- View orders → MySQL database: reads orders
- View orders → Orders template: renders
- Browse products → Shared templates: parses with pages
- View cart → Shared templates: parses with pages
- View orders → Shared templates: parses with pages
- Browse products → Footer template: parses with pages
- View cart → Footer template: parses with pages
- View orders → Footer template: parses with pages