This is a simple web application for predicting heart disease using FastAPI for the backend and MongoDB for data storage.
- Collects user input for heart disease prediction.
- Stores user data in MongoDB.
- Provides predictions based on the user input.
- Python 3.6+
- MongoDB
-
Clone the repository:
git clone https://github.com/arul-5/heart-disease-prediction.git
-
Navigate to the project directory:
cd heart-disease-prediction
-
Create a virtual environment (optional but recommended):
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS and Linux:
source venv/bin/activate
-
-
Install dependencies:
pip install -r requirements.txt
-
Create a .env file in the project root directory and add your MongoDB connection URL:
DATABASE_URL=mongodb://username:password@host:port/database_name
Replace
username
,password
,host
,port
, anddatabase_name
with your MongoDB connection details.
-
Start the FastAPI server:
uvicorn main:app --reload
The server will start running on http://localhost:8000.
-
Open your web browser and navigate to http://localhost:8000/docs to access the FastAPI autogenerated documentation.
-
Use the provided forms in the documentation to interact with the API, fill out the form, and submit to see the prediction.
Contributions are welcome! Please feel free to submit a pull request or open an issue for bug fixes, feature requests, or improvements.