You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
Enhance the frontend application to integrate the new backend API endpoint (POST /proposals/{proposal_id}/evaluate) for triggering evaluation iterations for DAO proposals, using Supabase authentication to securely pass the Supabase access token as the Authorization token. The endpoint requires no request body and returns a 202 Accepted response to indicate successful job queueing. This will allow authenticated users to initiate new evaluation revisions for a given proposal, displaying a confirmation of the queued action. The implementation will use React with Tailwind CSS for styling, leveraging a CDN-hosted React setup, and ensure compatibility with the backend's Supabase-based authentication.
Requirements
System Overview
Objective: Enable authenticated users to trigger new evaluation iterations via the frontend, interacting with the backend API endpoint using Supabase access tokens.
Scope: Add a new React component and API client logic to call POST /proposals/{proposal_id}/evaluate, handle the 202 response, and display confirmation, integrating with AIBTC_PLATFORM_API_URL and Supabase authentication (AIBTC_SUPABASE_URL).
Compatibility: Ensure seamless integration with the backend's Supabase-based DAO proposal system and LangGraph-based evaluation workflow.
Features:
UI button to trigger evaluation iterations for a selected proposal, accessible only to authenticated users.
Display confirmation message on successful 202 response (e.g., "Evaluation jobs queued successfully").
Handle errors, loading states, and authentication failures with user feedback.
Use Supabase client to manage authentication and retrieve access tokens.
Technical Requirements
Frontend Framework:
Use React (CDN-hosted via cdn.jsdelivr.net, e.g., react, react-dom).
Use JSX for component rendering, compiled with Babel.
Apply Tailwind CSS for styling, included via CDN.
Supabase Authentication:
Use the Supabase JavaScript client (@supabase/supabase-js) to manage user authentication.
Retrieve the Supabase access token from the authenticated session for API calls.
Pass the token in the Authorization header as Bearer ${supabaseAccessToken}.
API Integration:
Implement an API client to call POST /proposals/{proposal_id}/evaluate with:
Description
Enhance the frontend application to integrate the new backend API endpoint (
POST /proposals/{proposal_id}/evaluate) for triggering evaluation iterations for DAO proposals, using Supabase authentication to securely pass the Supabase access token as theAuthorizationtoken. The endpoint requires no request body and returns a 202 Accepted response to indicate successful job queueing. This will allow authenticated users to initiate new evaluation revisions for a given proposal, displaying a confirmation of the queued action. The implementation will use React with Tailwind CSS for styling, leveraging a CDN-hosted React setup, and ensure compatibility with the backend's Supabase-based authentication.Requirements
System Overview
POST /proposals/{proposal_id}/evaluate, handle the 202 response, and display confirmation, integrating withAIBTC_PLATFORM_API_URLand Supabase authentication (AIBTC_SUPABASE_URL).Technical Requirements
cdn.jsdelivr.net, e.g.,react,react-dom).@supabase/supabase-js) to manage user authentication.Authorizationheader asBearer ${supabaseAccessToken}.POST /proposals/{proposal_id}/evaluatewith:proposal_id.Authorization: Bearer ${supabaseAccessToken}.fetchfor HTTP requests, with error handling for 401 (unauthorized), 400 (bad request), and 500 (server error) responses.ProposalEvaluationTriggercomponent:useState,useEffect) for managing loading and error states.onAuthStateChangeto monitor authentication state and retrieve the access token.Acceptance Criteria
ProposalEvaluationTriggercomponent is implemented in React with JSX.POST /proposals/{proposal_id}/evaluatewith no body andAuthorization: Bearer ${supabaseAccessToken}header.Dependencies
cdn.jsdelivr.net).@supabase/supabase-js) for authentication.AIBTC_PLATFORM_API_URL) withPOST /proposals/{proposal_id}/evaluateendpoint.AIBTC_SUPABASE_URL,AIBTC_SUPABASE_ANON_KEY) for authentication.Additional Notes
VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY) in.env.localfor development.docs/frontend.md, noting the 202 response and lack of request body.Related Issues
Labels