Skip to content

Conversation

@PianoNic
Copy link
Owner

@PianoNic PianoNic commented Aug 2, 2025

resolve #12

@PianoNic PianoNic requested a review from Copilot August 2, 2025 11:24
@PianoNic PianoNic self-assigned this Aug 2, 2025
@PianoNic PianoNic added the refactor Rewrite of a code label Aug 2, 2025
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 PR migrates the application from Flask to FastAPI framework and adds automatic API documentation. The migration includes updating the web server, templating system, and route handlers to use FastAPI conventions.

  • Updates the core framework from Flask to FastAPI with automatic OpenAPI documentation
  • Modifies template syntax to use FastAPI's path parameter convention for static files
  • Refactors route handlers to use FastAPI decorators and response models

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
wsgi.py Removed Flask WSGI entry point
asgi.py Added new FastAPI ASGI entry point with uvicorn server
src/app.py Migrated Flask app initialization to FastAPI with static file mounting and template configuration
src/controllers/image_controller.py Converted Flask routes to FastAPI router with proper response models and error handling
src/templates/*.html Updated template syntax from Flask's filename to FastAPI's path parameter for static files
src/static/js/main.js Updated API endpoints to use /api/ prefix
src/static/js/app-info.js Simplified to only handle year display, removing dynamic API calls
Dockerfile Updated Python version and changed entry point from wsgi.py to asgi.py
Comments suppressed due to low confidence (4)

src/controllers/image_controller.py:13

  • The environment variable name 'FLASK_ENV' is misleading since the application has been migrated to FastAPI. Consider using a framework-agnostic name like 'APP_ENV' or 'ENVIRONMENT'.
    environment = os.environ.get('FLASK_ENV', 'unknown')

src/controllers/image_controller.py:26

  • The environment variable name 'FLASK_ENV' is misleading since the application has been migrated to FastAPI. Consider using a framework-agnostic name like 'APP_ENV' or 'ENVIRONMENT'.
    environment = os.environ.get('FLASK_ENV', 'unknown')

src/controllers/image_controller.py:38

  • The environment variable name 'FLASK_ENV' is misleading since the application has been migrated to FastAPI. Consider using a framework-agnostic name like 'APP_ENV' or 'ENVIRONMENT'.
    environment = os.environ.get('FLASK_ENV', 'unknown environment')

Dockerfile:1

  • Python 3.13.5 does not exist. The latest Python 3.13 version is 3.13.1. Consider using 'python:3.13-slim' or 'python:3.13.1-slim' instead.
FROM python:3.13.5-slim

@PianoNic PianoNic merged commit a9fc450 into main Aug 2, 2025
@PianoNic PianoNic deleted the refactor/12_ReplaceFlaskWithFastAPI branch August 2, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Rewrite of a code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Flask with FastAPI

2 participants