01 / Full-stack / Backend
ShelfLife
Produce freshness tracker
A produce freshness app with a Go backend for authenticated preferences, persistent data, and real-time confirmations.
Implemented · Team project01 / Context
Problem statement
Freshness tracking needs notification preferences that stay consistent across sessions and devices. The backend must associate each request with the correct user and handle repeat subscription requests without creating duplicate records.
02 / Approach
Solution overview
A React and TypeScript client integrates with a Go/Gin service and Supabase. The backend exposes versioned settings and Web Push registration endpoints, persists user-scoped data in PostgreSQL, and provides WebSocket confirmations after settings updates.
03 / Toolkit
Technology stack
- Go
- Gin
- React
- TypeScript
- PostgreSQL
- Supabase JWT
- WebSockets
- AWS EC2
- GitHub Actions
04 / Structure
System architecture
Bearer JWTs pass through authentication middleware before reaching /v1 settings and subscription handlers. Queries use the authenticated user ID and a shared pgx connection pool. The WebSocket hub groups clients by user; a GitHub Actions workflow builds the Go service on EC2 and restarts it with systemd.
05 / Ownership
My contributions
- Implemented the initial Go settings API and PostgreSQL schema migrations.
- Added the Web Push device registration endpoint with repeat-safe subscription upserts.
- Expanded backend/frontend test coverage and software development documentation.
Public commit history attributes these contributions to my GitHub account. WebSocket wiring and subsequent settings changes also include collaborator contributions; the complete application is team work.
06 / Engineering
Challenges & design decisions
Make repeated writes safe
ON CONFLICT updates the existing subscription for a user/endpoint pair, so registering the same device again does not create a duplicate.
Keep data scoped to the caller
JWT middleware extracts the user identity; settings and subscription handlers use that identity in their database queries.
Separate persistence from feedback
PostgreSQL stores settings while the user-routed WebSocket hub provides immediate confirmation to connected clients.
07 / Correctness
Testing & reliability
The repository includes JWT middleware tests, database pool tests, WebSocket hub tests, and frontend service/component tests. Input checks cover notification times, time zones, day ranges, and required subscription fields.
08 / Progress
Results & current status
Implemented backend endpoints, database migrations, React/TypeScript integration, and an EC2 deployment workflow. Source code and contribution history are linked below.
09 / Further reading