Reesource Tracker is a full-stack application for tracking samples, products, and locations. It uses Go for the backend, Bun (with Svelte) for the frontend, and SQLC for type-safe database access.
- Install Go dependencies:
go mod tidy
- Database setup:
- SQLite is used by default. The database file is at
database/db.sqlite. - To initialize or migrate the schema, use the SQL files in
database/schema.sql.
- SQLite is used by default. The database file is at
- SQLC code generation:
- Install SQLC directly via Go:
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
- After installation, restart your terminal to ensure the Go bin directory is in your PATH.
- Generate Go code from SQL queries:
sqlc generate
- This will generate type-safe Go code for database access in
lib/database/query.sql.go.
- Install SQLC directly via Go:
- Run the backend:
Or build and run:
go run main.go
go build -o build/reesource-tracker.exe main.go ./build/reesource-tracker.exe
- Install Bun:
- Install frontend dependencies:
cd client bun install
- Run the frontend dev server:
bun run --bun dev- The app will be available at http://localhost
- SQLC reads SQL queries from
database/query.sqland generates Go code for type-safe database access. - Configuration is in
sqlc.yaml. - After editing SQL files, always run
sqlc generateto update Go code.
- Docker is not required for development. Deployment is handled by GitHub Actions.
main.go- Entry point for the Go backendapi/- API routes and handlerslib/database/- Database models, query code, and wrappersclient/- Frontend (Svelte + Bun)src/- Main source code for the frontendlib/- Shared frontend utilities and componentscomponents/- Reusable Svelte components (UI, forms, etc.)
public/- Static assets served by the frontend
database/- SQLite database and SQL files (schema, queries)build/- Compiled binaries and static build outputs
- Go:
go mod tidy,go run .,go build - Bun:
bun install,bun run --bun dev,bun run --bun build - SQLC:
sqlc generate