Medlorix is a system that assists users book appointments with doctors, search for nearby clinics in cases of emergency, and diagnose illnesses with AI.
- Team Lead & Backend Developer: Ope Fawaz Ademola (same as Physayo)
- UI/UX Designer: Mogaji Bolaji Abdullah
- Frontend Developer: Abioye Olajide Abdullateef
- Frontend Developer: Ukpong Zion
- Frontend Developer: Ezema Mabel
- Backend Developer: Sule Abdulhakeem
- Backend Developer: Ali Anuoluwapo
This document provides an overview of the API keys used in the Flask application.
-
GOOGLE_API_KEY
- Purpose: Used for Google Maps and Places API services
- Environment Variable:
GOOGLE_API_KEY
- Used in:
/clinicSearch
route/nearby-search
route/place-details
route
-
OPENCAGE_API_KEY
- Purpose: Used for geocoding services
- Environment Variable:
OPENCAGE_API_KEY
- Used in:
/geocode
route
-
CSCAPI_KEY
- Purpose: Used for Country State City API services
- Environment Variable:
CSCAPI_KEY
- Used in:
/api/countries
route/api/states/<country_code>
route/api/cities/<country_code>/<state_code>
route
- All API keys are loaded from environment variables using
dotenv
. - Keys are not hardcoded in the source code, enhancing security.
- Google API Key: Obtain from the Google Cloud Console
- OpenCage API Key: Sign up at OpenCage Geocoding API
- CSCAPI Key: Register at Country State City API
- Store these keys in a
.env
file in the project root. - Format of
.env
file:GOOGLE_API_KEY=your_google_api_key_here OPENCAGE_API_KEY=your_opencage_api_key_here CSCAPI_KEY=your_cscapi_key_here
This guide will walk you through the process of setting up the Flask environment for this project.
- Prerequisites
- Python 3.7 or higher
- pip (Python package installer)
- virtualenv (recommended for creating isolated Python environments)
- Step-by-step Setup
-
Clone the Repository
git clone <https://github.com/tegacodess/Medlorix.git> cd Medlorix
-
Create and Activate a Virtual Environment
python -m venv venv On mac use: source venv/bin/activate On Windows use: `venv\Scripts\activate`
-
Install Dependencies Run the install command below
pip install -r requirements.txt
-
Set Up Environment Variables Create a
.env
file in the project root with the following content:GOOGLE_API_KEY=your_google_api_key_here OPENCAGE_API_KEY=your_opencage_api_key_here CSCAPI_KEY=your_cscapi_key_here
Replace the placeholder values with your actual API keys.
-
Run the Flask Application
flask run Or python app.py
The application should now be running on
http://127.0.0.1:5000/
.
├── app.py
├── .env
├── requirements.txt
├── static/
│ └── (static files like CSS, JS)
└── templates/
└── (HTML templates)
- If you encounter a
ModuleNotFoundError
, ensure you've activated the virtual environment and installed all dependencies. - If the application can't find environment variables, make sure the
.env
file is in the correct location and formatted properly.
- Activate the virtual environment before starting work.
- Run
flask run
to start the development server. It will automatically reload when you make changes to the code. - Use
pip freeze > requirements.txt
to update the requirements file if you add new dependencies.
- Ensure
debug=True
is removed fromapp.run()
in production. - Set up proper logging for production environments.
- Consider using a production WSGI server like Gunicorn instead of the Flask development server.
Remember to never commit sensitive information like API keys to version control. Always use environment variables for such sensitive data.