{"id":25957676,"url":"https://github.com/yashanksingh/secure-file-sharing-system","last_synced_at":"2026-04-05T23:03:35.390Z","repository":{"id":288883527,"uuid":"918139342","full_name":"yashanksingh/Secure-File-Sharing-System","owner":"yashanksingh","description":"Secure File-Sharing System with Flask and MongoDB","archived":false,"fork":false,"pushed_at":"2025-01-19T11:03:49.000Z","size":80,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-13T08:46:33.176Z","etag":null,"topics":["docker","file-sharing","flask","mongodb","oracle-cloud","python","traefik","waitress"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yashanksingh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-01-17T10:24:41.000Z","updated_at":"2025-07-03T08:24:38.000Z","dependencies_parsed_at":"2025-04-20T08:30:01.034Z","dependency_job_id":null,"html_url":"https://github.com/yashanksingh/Secure-File-Sharing-System","commit_stats":null,"previous_names":["yashanksingh/secure-file-sharing-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yashanksingh/Secure-File-Sharing-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashanksingh%2FSecure-File-Sharing-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashanksingh%2FSecure-File-Sharing-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashanksingh%2FSecure-File-Sharing-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashanksingh%2FSecure-File-Sharing-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yashanksingh","download_url":"https://codeload.github.com/yashanksingh/Secure-File-Sharing-System/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashanksingh%2FSecure-File-Sharing-System/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268696806,"owners_count":24292382,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker","file-sharing","flask","mongodb","oracle-cloud","python","traefik","waitress"],"created_at":"2025-03-04T17:44:28.145Z","updated_at":"2025-12-30T21:50:23.609Z","avatar_url":"https://github.com/yashanksingh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Secure File Sharing System\n\u003chr\u003e\n\n### Backend Assessment for EZ Works\nThis project is a secure file-sharing system implemented as part of the backend engineer assessment for **EZ Works**.\nYou can find the live project at: [TODO](#) (This will be taken down after the assessment)\u003cbr\u003e\nIt provides an API for secure file upload, download, and management between two types of users: Operation Users and Client Users.\n\u003chr\u003e\n\n### Features\n\n#### Technology Stack\n- **Framework**: Flask\n- **Database**: MongoDB\n- **Authentication**: JWT (JSON Web Tokens)\n- **File Type Detection**: python-magic\n  - The file type is determined not only by the file extension but also by analyzing its contents.\n\u003chr\u003e\n\n### Security Considerations\n- File types are verified by content, not just extension\n- Download URLs are encrypted and have a short expiration time\n- User passwords are hashed before storage\n\u003chr\u003e\n\n### API Endpoints\n#### Authentication\n- **POST** `/signup`: Sign up a new user\n- **GET** `/verify-email/\u003ctoken\u003e`: Verify user's email\n- **POST** `/login`: Log in a user\n\n#### File Operations\n- **POST** `/upload`: Upload a file (Operation Users only)\n- **GET** `/files`: List all uploaded files\n- **GET** `/download/\u003cfile_id\u003e`: Generate a download link for a file\n- **GET** `/secure-download/\u003ctoken\u003e`: Download a file using a secure token\n\u003chr\u003e\n\n### Future Improvements\n- Implement rate limiting\n- Add file encryption at rest\n- Implement more granular user permissions\n- Add logging and monitoring\n\u003chr\u003e\n\n### Testing\nTo run the test suite:\n```shell\npytest -v tests/\n```\nYou can check out a previous pytest log at [tests/test_results.log](tests/test_results.log) \u003cbr\u003e\n\nView the postman tests run summary at [assets/Secure File Sharing System.postman_test_run.json](assets/Secure%20File%20Sharing%20System.postman_test_run.json) \u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"700\" src=\"assets/Postman%20Test%20Summary.png\"\u003e\n\u003c/p\u003e\n\nYou can also import the Postman collection at [assets/Secure File Sharing System.postman_collection.json](assets/Secure%20File%20Sharing%20System.postman_collection.json)\n\u003chr\u003e\n\n### Setup and Installation\nMake sure you are using `Python 3.12` or later. \u003cbr\u003e\nThese instructions will help you get set up with a local development environment\n1. Clone the repository:\n   ```shell\n   git clone https://github.com/yashanksingh/Secure-File-Sharing-System.git\n   cd Secure-File-Sharing-System\n   ```\n2. Set up a virtual environment:\n   ```shell\n   python -m venv venv\n   ./venv/Scripts/activate  # On Linux use `source venv\\bin\\activate`\n   ```\n3. Install dependencies:\n   ```shell\n   pip install -r requirements.txt\n   pip install python-magic-bin~=0.4.14 # only for Windows \n   sudo apt update \u0026\u0026 sudo apt install -y libmagic-dev # only for Linux\n   ```\n4. Set up environment variables:\u003cbr\u003e\n   Create a `.env` file in the root directory and add the following:\n   ```\n   SECRET_KEY=your_secret_key\n   MONGO_URI=your_mongodb_uri\n   UPLOAD_FOLDER=path_to_upload_folder\n   SMTP2GO_API_KEY=your_smtp2go_api_key\n   SMTP2GO_SENDER='sender_name \u003csender_email\u003e'\n   BASE_URL='' # specify the base URL of your application or leave empty for 127.0.0.1:5000\n   ```\n5. Run the application:\n   ```shell\n   python run.py\n   ```\n\u003chr\u003e\n\n### Deployment\nFollow these steps to deploy the application using Docker\n1. Create a Dockerfile \u003cbr\u003e\n   Create a file named `Dockerfile` in the root directory of the project with the following content:\n   ```dockerfile\n   FROM python:3.12-slim\n   WORKDIR /SFSS\n   COPY . .\n   RUN pip install -r requirements.txt\n   RUN apt update \u0026\u0026 apt install -y libmagic-dev\n   RUN pip install waitress\n   RUN mkdir uploads\n   EXPOSE 5000\n   CMD [\"waitress-serve\", \"--port=5000\", \"--call\", \"app:create_app\"]\n   ```\n\n2. Create a .dockerignore file \u003cbr\u003e\n   Create a `.dockerignore` file in the root directory to exclude unnecessary files:\n   ```\n   .idea/\n   venv/\n   .pytest_cache\n   *.pyc\n   __pycache__/\n   .git/\n   .gitignore\n   uploads/\n   tests/\n   README.md\n   Dockerfile\n   .dockerignore\n   ```\n3. Build the Docker image \u003cbr\u003e\n   Run the following command in your terminal:\n    ```shell \n    sudo docker build -t sfss .\n    ```\n\n4. Run the Docker container \u003cbr\u003e\n   To run the container with a mounted volume, use:\n    ```shell\n    sudo docker run --name sfss -d -p 5000:5000 -v $(pwd)/uploads:/uploads sfss\n    ```\n    This command does the following: \u003cbr\u003e\n    **-d**: Runs the container in detached mode. This means the container will keep running in the background.\u003cbr\u003e\n    **-p 5000:5000**: Maps port 5000 of the host to port 5000 on the container. \u003cbr\u003e\n    **-v $(pwd)/uploads:/uploads**: Mounts the uploads directory from your current working directory to /uploads in the container\n\n\n5. Access your application \u003cbr\u003e\nThe application should now be accessible at `http://localhost:5000`\n\u003chr\u003e\n\n### Contributing\nThis project was created as part of an assessment. However, if you have suggestions or improvements, please feel free to open an issue or submit a pull request.\n\u003chr\u003e\n\n### License\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashanksingh%2Fsecure-file-sharing-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashanksingh%2Fsecure-file-sharing-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashanksingh%2Fsecure-file-sharing-system/lists"}