Flask based File Hosting (web app & api & python module & cli app)¶
Introduction¶
I've implemented A simple Flask application designed for sharing files. The application can be hosted on a server so users can upload files and generate links for sharing.
Prerequistes¶
- python >=3.9
Installation¶
- Clone the repository:
- Create a virtual environment and activate it:
- Install the required dependencies:
- Start the Flask development server:
- Access the application by visiting http://localhost:5000 in your web browser.
Development Details¶
- The application allows users to upload files and share them with others by providing a link to the file.
- To use the application, users need to clone the repository, create a virtual environment, install the required dependencies, and start the Flask development server.
- Once the server is running, users can access the application by visiting http://localhost:5000 in their web browser.
- The main page displays a list of shared files, and users can upload a file by clicking on "Upload a File" and selecting the file they want to share.
- The uploaded files will be listed on the main page for download.
- The application can be deployed on a remote server or cloud provider, such as AWS, Google Cloud, or Heroku.
- You can see the step by step implementation of the code
Usage¶
access the flask web¶
- The main page displays a list of shared files.
- To upload a file, click on "Upload a File" and select the file you want to share.
- The uploaded files will be listed on the main page for download.
access the app through an api¶
- you can access the api with the routes
http://localhost:5000/api/*
- The file cli_app/cli_app.py to access the api along with a context manager to handle sessions
- you can read the api documentation
access the app's api with a cli app¶
- The file cli_app/sharefile.py provide a cli app to access the api context manager
- Using your cli, you can get list, upload and download files. The api will be called behind the hood by cli_app/cli_app.py
- you can read the api documentation
Deployment Guide¶
To deploy the File Sharing App, follow these steps:
-
Choose a remote server or cloud provider to host your application. Popular options include AWS, Google Cloud, and Heroku.
-
Set up an instance or virtual machine on your chosen server.
-
Connect to your remote server.
-
Install the required dependencies.
-
Modify the Flask application's configuration to use a production-ready web server.
-
Configure your domain or subdomain to point to the IP address of your remote server.
-
Set up SSL/TLS certificates for secure HTTPS communication.
-
Start the Flask application using the production-ready web server.
-
Verify that your file sharing app is accessible.
-
Monitor the deployed application for errors and performance issues.
Remember to follow best practices for securing your deployed application.
License¶
This project is licensed under the MIT License.