{"id":24534410,"url":"https://github.com/analyticace/simple-file-sharing-api","last_synced_at":"2025-03-15T22:22:04.305Z","repository":{"id":272812568,"uuid":"917727904","full_name":"AnalyticAce/Simple-File-Sharing-API","owner":"AnalyticAce","description":"This project is a simple file sharing API built using FastAPI. It provides endpoints to upload, download, and retrieve metadata about files.","archived":false,"fork":false,"pushed_at":"2025-01-16T19:35:47.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T19:57:55.604Z","etag":null,"topics":["api","fastapi","file-sharing","links"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnalyticAce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-16T14:38:11.000Z","updated_at":"2025-01-16T19:35:49.000Z","dependencies_parsed_at":"2025-01-16T19:57:57.858Z","dependency_job_id":"d0c7fbe2-2a0b-48c6-a14c-fffe93b7d0fa","html_url":"https://github.com/AnalyticAce/Simple-File-Sharing-API","commit_stats":null,"previous_names":["analyticace/simple-file-sharing-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnalyticAce%2FSimple-File-Sharing-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnalyticAce%2FSimple-File-Sharing-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnalyticAce%2FSimple-File-Sharing-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnalyticAce%2FSimple-File-Sharing-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnalyticAce","download_url":"https://codeload.github.com/AnalyticAce/Simple-File-Sharing-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243797634,"owners_count":20349438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","fastapi","file-sharing","links"],"created_at":"2025-01-22T11:17:08.310Z","updated_at":"2025-03-15T22:22:04.270Z","avatar_url":"https://github.com/AnalyticAce.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple-File-Sharing-API\n\nThis project is a simple file sharing API built using FastAPI. It provides endpoints to upload, download, and retrieve metadata about files. The uploaded files are stored in a folder, and metadata is managed in a JSON file.\n\n## Features\n\n- **File Upload**: Upload files to the server with metadata tracking.\n- **File Download**: Securely download files by their unique ID.\n- **Metadata Retrieval**: Access metadata for all files or a specific file.\n- **Download Count Tracking**: Monitor how many times each file has been downloaded.\n\n## Layout\n- Upload Page #1\n![Upload](.github/assets/upload.png)\n\n- Upload Page #2\n![Upload](.github/assets/upload_.png)\n\n- Download Page\n![Download](.github/assets/download.png)\n\n## Technologies Used\n\n- **Python**\n- **FastAPI**: Web framework for building APIs.\n- **JSON**: For metadata storage.\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/AnalyticAce/Simple-File-Sharing-API.git\n   cd Simple-File-Sharing-API\n   ```\n\n2. Set up a virtual environment (optional but recommended):\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Run the server:\n   ```bash\n   fastapi run app/main.py --host 0.0.0.0 --port 8080 --reload\n   ```\n\nThe server will be accessible at `http://0.0.0.0:8080`.\n\n## API Endpoints\n\n### Upload File\n\n**Endpoint**: `POST /file/upload/`\n\nUploads a file to the server.\n\n**Request**:\n- `file`: The file to upload (as `multipart/form-data`).\n\n**Response**:\n```json\n{\n  \"file_id\": \"\u003cunique_file_id\u003e\",\n  \"original_name\": \"\u003coriginal_filename\u003e\",\n  \"content_type\": \"\u003cfile_mime_type\u003e\",\n  \"file_size\": \u003cfile_size_in_bytes\u003e,\n  \"download_link\": \"\u003cdownload_url\u003e\"\n}\n```\n\n### Download File\n\n**Endpoint**: `GET /file/download/{file_id}`\n\nDownloads a file by its unique ID.\n\n**Response**:\n- Returns the file as an attachment.\n\n### Get Metadata for All Files\n\n**Endpoint**: `GET /file/metadata/`\n\nRetrieves metadata for all uploaded files.\n\n**Response**:\n```json\n{\n  \"\u003cfile_id\u003e\": {\n    \"original_name\": \"\u003coriginal_filename\u003e\",\n    \"content_type\": \"\u003cfile_mime_type\u003e\",\n    \"file_size\": \u003cfile_size_in_bytes\u003e,\n    \"download_count\": \u003cdownload_count\u003e,\n    \"download_link\": \"\u003cdownload_url\u003e\"\n  },\n  ...\n}\n```\n\n### Get Metadata for a Specific File\n\n**Endpoint**: `GET /file/metadata/{file_id}`\n\nRetrieves metadata for a specific file by its unique ID.\n\n**Response**:\n```json\n{\n  \"original_name\": \"\u003coriginal_filename\u003e\",\n  \"content_type\": \"\u003cfile_mime_type\u003e\",\n  \"file_size\": \u003cfile_size_in_bytes\u003e,\n  \"download_count\": \u003cdownload_count\u003e,\n  \"download_link\": \"\u003cdownload_url\u003e\"\n}\n```\n\n## Contributing\n\n1. Fork the repository.\n2. Create a new branch for your feature:\n   ```bash\n   git checkout -b feature/your-feature-name\n   ```\n3. Commit your changes:\n   ```bash\n   git commit -m \"Add your message here\"\n   ```\n4. Push to your branch:\n   ```bash\n   git push origin feature/your-feature-name\n   ```\n5. Open a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n\n## Acknowledgments\n\n- FastAPI documentation: https://fastapi.tiangolo.com/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalyticace%2Fsimple-file-sharing-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanalyticace%2Fsimple-file-sharing-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalyticace%2Fsimple-file-sharing-api/lists"}