- To run the API, please ensure you have installed the required packages, "fastapi" and "uvicorn." If you haven't already installed them, you can do so using the following commands:
```bash
pip install fastapi
pip install"uvicorn[standard]"
```
- Once these packages are installed, you can proceed to run the API.
1. To run the api, use the following command inside the API folder:
```bash
python main.py
```
2. You can access the project output in your browser using the following URL:
```bash
http://127.0.0.1:8000
```
3. To explore the API documentation, visit:
```bash
http://127.0.0.1:8000/docs
```
------------------------
## Setting Up the Development Environment
Follow these steps to set up your development environment for this project:
### Create a New `venv`
1. Navigate to your project directory:
```bash
cd /path/to/your/project
```
2. Create a virtual environment:
```bash
python -m venv <venv_name>
```
### Activate and Deactivate `venv`
- In `cmd`:
```bash
<venv_name>\Scripts\activate
```
- In bash:
```bash
source <venv_name>/Scripts/activate
# To deactivate the virtual environment:
deactivate
```
### Create, Activate & Deactivate `venv` using conda
- Use Anaconda Navigator to create a venv:
```bash
# Activate the conda environment
conda activate <venv_name>
# To deactivate the conda environment
conda deactivate
```
### Install the Dependencies
- You can also use a `requirements.txt` file to manage your project's dependencies. This file lists all the required packages and their versions.
1. Install packages from `requirements.txt`:
```
pip install -r requirements.txt
```
This ensures that your development environment matches the exact package versions specified in `requirements.txt`.
2. Verify installed packages:
```bash
pip list
```
This will display a list of packages currently installed in your virtual environment, including the ones from `requirements.txt`.