This is a simple web app that allows users to download the contents of a GitHub repository as a zip file. The app is built using Flask for the backend and Tailwind CSS for styling the frontend.
- Enter a GitHub repository URL and download its contents as a zip file
- The downloaded zip file contains separate text files for each folder in the repository
- The text files include the file structure and contents of each file in the respective folder
- Python 3.x
- Flask
- chardet
-
Clone the repository or download the project files.
-
Open a terminal or command prompt and navigate to the project directory.
-
Create a virtual environment by running the following command:
python -m venv venv
-
Activate the virtual environment:
-
For Windows:
venv\Scripts\activate
-
For macOS and Linux:
source venv/bin/activate
-
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the Flask server:
python app.py
-
Open a web browser and visit
http://localhost:5000
orhttp://127.0.0.1:5000
to access the web app.
-
Enter a valid GitHub repository URL in the input field, e.g.,
https://github.com/username/repo
. -
Click the "Download" button.
-
The server will process the request, generate the zip file, and initiate the download.
-
The downloaded zip file will be saved in your browser's default downloads directory.
github-repo-downloader/
├── app.py
├── index.html
├── requirements.txt
└── venv/
app.py
: The Flask server code.index.html
: The HTML code for the web app.requirements.txt
: The file containing the project dependencies.venv/
: The virtual environment directory.
To stop the Flask development server, press CTRL+C
in the terminal where the server is running.
To deactivate the virtual environment, run the following command in the terminal:
deactivate
If you need to update the project dependencies or add new ones, follow these steps:
-
Activate the virtual environment (if not already activated).
-
Install or update the desired packages using pip. For example:
pip install package_name
-
Update the
requirements.txt
file with the current dependencies:pip freeze > requirements.txt
This command will overwrite the existing
requirements.txt
file with the updated dependencies. -
Commit the updated
requirements.txt
file to your version control system.
If you encounter any issues or have questions, please feel free to reach out or open an issue in the GitHub repository.
This project is open-source and available under the MIT License.