shop.tonybtw.com

shop.tonybtw.com

https://git.tonybtw.com/shop.tonybtw.com.git git://git.tonybtw.com/shop.tonybtw.com.git
1,828 bytes raw

shop.tonybtw.com - Next Steps

Quick Start

# 1. Enter nix shell
nix develop

# 2. Initialize database
just db-init

# 3. Start dev server with hot reload
mprocs

Visit http://localhost:8080


Project Structure

cmd/server/          - Main application entry point
internal/
  ├── handlers/      - HTTP handlers (routes)
  ├── models/        - Database models & queries
  └── views/         - Templ templates
public/static/       - CSS, images, etc.
schema.sqlite.sql    - Database schema

Available Commands

Development

  • mprocs - Start dev server with hot reload (templ + air)
  • just dev - Generate + build + run (no hot reload)
  • just generate - Generate Go code from templ templates
  • just build - Build the binary

Database

  • just db-init - Create database from schema
  • just db-reset - Drop and recreate database
  • just db-shell - Open SQLite shell

Environment Variables

Create .env file:

STRIPE_SECRET_KEY=sk_test_...
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
PRINTFUL_API_KEY=...

Deploying to Another Machine

  1. Clone the repo
  2. Copy shop.db manually (optional, or recreate with just db-init)
  3. Copy .env file
  4. Run nix develop and mprocs

Tech Stack

  • Go - Backend
  • Templ - Type-safe HTML templating
  • SQLite - Database
  • HTMX - Frontend interactivity
  • Stripe - Payments
  • Printful - Print-on-demand fulfillment

TODO

  • [ ] Add session management (cookies/JWT)
  • [ ] Implement cart persistence across sessions
  • [ ] Add product image uploads
  • [ ] Set up deployment (fly.io/railway/etc)
  • [ ] Add order confirmation emails
  • [ ] Implement webhook retry logic
  • [ ] Add admin panel for product management
  • [ ] Add tests