{"id":28300513,"url":"https://github.com/troutlytics/troutlytics-frontend","last_synced_at":"2026-04-14T19:31:43.820Z","repository":{"id":215353733,"uuid":"725774255","full_name":"troutlytics/troutlytics-frontend","owner":"troutlytics","description":"Troutlytics is a web application designed for anglers and wildlife enthusiasts in Washington State. It provides comprehensive, up-to-date information about fish stocking across various water bodies, enhancing the angling experience and promoting environmental awareness.","archived":false,"fork":false,"pushed_at":"2026-03-27T17:13:37.000Z","size":9870,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-28T01:28:21.343Z","etag":null,"topics":["angler","angling","contributing","contributions-welcome","fish","fishing","flask","hatchery","javascript","maps","nextjs","python","react","stocked","trout","typescript","washington"],"latest_commit_sha":null,"homepage":"https://troutlytics.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/troutlytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-30T21:05:58.000Z","updated_at":"2026-03-27T17:13:41.000Z","dependencies_parsed_at":"2024-01-04T01:23:31.752Z","dependency_job_id":"efa5ab95-933b-4a85-bbae-9426da2ed4aa","html_url":"https://github.com/troutlytics/troutlytics-frontend","commit_stats":{"total_commits":97,"total_committers":1,"mean_commits":97.0,"dds":0.0,"last_synced_commit":"d16ff889a69b41f8eec7d96fe2b69c4903371c5e"},"previous_names":["thomas-basham/trout-tracker-wa","troutlytics/troutlytics-frontend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/troutlytics/troutlytics-frontend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troutlytics%2Ftroutlytics-frontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troutlytics%2Ftroutlytics-frontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troutlytics%2Ftroutlytics-frontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troutlytics%2Ftroutlytics-frontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/troutlytics","download_url":"https://codeload.github.com/troutlytics/troutlytics-frontend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troutlytics%2Ftroutlytics-frontend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31812968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angler","angling","contributing","contributions-welcome","fish","fishing","flask","hatchery","javascript","maps","nextjs","python","react","stocked","trout","typescript","washington"],"created_at":"2025-05-23T18:13:15.440Z","updated_at":"2026-04-14T19:31:43.814Z","avatar_url":"https://github.com/troutlytics.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Troutlytics Frontend\n\nPublic site: [troutlytics.com](https://troutlytics.com)  \nBackend repository: [troutlytics-backend](https://github.com/troutlytics/troutlytics-backend)\n\nTroutlytics Frontend is a Next.js app that turns Washington State trout stocking records into an interactive product for anglers, hatchery teams, and fisheries stakeholders.\n\n## Project Purpose\n\nThis README is written for contributors and maintainers.\n\n### Problem\n\n- WDFW trout plant records are public, but raw reports are hard to filter and compare quickly.\n- It is difficult to understand statewide stocking patterns (time, species, hatchery, location) from spreadsheets alone.\n\n### Solution\n\n- Centralized, filterable UI for recent and historical stocking activity.\n- Interactive analytics (time series, composition, distribution, rankings).\n- Geospatial map experience with clustered markers and route links.\n- Hatchery-level profiles that aggregate long-range production patterns.\n\n## Routes + Features\n\n- `/` Home/marketing landing page\n- `/dashboard` Date-range analytics workspace\n- `/map` Interactive statewide stocking map\n- `/hatcheries` Hatchery explorer with all-time insights\n- `/about` Mission and context\n- `/contact` Maintainer contact\n\n### Dashboard modules\n\n- Total stocked over time\n- Cumulative stocking progress\n- Top species trendlines\n- Species composition pie\n- Top waters bar chart\n- Release-size histogram\n- Average fish weight trend\n- Sortable release table\n\n### Map experience\n\n- Leaflet + marker clustering + fullscreen support\n- Popups grouped by coordinate with release details\n- “Get Directions” outbound links per water body\n\n### Hatchery explorer\n\n- Search/filter hatchery names\n- All-time aggregate totals by hatchery\n- Species and top-water breakdowns\n- First/most recent stocking dates + recent events table\n\n## Architecture Overview\n\n- Framework: Next.js (Pages Router), React 19, TypeScript\n- Styling: Tailwind CSS 4 + custom global theme styles\n- Data layer: SWR + context providers\n- Charts: Chart.js via `react-chartjs-2`\n- Map: Leaflet + `leaflet.markercluster` + `leaflet-fullscreen`\n\n### Data flow\n\n1. `ApiDataProvider` owns the active date range state.\n2. `DateRangePicker` updates that range.\n3. `useApiData` fetches filtered API resources via SWR.\n4. Dashboard and map components consume shared context data.\n5. Hatchery page uses `HatcheryDataProvider` for all-time aggregation logic.\n\n## Backend API Usage\n\nThe frontend reads from the Troutlytics backend API.\n\nCurrent endpoints used:\n\n- `/stocked_lakes_data` (date-range filtered)\n- `/hatchery_totals` (date-range filtered)\n- `/total_stocked_by_date_data` (date-range filtered)\n- `/stocked_lakes_data_all_time`\n- `/hatchery_names`\n- `/date_data_updated`\n- `/derby_lakes_data` (fetched but not currently surfaced in UI)\n\nEnvironment-controlled API base:\n\n- `NEXT_PUBLIC_ENVIRONMENT=dev` -\u003e `http://localhost:8080`\n- any other value -\u003e `https://xtczssso08.execute-api.us-west-2.amazonaws.com`\n\n## Local Development\n\n### Prerequisites\n\n- Node.js (18+ recommended)\n- npm\n- Running Troutlytics backend service (local or remote)\n\n### Setup\n\n1. Install dependencies.\n\n   ```bash\n   npm install\n   ```\n\n2. Configure environment in `.env.local`.\n\n   ```bash\n   NEXT_PUBLIC_ENVIRONMENT=\"dev\"\n   ```\n\n3. Start the frontend.\n\n   ```bash\n   npm run dev\n   ```\n\n4. Open `http://localhost:3000`\n\n## Environment Variables\n\n- `NEXT_PUBLIC_ENVIRONMENT`\n  - `dev` uses local backend (`http://localhost:8080`)\n  - anything else uses production API Gateway endpoint\n- `NEXT_PUBLIC_HATCHERY_DATA_START` (optional)\n  - Used by hatchery analytics context\n  - Defaults to `2010-01-01` if not provided\n\n## Available Scripts\n\n- `npm run dev` Start local dev server (Turbopack)\n- `npm run build` Build production bundle\n- `npm run start` Start production server\n- `npm run lint` Run Next.js lint checks\n- `npm test` Run Jest tests\n\n## Testing\n\n- Jest + Testing Library are configured for component tests.\n- Chart rendering is mocked in tests to avoid JSDOM canvas limitations.\n- Current suite can be run with:\n\n  ```bash\n  npm test\n  ```\n\n## Deployment\n\n### Current production setup\n\n- Frontend host: AWS Amplify (serving `troutlytics.com`)\n- Backend API: AWS API Gateway endpoint consumed by this frontend\n- Domain routing: `troutlytics.com` points at Amplify-hosted frontend\n\n### Contributor deployment notes\n\n- This repo does not include infrastructure-as-code for Amplify configuration.\n- Amplify environment variables must include `NEXT_PUBLIC_ENVIRONMENT` set to a non-`dev` value (commonly `prod`).\n- If new required env vars are added in code, add them to Amplify before shipping.\n- Validate production build locally before release:\n\n  ```bash\n  npm run build\n  npm run start\n  ```\n\n### Release checklist\n\n1. Run `npm run lint`\n2. Run `npm test`\n3. Run `npm run build`\n4. Confirm API reads production endpoint when `NEXT_PUBLIC_ENVIRONMENT` is not `dev`\n5. Merge/deploy through the Amplify-connected branch workflow\n\n## Data Source\n\n- Washington Department of Fish and Wildlife trout plant reports:  \n  [https://wdfw.wa.gov/fishing/reports/stocking/trout-plants](https://wdfw.wa.gov/fishing/reports/stocking/trout-plants)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroutlytics%2Ftroutlytics-frontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftroutlytics%2Ftroutlytics-frontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroutlytics%2Ftroutlytics-frontend/lists"}