A simple inventory tracking system with basic CRUD operations using PostgreSQL, Go, React with Vite and Tailwind CSS.
Create a database:
createdb inventory_managementCopy the example config and fill in your values:
cp example-config.yaml config.yamlAt minimum, set your database password, admin credentials, and generate JWT secrets:
# Generate two random secrets
openssl rand -base64 64 # use this for jwt_secret
openssl rand -base64 64 # use this for jwt_refresh_secret
config.yamlis gitignored — your secrets stay local.
cd web && bun install && cd ..Start the API and Vite dev server concurrently (two terminals):
# Terminal 1 — Go API (auto-migrates DB schema on startup)
go run cmd/api/main.go
# Terminal 2 — Vite frontend
cd web && bunx --bun viteOr use the Makefile (builds the frontend first, then starts the API):
make runThe API serves at http://localhost:3000 and the Vite dev server at http://localhost:5173 (proxied by the API in production, but during dev the frontend talks directly to the API via CORS).
# Run tests
go test ./...
# Verbose tests
make testv
# Format code
make fmt
# Lint
make lint
# Production build
make build├── cmd/api/main.go # Entry point
├── internal/
│ ├── auth/ # JWT token generation
│ ├── config/ # YAML config loading
│ ├── db/ # PostgreSQL layer, migrations, query builder
│ ├── domain/ # Data models & error types
│ ├── handlers/ # HTTP handlers & middleware
│ └── logger/ # Structured logging (zerolog via slog)
├── web/ # React + Vite + Tailwind frontend
├── config.yaml # Local config (gitignored)
├── example-config.yaml # Template for config.yaml
├── Makefile # Build, test, lint, run shortcuts
└── code-review-todo.md # Outstanding issues tracked from code review
- Create Items
- Read Items
- Update Items
- Delete Items
- Checkout
- Return (frontend non-functional)
- View all checked out items
- Frontend shows checked-out status on items
- Search inventory
- Export Items
- Import Items