Implement JSON Import Feature, Enhance Database Transactions, and Dockerize the Application #19
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.
Description
This merge request introduces several key enhancements to the application, including a robust JSON import feature with real-time status tracking, improved database transaction management, and full Dockerization for streamlined deployment. These updates aim to enhance user experience, ensure data integrity, and simplify the deployment process.
1. JSON Import Feature with Status Tracking
Functionality:
Implementation Details:
Frontend Enhancements:
sessionStorage
to persist the import task ID, ensuring the import status remains visible across page refreshes.Backend Enhancements:
/settings/import_json
and/settings/import_status/<task_id>
to handle import requests and status checks.2. Enhanced Database Transaction Management
Functionality:
Db
class to use consistent attribute naming (self.conn
instead of mixedself.conn
andself.con
), eliminating attribute errors.Db
class to prevent concurrent access issues with SQLite.with Db(...) as db:
) to manage database connections and transactions safely, automatically handling commits and rollbacks.Implementation Details:
Db
class to standardize the connection attribute and ensure all methods correctly referenceself.conn
.Db
class within their execution context, promoting thread safety and preventing shared connection conflicts.3. Dockerization of the Application
Dockerfile:
Dockerfile
to define the application's Docker image, specifying the base image, dependencies, environment variables, and startup commands.Docker Compose:
docker-compose.yml
file to manage multi-container configurations, including the Flask app and any auxiliary services.Exposed necessary ports to allow external access to the application.
Configuration Adjustments:
Additional Notes
routes/helpers.py
, fromhttps://friends42.fr/proxy/
tohttps://friends.42paris.fr/proxy/
.