feat: add sharing FastAPI and Django server#2
Draft
Lenochxd wants to merge 1 commit into
Draft
Conversation
Collaborator
Author
|
Todo:
|
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.
This pull request introduces a new FastAPI-based public upload/download API for ShareMii
.ltdfiles, including image preview support, rate limiting, and MySQL-backed metadata storage. It also adds a Django UI server, comprehensive configuration, and documentation. The changes are organized into API implementation, configuration, database and file handling, and developer tooling.API Implementation and Core Features:
src/app/main.py) with endpoints for uploading.ltdfiles (with optional metadata and up to 5 compressed preview images), downloading files and images, and retrieving Mii metadata by share code. All endpoints are rate-limited per client and validate file types, sizes, and identifiers. [1] [2] [3] [4] [5]Database, File, and Image Handling:
init_db.sql. Image uploads are compressed to JPEG and stored instorage/images. Unique 6-character share codes are generated and validated. [1] [2]Configuration and Setup:
config.jsonand loaded settings insrc/app/settings.py. [1] [2]main.py) that launches both the FastAPI API and the Django UI server concurrently, with proper process management. [1] [2]Documentation and Developer Tooling:
API.mdwith endpoint documentation, usage examples, and configuration notes. Updated the preview image path inREADME.md. [1] [2].gitattributesfor line ending normalization and VSCode settings for Python analysis. [1] [2]Django UI Server:
These changes together provide a robust, configurable, and well-documented backend for ShareMii file sharing, supporting both programmatic API access and a web UI.
(PR description written by copilot)