Rewrite application structure and dependencies#11
Open
justinh-rahb wants to merge 3 commits intomasterfrom
Open
Rewrite application structure and dependencies#11justinh-rahb wants to merge 3 commits intomasterfrom
justinh-rahb wants to merge 3 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
Revamp the application by replacing the Flask backend with a FastAPI service, introducing a Svelte frontend, and streamlining development/deployment with Docker. Key changes include:
- Transition from Flask to FastAPI with modular routers (
api,devices,firmware) - Addition of core utility functions and Pydantic models in
backend/app/utils.pyandbackend/app/models - Updated documentation and removal of legacy Flask scripts, plus new Docker Compose setup
Reviewed Changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ota-server/config.json.example | Removed outdated JSON config example |
| ota-server/backend/requirements.txt | Added FastAPI-related dependencies |
| ota-server/backend/app/utils.py | Introduced utility functions (version, MAC, MD5) |
| ota-server/backend/app/routers | Implemented new API endpoints |
| ota-server/backend/app/models | Defined Pydantic schemas for devices/firmware |
| ota-server/backend/app/main.py | Bootstraps FastAPI app with CORS and static mounts |
| ota-server/backend/app/config.py | Switched to environment-driven settings |
| ota-server/backend/app/auth.py | Authentication logic for admin and device routes |
| ota-server/app.py & admin_tools.py | Removed legacy Flask app and CLI |
| ota-server/README.md | Updated docs for FastAPI, Svelte, and Docker |
| ota-server/Dockerfile | Removed old Dockerfile (moved to docker/) |
| ota-server/.gitignore | Cleaned up extra ignores (added Node.js) |
Comments suppressed due to low confidence (5)
ota-server/backend/app/routers/devices.py:8
- The
calculate_file_md5import is not used in this file and should be removed to keep imports clean.
from app.utils import (get_devices, get_device, update_device, delete_device, validate_mac_address, format_mac_address, calculate_file_md5)
ota-server/backend/app/utils.py:21
- The new utility functions (e.g.,
generate_auth_token,compare_versions,calculate_file_md5) lack accompanying unit tests. Consider adding test cases to cover edge cases and ensure correct behavior.
"""
ota-server/backend/app/auth.py:43
- The
verify_device_authdependency declares amac_addressparameter but never extracts it from the request (e.g., viaQuery). As written,mac_addressis alwaysNoneand authentication will always fail. Update the signature to something like:
async def verify_device_auth(
auth_token: str = Depends(DEVICE_AUTH_HEADER),
mac_address: str = Query(..., alias="mac")
) -> bool:async def verify_device_auth(
ota-server/README.md:42
- The
.envexample includesOTA_SERVER_UI_PORT, but theSettingsclass inconfig.pydoes not define this variable. Either remove it from the docs or add it to your settings model.
OTA_SERVER_UI_PORT=80
ota-server/README.md:26
- The repository URL in the clone command appears to point at
panic-button-esp.gitinstead of this OTA server project. Update the URL to the correct repo path.
git clone https://github.com/RAHB-REALTORS-Association/panic-button-esp.git
…improve MAC address handling
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.
Revamp the application by transitioning to a Svelte frontend and a FastAPI backend. Update dependencies and remove outdated scripts and configurations. Introduce a new Docker setup for streamlined development and deployment.