This project is a Streamlit-based web application designed to fetch, analyze, and store food hygiene rating data from the Food Standards Agency (FSA) API. It integrates with Google BigQuery for data persistence, allowing users to maintain a master list of restaurant ratings, identify new establishments, and update existing records.
- Frontend/UI: Streamlit (
app/ui/st_app.py) - Backend Logic: Python 3.11 (
app/services,app/core) - Data Source: FSA API (UK Food Hygiene Ratings)
- Data Storage: Google BigQuery
- Containerization: Docker
- CI/CD: Google Cloud Build (
cloudbuild.yaml) & Cloud Run
app/ui/: Contains the Streamlit application logic.app/services/: Business logic and API interactions.app/core/: Core definitions and configurations.conductor/: Orchestration logic (if applicable).scripts/: Utility scripts (e.g.,prototype_maps_agent.py).
- Python 3.7+ (3.11 recommended)
- Google Cloud SDK (gcloud) configured with Application Default Credentials (ADC) for BigQuery access.
- Firebase configuration in
.streamlit/secrets.toml(for authentication).
All dependencies and tooling are consolidated into .venv:
- Activate or synchronize the virtual environment:
source .venv/bin/activate uv sync
To start the Streamlit app:
streamlit run app/ui/st_app.pyThe app will be accessible at http://localhost:8501.
# The offline suite. No credentials, no network, no listening port -- and what
# Cloud Build gates on. Tests needing live GCP are marked `integration` and
# deselected by `addopts` in pyproject.toml.
pytest
# The live tests, deliberately. These make real Vertex calls and cost money.
pytest -m integration
# The ADK evaluation dataset.
adk eval app tests/eval/evalsets/restaurant_eval.evalset.json- ADK Restaurant Agent: Grounded culinary profiler in
app/agent.pyutilizinggemini-3.8-flashandGoogleMapsGroundingTool. - Evaluation Flywheel: Configured in
tests/eval/eval_config.yamlwith canonical test scenarios intests/eval/evalsets/restaurant_eval.evalset.json. - Observability: Real-time OpenTelemetry span export to Google Cloud Trace via
app/app_utils/telemetry.py.
The application is deployed to Google Cloud Run via Cloud Build.
Important
A Cloud Build trigger is configured to automatically build and deploy the application with every commit and push to the repository. You must commit and push your changes to the remote repository (main branch) to see them reflected in the live application.
The cloudbuild.yaml file defines the build steps:
- Install dependencies.
- Run tests.
- Build Docker image.
- Push image to Google Container Registry (GCR).
- Deploy to Cloud Run (
restaurants-fsaservice).
To deploy manually (if authorized):
gcloud builds submit --config cloudbuild.yaml .