Repository navigation
Conversation
Rebuilt on current main after the frontend/ML monorepo merge — the original commits were based on the pre-merge root-level layout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
✅ Deploy Preview for p-ickup ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Sonnet 5 <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.
Context
Adds the admin UI for triggering the ride-matching algorithm, which now runs as a real service (deployed in aspc-website-v2, see that repo's PR #254) instead of a local CLI script. This PR only adds the frontend page + proxy routes; it does not touch the algorithm itself.
Describe your changes
frontend/src/app/admin/matching/page.tsx— new/admin/matchingroute, behind the existing admin auth layout.frontend/src/components/admin/MatchingAlgorithm.tsx— "Run Matching" UI. Always pulls riders from the database (no manual/preview mode) and commits the result directly via the service's/runendpoint, which writes groups/matches to Supabase and consumes vouchers. Shows a confirmation dialog before running, since this is not undoable or previewable from here.frontend/src/app/api/admin/matching/run/route.tsand.../status/route.ts— server-only proxy routes. The browser never talks to the algorithm service directly; these forward toALGORITHM_SERVICE_URLwithALGORITHM_SERVICE_API_KEY.frontend/src/components/admin/AdminDashboard.tsx— added a "Run Matching Algorithm" button next to "View & Manage Groups".frontend/.env.example— documents the two new server-only env vars and how they map to aspc-website-v2'sML_PROXY_API_KEYsecret.Before this works in prod:
ALGORITHM_SERVICE_URLandALGORITHM_SERVICE_API_KEYneed to be set in this project's Vercel settings, once aspc-website-v2's PR #254 is deployed.Testing
tsc --noEmit,eslint, andprettier --checkall clean on every changed file.264/264existing Jest tests passing (unchanged by this PR). Note: this feature has no dedicated automated tests yet — verified manually via a local build pointed at the admin layout and the service's status/run endpoints.