shop.tonybtw.com
shop.tonybtw.com
https://git.tonybtw.com/shop.tonybtw.com.git
git://git.tonybtw.com/shop.tonybtw.com.git
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 templatesjust build- Build the binary
Database
just db-init- Create database from schemajust db-reset- Drop and recreate databasejust 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
- Clone the repo
- Copy
shop.dbmanually (optional, or recreate withjust db-init) - Copy
.envfile - Run
nix developandmprocs
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