Add mock Flask backend with validation and fix frontend message IDs#194
Merged
Add mock Flask backend with validation and fix frontend message IDs#194
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a mock Flask API service to enable frontend development without requiring the full OpenROAD backend infrastructure. The changes migrate the conversation and message identifiers from integers to UUIDs throughout the stack.
Key changes:
- Added a complete mock Flask backend (
frontend/mock-flask-api) with in-memory storage, input validation, and error handling for all major API endpoints - Updated frontend TypeScript interfaces and message mapping to use UUID-based identifiers instead of integer IDs
- Provided comprehensive documentation and configuration for the mock service setup
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/nextjs-frontend/app/page.tsx | Updated data model interfaces and message mapping from integer IDs to UUID strings |
| frontend/mock-flask-api/app.py | Implemented Flask server with conversation CRUD, agent retriever endpoints (streaming and non-streaming), validation, and error handling |
| frontend/mock-flask-api/pyproject.toml | Defined project metadata and dependencies (Flask, Flask-Cors) |
| frontend/mock-flask-api/readme.md | Documented setup instructions, configuration options, and available API endpoints |
| frontend/mock-flask-api/.env.example | Provided example environment configuration for debug mode and port settings |
Comments suppressed due to low confidence (2)
frontend/mock-flask-api/app.py:4
- Import of 'json' is not used.
import json
frontend/mock-flask-api/app.py:5
- Import of 'random' is not used.
import random
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bf80c07 to
68365fc
Compare
Signed-off-by: error9098x <kainturarenu@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: ProCodec <43810146+error9098x@users.noreply.github.com> Signed-off-by: error9098x <kainturarenu@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: ProCodec <43810146+error9098x@users.noreply.github.com> Signed-off-by: error9098x <kainturarenu@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: ProCodec <43810146+error9098x@users.noreply.github.com> Signed-off-by: error9098x <kainturarenu@gmail.com>
Signed-off-by: error9098x <kainturarenu@gmail.com>
68365fc to
a9ad334
Compare
Signed-off-by: Jack Luar <jluar@precisioninno.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.
This pull request introduces a new mock Flask API service in the
frontend/mock-flask-apidirectory to simulate the OpenROAD backend for local frontend development. The mock backend provides in-memory storage for conversations, mimics key API endpoints, and includes robust input validation and error handling. It also updates the frontend to align with the new API's data model, switching from integer IDs to UUIDs for conversation and message identifiers.The most important changes are:
1. Mock Flask API Implementation
app.pyimplementing a Flask server that mocks the OpenROAD backend, including endpoints for health checks, suggested questions, conversation CRUD, and agent retriever (both streaming and non-streaming). All data is stored in-memory, and the API closely follows the expected schema and error handling of the real backend..env.examplefor environment configuration (debug mode, port) and apyproject.tomlfor dependency management and project metadata. [1] [2]readme.mdwith setup instructions, endpoint documentation, and configuration details for the mock API.2. Frontend Data Model Alignment
ConversationMessageResponseinterface inpage.tsxto useuuidandconversation_uuidinstead of numeric IDs, matching the new mock backend's schema.