Skip to content

Add mock Flask backend with validation and fix frontend message IDs#194

Merged
luarss merged 7 commits intomasterfrom
chore/mock-flask-api
Dec 2, 2025
Merged

Add mock Flask backend with validation and fix frontend message IDs#194
luarss merged 7 commits intomasterfrom
chore/mock-flask-api

Conversation

@error9098x
Copy link
Collaborator

This pull request introduces a new mock Flask API service in the frontend/mock-flask-api directory 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

  • Added a new app.py implementing 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.
  • Added .env.example for environment configuration (debug mode, port) and a pyproject.toml for dependency management and project metadata. [1] [2]
  • Added a readme.md with setup instructions, endpoint documentation, and configuration details for the mock API.

2. Frontend Data Model Alignment

  • Updated the ConversationMessageResponse interface in page.tsx to use uuid and conversation_uuid instead of numeric IDs, matching the new mock backend's schema.
  • Modified message mapping logic in the frontend to use the new UUID fields for message identifiers.

@error9098x error9098x requested a review from luarss November 20, 2025 08:51
@error9098x error9098x self-assigned this Nov 20, 2025
Copilot AI review requested due to automatic review settings November 20, 2025 08:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

error9098x and others added 5 commits November 20, 2025 14:40
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>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
Signed-off-by: Jack Luar <jluar@precisioninno.com>
@luarss luarss merged commit 7f390b1 into master Dec 2, 2025
2 checks passed
@luarss luarss deleted the chore/mock-flask-api branch December 2, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants