Check out the article for step-by-step guide
-
Clone the Git Repository: Open your terminal or command prompt and navigate to the directory where you want to clone the Git repository. Use the
git clone
command to clone the repository:git clone https://github.com/parthdasawant/Downloads-Stats-Flask-Repo.git
-
Change Directory: Navigate into the cloned repository's directory:
cd Downloads-Stats-Flask-Repo/api
-
Create a Virtual Environment: To create a Python virtual environment for this project, use
venv
. You can specify the environment's name (replacemyenv
with your preferred name):- Using
venv
:python -m venv myenv
- Using
-
Activate the Virtual Environment:
-
On Windows:
myenv\Scripts\activate
-
On macOS and Linux:
source myenv/bin/activate
Once activated, you will see the virtual environment's name in your command prompt.
-
-
Installing Dependencies from Requirements.txt: To install the project's dependencies from a
requirements.txt
file in a new virtual environment, use:pip install -r requirements.txt
- Removing a Virtual Environment: To delete a virtual environment, simply remove its directory. Be cautious when doing this, as it will permanently delete the environment and its installed packages.
- Follow the Folder struture since the deployment of vercel requires the file structure as I have created.
- Move Key JSON file to the api folder
- Go to api/app.py and insert your information
flask run
Make sure to use the proper JSON key file path with api/
in starting of the path(or relative path)
Since Vercel root directory will be ./
.
.
├── api/
│ ├── env/
│ ├── app.py
│ └── keyFile.json
├── .gitignore
├── README.md
├── requirements.txt
└── vercel.json
Add following code to your readme file by replacing <Vercel_Deployed_URL>
with your URL.
<img src="<Vercel_Deployed_URL>" />
You can access the API by replacing <Vercel_Deployed_URL>
with your URL in following link.
<Vercel_Deployed_URL>/json
Well, I think that’s all for now. If you find any issues, you can directly open an issue on GitHub. I’ll try to help as much as I can.