How ctrlv-ince/seagrass-ai works
Seagrass supports field collection and meadow assessment: researchers record surveys, inspect detections and spatial maps, and review wave-attenuation predictions. The web app exposes dashboard, survey, detection, wave-model, and map views; the mobile client is documented as camera/GPS-enabled and offline-first. Both clients use the REST API, whose routes cover surveys, detections, predictions, and maps. The backend also documents PostgreSQL/PostGIS and S3/MinIO storage. Some service-to-route wiring is not shown in the excerpts, so those relationships are omitted or marked unverified.
Main entry points: src/App.tsx Web app · router.py API router · mobile/App.tsx Mobile app · surveys.py Survey routes
Components 29
Web application
- Web app
web/src/App.tsx - Dashboard
web/src/pages/Dashboard.tsx - Survey views
web/src/pages/Surveys.tsx - Detection view
web/src/pages/Detection.tsx - Wave model view
web/src/pages/WaveModel.tsx - Map view
web/src/pages/MapView.tsx - Web API client
web/src/api/client.ts
Field application
- Mobile app
mobile/App.tsx - Survey capture
mobile/app/survey/new.tsx - Survey record
mobile/app/survey/[id].tsx - GPS capture
mobile/src/hooks/useLocation.ts - Camera capture
mobile/src/hooks/useCamera.ts - Offline sync
mobile/src/hooks/useOfflineSync.ts - Local survey store
mobile/src/db/schema.ts
Backend API
- API application
backend/app/main.py - API router
backend/app/api/router.py - Survey routes
backend/app/api/surveys.py - Detection routes
backend/app/api/detections.py - Prediction routes
backend/app/api/predictions.py - Map routes
backend/app/api/maps.py
Assessment services
- YOLO detection
backend/app/services/yolo_service.py - Wave regression
backend/app/services/wave_model.py
Data and storage
- PostgreSQL / PostGIS
backend/app/database.py - Survey model
backend/app/models/survey.py - Survey schema
backend/app/schemas/survey.py - Prediction schema
backend/app/schemas/prediction.py - Object storage
backend/app/services/storage.py
Other components
- Researcher
- S3 / MinIO
Connections 30
- Researcher → Web app: uses
- Researcher → Mobile app: collects with
- Web app → Dashboard: routes to
web/src/App.tsx - Web app → Survey views: routes to
web/src/App.tsx - Web app → Detection view: routes to
web/src/App.tsx - Web app → Wave model view: routes to
web/src/App.tsx - Web app → Map view: routes to
web/src/App.tsx - Web app → Web API client: uses API
- Web API client → API application: REST requests
- Mobile app → Survey capture: provides
- Mobile app → Survey record: provides
- Survey capture → GPS capture: captures location
- Survey capture → Camera capture: captures images
- Offline sync → Local survey store: syncs surveys
- Mobile app → API application: REST requests
- API application → API router: mounts routes
backend/app/main.py - API router → Survey routes: registers
backend/app/api/router.py - API router → Detection routes: registers
backend/app/api/router.py - API router → Prediction routes: registers
backend/app/api/router.py - API router → Map routes: registers
backend/app/api/router.py - Survey routes → PostgreSQL / PostGIS: queries
backend/app/api/surveys.py - Detection routes → PostgreSQL / PostGIS: uses session
backend/app/api/detections.py - Prediction routes → PostgreSQL / PostGIS: uses session
backend/app/api/predictions.py - Map routes → PostgreSQL / PostGIS: uses session
backend/app/api/maps.py - Survey routes → Survey model: uses model
backend/app/api/surveys.py - Survey routes → Survey schema: uses schema
backend/app/api/surveys.py - Prediction routes → Prediction schema: uses schema
backend/app/api/predictions.py - Detection routes → YOLO detection: invokes inference
- Prediction routes → Wave regression: runs model
- Object storage → S3 / MinIO: uploads objects
backend/app/services/storage.py