How juliancumps/bristol-predict works
Project Type and Purpose
• This is a full-stack interactive display for Bristol Bay salmon runs.
• Front-end: React + Vite + Mapbox GL JS for map visualization and time-series controls.
• Backend: Node.js/Express scrapers + API server (currently in development).
• Storage: SQL database (planned PostgreSQL).
• External services: ADF&G data, Port Moller fishery data, weather APIs, Mapbox.
Main Components
a. Front-end UI
• React app (src/)
• Mapbox map component, time slider, sidebar
• Build & bundling: Vite (vite.config.js)
b. Backend API & Scrapers
• Express server (backend/src/server.js)
• Data scrapers (backend/src/scrapers/harvestScraper.js)
• DB interface & schema (backend/src/db/schema.sql)
c. Database
• PostgreSQL (future) implementing schema.sql
d. External Data Sources
• Alaska Dept. Fish & Game API
• Port Moller test fishery data
• Weather service APIs
• Mapbox (tile & style service)
Relationships & Data Flow
1. End-user interacts with React UI in browser.
2. UI makes HTTP(S) requests to Node/Express API for data (raw counts, time series).
3. Express server invokes scrapers (manual or scheduled) to fetch external data, writes into SQL DB.
4. API endpoints query the DB, return JSON to the UI.
5. UI renders map tiles via Mapbox GL JS (direct browser→Mapbox CDN).
Important Architectural Patterns
• Separation of concerns: UI vs. API vs. Data layer
• Modular scrapers: Each scraper module encapsulates one external source
• Future extensibility: ML pipeline can read/write same DB, expose prediction endpoints
Technologies & Frameworks
• Front-end: React, Vite, Mapbox GL JS
• Backend: Node.js, Express
• Database: PostgreSQL (planned)
• Scheduling: cron/job runner (future)
• Deployment: Docker containers or managed cloud (future)
Final Checklist
• All major components (UI, API, DB, external).
• Notes on config (.env keys), build tools (Vite/Node), and technologies.