Go backend for location tracker#1
Merged
Merged
Conversation
Initializes the Go module, minimal HTTP server with health endpoint, Docker Compose with PostGIS, multi-stage Dockerfile, and supporting config files (.env.example, .gitignore additions). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds PostGIS-enabled initial migration (users, circles, circle_members, locations with geography indexes, geofences, schema_migrations) and a migration runner that applies versioned SQL files transactionally on startup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Defines Go structs for all domain entities with JSON tags, using google/uuid for IDs and pointer fields for optional location attributes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds CreateUser/GetUserByEmail/GetUserByID on Store, and CreateCircle (with transaction + admin membership), GetCircleByInviteCode, AddMember (ON CONFLICT DO NOTHING), GetMembers (JOIN with users), and GetUserCircles. Integration tests use unique email suffixes for idempotent re-runs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add chi-based HTTP server with /auth/register and /auth/login endpoints, backed by an AuthStore interface for testability, with unit tests using a mock store. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements InsertLocations (bulk insert with ST_MakePoint), GetLatestLocations (DISTINCT ON per circle member), GetHistory (time-range query), and DeleteLocationsOlderThan. Adds TestInsertAndQueryLocations integration test. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds POST /locations (202), GET /locations/latest, GET /locations/history with JWT auth middleware. Introduces LocationStore interface on Server. Updates NewServer signature and existing auth test to pass nil locations store. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add CircleStore interface, circle route handlers (create, join, get members, get user circles), and update NewServer signature to accept circles store separately from auth store. Move GetCircleByInviteCode/AddMember from AuthStore to CircleStore throughout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add CreateGeofence, GetGeofences, UpdateGeofence, DeleteGeofence, and FindContainingGeofences using ST_DWithin for spatial containment checks. Add TestGeofenceCRUD integration test covering create, list, update, spatial query (inside + outside), and delete. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add GeofenceStore interface and wire handleCreateGeofence, handleGetGeofences, handleUpdateGeofence, handleDeleteGeofence routes. Validate name and radius_meters > 0 on create. Return 204 on delete. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tion Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code