How cs5224-group-9/thepetstop works
PetStop is a Singapore pet-owner web app: owners sign in, discover licensed facilities, manage pet passports and reminders, and shop across merchants with simulated checkout. The graph emphasizes the frontend-to-API workflow, separates the documented facility-ingestion stages, and includes identity, storage, and infrastructure capabilities. README descriptions cover ingestion wiring not shown in source excerpts; those relationships are documented rather than inferred from unsampled code.
Main entry points: wsgi.py Django API · app-provider.tsx App state · fetch.py Registry fetch · recovery.py Run recovery
Components 34
Owner web app
- Next.js pages
frontend/app/page.tsx - App state
frontend/components/app-provider.tsx - API services
frontend/lib/api/services.ts - HTTP client
frontend/lib/api/client.ts - Response adapters
frontend/lib/api/adapters.ts - Pet passports
frontend/components/pets.tsx - Facility discovery
frontend/components/directory.tsx - Marketplace UI
frontend/components/marketplace.tsx - Authentication
frontend/lib/auth/cognito.ts
Backend services
- Django API
backend/config/wsgi.py - Accounts
backend/accounts/views.py - Pet profiles
backend/pets/views.py - Pet uploads
backend/pets/uploads.py - Marketplace
backend/marketplace/views.py - Checkout
backend/marketplace/checkout.py - Facility directory
backend/facilities/views.py - Location search
backend/facilities/search_handler.py - OneMap client
backend/facilities/onemap.py - PostgreSQL
backend/api/models.py - File storage
backend/api/storage.py
Facility ingestion
- Lambda handlers
backend/facilities/ingestion/handlers.py - Registry fetch
backend/facilities/ingestion/fetch.py - Queue dispatch
backend/facilities/ingestion/dispatch.py - Address geocoding
backend/facilities/ingestion/geocoding.py - Snapshot finalize
backend/facilities/ingestion/finalize.py - Database loader
backend/facilities/ingestion/loading.py - Run recovery
backend/facilities/ingestion/recovery.py - Run status
backend/facilities/ingestion/status.py - AWS helpers
backend/facilities/ingestion/aws.py
AWS platform
- S3 snapshots
- SQS queue
- Amazon Cognito
- API stack
infra/lib/api-stack.ts
Other components
- Pet owner
Connections 40
- Pet owner → Next.js pages: uses
README.md - Next.js pages → App state: renders
- App state → Authentication: authenticates
frontend/components/app-provider.tsx - App state → API services: loads domains
frontend/components/app-provider.tsx - API services → HTTP client: requests
frontend/lib/api/services.ts - API services → Response adapters: maps responses
frontend/lib/api/services.ts - App state → Pet passports: provides state
frontend/components/pets.tsx - App state → Facility discovery: provides state
- App state → Marketplace UI: provides state
- Authentication → Amazon Cognito: signs in
- HTTP client → Django API: HTTP requests
- Django API → Accounts: routes requests
- Django API → Pet profiles: routes requests
- Django API → Marketplace: routes requests
- Django API → Facility directory: routes requests
- Django API → PostgreSQL: persists data
- Pet profiles → Pet uploads: handles uploads
- Pet uploads → File storage: stores files
- Marketplace → Checkout: delegates checkout
- Location search → OneMap client: searches addresses
backend/facilities/search_handler.py - Lambda handlers → Registry fetch: dispatches fetch
backend/facilities/ingestion/handlers.py - Lambda handlers → Address geocoding: dispatches geocoding
backend/facilities/ingestion/handlers.py - Lambda handlers → Database loader: loads events
backend/facilities/ingestion/handlers.py - Lambda handlers → Run recovery: dispatches recovery
backend/facilities/ingestion/handlers.py - Registry fetch → Queue dispatch: dispatches batches
backend/facilities/ingestion/fetch.py - Registry fetch → Run status: reads run state
backend/facilities/ingestion/fetch.py - Address geocoding → Run status: uses run state
backend/facilities/ingestion/geocoding.py - Address geocoding → Snapshot finalize: finalizes snapshot
backend/facilities/ingestion/geocoding.py - Database loader → Run status: uses run state
backend/facilities/ingestion/loading.py - Database loader → PostgreSQL: writes facilities
backend/facilities/ingestion/loading.py - Run recovery → Run status: checks run state
backend/facilities/ingestion/recovery.py - Run recovery → Queue dispatch: resumes batches
backend/facilities/ingestion/recovery.py - Run recovery → Registry fetch: restarts fetch
backend/facilities/ingestion/recovery.py - Run recovery → Snapshot finalize: recovers snapshot
backend/facilities/ingestion/recovery.py - Registry fetch → S3 snapshots: stores manifest
- Registry fetch → SQS queue: sends batches
- Address geocoding → S3 snapshots: stores results
- SQS queue → Address geocoding: triggers asynchronously
README.md - S3 snapshots → Database loader: triggers ready load
README.md - API stack → Django API: deploys API