This repository contains a full-stack application for managing user information and predicting the probability of diabetes using a machine learning model. The application includes a React frontend and a Node.js backend.
- Features
- Prerequisites
- Installation
- Running the Application
- Usage
- API Endpoints
- Project Structure
- Contributing
- License
- User registration and login
- Goolge ReCaptcha impl
- Add and view user information (name, age, weight, height, gender)
- Predict diabetes probability using a pre-trained machine learning model
- Node.js
- Python 3.x (for model conversion, if needed)
- MongoDB
-
Clone the repository:
git clone https://github.com/atpk/todo-app.git cd todo-app/backend
-
Install dependencies:
npm install
-
Create a .env file in the backend directory with the following content:
MONGO_URI=your_mongo_uri_here JWT_SECRET=your_jwt_secret_here RECAPTCHA_SECRET_KEY=your_recaptcha_secret_key_here PORT=5000
-
Convert your ML model to ONNX format and place it in the backend directory.
-
Navigate to the frontend directory:
cd ../frontend
-
Install dependencies:
npm install
-
Create a .env file in the backend directory with the following content:
REACT_APP_BACKEND_URL=http://localhost:5000 REACT_APP_RECAPTCHA_SITE_KEY=your_recaptcha_site_key_here
Start the backend server:
```bash
cd backend
node server.js
```
Start the frontend server:
```bash
cd frontend
npm start
```
Open your browser and navigate to http://localhost:3000.
- Register a new user.
- Log in with the registered user credentials.
- Add user information (name, age, weight, height, gender).
- View the added user information and the predicted diabetes probability.
- POST /register: Register a new user.
- POST /login: Log in an existing user.
- POST /todos: Add user information.
- GET /todos: Retrieve user information.
- POST /predict: Predict diabetes probability.
```
.
├── backend
│ ├── models
│ ├── routes
│ ├── server.js
| ├── .env
│ └── model.onnx (your ONNX model file)
├── frontend
│ ├── public
│ ├── src
│ │ ├── components
│ │ ├── App.js
│ │ ├── index.js
│ └── .env
├── README.md
└── package.json
```
Contributions are welcome! Please open an issue or submit a pull request.