How sinennn/gigjar works
GigJar lets students create USDT payment links for gigs; clients pay into a per-student jar, and a watcher observes TRON transfers so payments can be attributed and confirmed. The API also supports account sessions, jar and payment-link management, and incoming-transfer views; the web screens are scaffolded around those capabilities. The README describes threshold-based sweeps to Cleva as the intended result, but says the sweeper is a future phase. Some internal calls and storage wiring are not visible in the excerpts, so uncertain links are omitted or dashed.
Main entry points: main.go API service · client.ts API client · router.go HTTP router · paylink_handlers.go Payment-link handlers
Components 27
Web experience
- Link screens
apps/web/src/app/(app)/links/page.tsx - Public pay page
apps/web/src/app/pay/[reference]/page.tsx - Jar overview
apps/web/src/app/(app)/dashboard/page.tsx - Activity screens
apps/web/src/app/(app)/transactions/page.tsx - Settlement screen
apps/web/src/app/(app)/settlements/page.tsx - API client
apps/web/src/lib/api/client.ts
API and identity
- API service
services/api/main.go - HTTP router
internal/httpapi/router.go - Auth handlers
internal/httpapi/auth_handlers.go - Identity service
internal/identity/identity.go - Session handling
internal/identity/sessions.go - Jar handlers
internal/httpapi/jar_handlers.go - Payment-link handlers
internal/httpapi/paylink_handlers.go - Transfer handlers
internal/httpapi/transfer_handlers.go
Payment domain
- Payment links
internal/paylinks/paylinks.go - Student jars
internal/jars/jars.go - Incoming transfers
internal/transfers/transfers.go - Double-entry ledger
internal/ledger/ledger.go
Chain observation
- Watcher service
internal/watcher/watcher.go - Reconciliation
internal/watcher/reconcile.go - Chain provider
internal/chain/chain.go - Simulated chain
internal/chain/simulated/simulated.go - TronGrid provider
internal/chain/trongrid/trongrid.go
Persistence and configuration
- Postgres access
internal/database/database.go - Runtime config
internal/config/config.go
Other components
- Student
- Gig client
Connections 35
- Student → Link screens: creates links
README.md - Gig client → Public pay page: opens link
apps/web/src/app/pay/[reference]/page.tsx - Link screens → API client: requests API
- Public pay page → API client: requests API
- API client → API service: fetches /api
README.md - Student → API service: uses account
README.md - API service → Postgres access: connects
services/api/main.go - API service → Identity service: constructs
services/api/main.go - API service → HTTP router: constructs
services/api/main.go - HTTP router → Auth handlers: routes requests
- HTTP router → Jar handlers: routes requests
- HTTP router → Payment-link handlers: routes requests
- HTTP router → Transfer handlers: routes requests
- Auth handlers → Identity service: calls identity
internal/httpapi/auth_handlers.go - Identity service → Session handling: manages sessions
- API service → Student jars: constructs service
services/api/main.go - API service → Payment links: constructs service
services/api/main.go - Payment-link handlers → Payment links: creates and reads
internal/httpapi/paylink_handlers.go - Payment-link handlers → Incoming transfers: loads link transfers
internal/httpapi/paylink_handlers.go - Payment-link handlers → Student jars: wakes watcher
internal/httpapi/paylink_handlers.go - Transfer handlers → Incoming transfers: lists transfers
internal/httpapi/transfer_handlers.go - Transfer handlers → Payment links: resolves reference
internal/httpapi/transfer_handlers.go - Transfer handlers → Simulated chain: sends simulated payment
internal/httpapi/transfer_handlers.go - Watcher service → Chain provider: observes chain
- Watcher service → Incoming transfers: records observations
- Watcher service → Double-entry ledger: posts confirmations
- Reconciliation → Double-entry ledger: checks balances
- Simulated chain → Chain provider: implements
internal/chain/simulated/simulated.go - TronGrid provider → Chain provider: implements
internal/chain/trongrid/trongrid.go - Jar overview → API client: uses endpoints
apps/web/src/app/(app)/dashboard/page.tsx - Activity screens → API client: uses endpoints
- Settlement screen → API client: uses endpoints
- Student → Jar overview: reviews jar
apps/web/src/app/(app)/dashboard/page.tsx - Runtime config → API service: configures startup
services/api/main.go - Runtime config → Watcher service: configures watcher