SchedulCare: A one-stop healthcare portal. We are building a healthcare portal where both doctors and patients can interact seamlessly. There is a MapView using which patients can navigate to their nearest ambulance, doctor, any medical healthcare facility, among others, and also take advantage of our find by pincode functionality to find closest places. Doctors can set their appointment availability and patients can book their appointments. There is calendar and date features used to set up appointments. Post appointment setting, patients can make a Payment via payment options (we have configured PayPal for this project). There is a AI Health Assistant to help with any user queries regarding any healthcare related suggestions. There are 2 dashboards, one for login and one for register, one each for doctor and patient. We have added MultiFactor Authentication to secure Doctor and patient logins. In addition to that, we have a check for Doctors while they register, to upload their Doctor certificate, to ensure safety and avoid any malpractice.
Instructions to install, configure and set up the project are provided below:
Pre-Requisites : Node (22.9.0 or higher) and npm
-
Navigate to
client\
dir -
Install all the client libraries using the command
npm install
-
To start the client application, run
npm start
The application runs on localhost:3000
- Install fastapi. Run from
server
dirpip install -r requirements.txt
- Navigate to
server/app
dir and set your python pathexport PYTHONPATH=$PWD
- Run the server
fastapi dev main.py
- Create a file for your module if does not exist
- Add your routes in the file. Refer to patient_router.py
- Use
APIRouter
to create child routes
- Use
- Add your router in main.py with the prefix
- Once done creating a Mongo account and getting added to the database. Create a
.env.dev
file in the server directory. - Create a variable in the said file
MONGO_URI=<your_mongo_url>
- When getting the Mongo URL, select the language to be Python.
- DO NOT COMMIT this file. (thanks!)
Once done creating an end-to-end test in client/cypress/e2e,
- Stop the server. Inside server/app/, export mongo db creds: export MONGO_URI="mongodb+srv://:@animus.piv6r.mongodb.net/?retryWrites=true&w=majority&appName=Animus"
- Start the server:
fastapi dev main.py
3.Runnpx open cypress
in the client folder. Make sure the application is already running.
For running Payment page e2e test, you need to configure your own sandbox email and password since it is third party payment.
- Run unit tests for backend services using pytest.
- Move to
server/app
folder - Install
pytest
package. - Run unit tests using the command
pytest tests/
to run all tests. - To run a single test, use command
pytest tests/payment_test.py
.
PayPal integrations use a client ID and client secret to authenticate API calls:
- A client ID identifies an app. You only need a client ID to get a PayPal payment button and standard credit and debit card fields.
- A client secret authenticates a client ID. To call PayPal APIs, you'll exchange your client ID and client secret for an access token. Keep this secret safe.
Exchange your client ID and client secret for an access token. The access token authenticates your app when calling PayPal REST APIs. You can call the PayPal OAuth API in any language.
Here's how to get your client ID and client secret:
- Select Log in to Dashboard and log in or sign up.
- Select Apps & Credentials.
- New accounts come with a Default Application in the REST API apps section. To create a new project, select Create App.
- Copy the client ID and client secret for your app.
Add the Client ID and Client Secret in .env file with keys PAYPAL_CLIENT_ID
and PAYPAL_CLIENT_SECRET
The PayPal sandbox is a test environment that mirrors real-world transactions. By default, PayPal developer accounts have 2 sandbox accounts: a personal account for buying and a business account for selling. You'll get the login information for both accounts. Watch sandbox money move between accounts to test API calls.
Take the following steps to get sandbox login information for business and personal accounts:
- Log into the Developer Dashboard.
- Select Testing Tools > Sandbox Accounts. You can create more sandbox accounts by selecting Create account.
- Locate the account you want to get credentials for and select ⋮
- Select View/Edit Account to see mock information such as the account email and system-generated password.
- Go to sandbox.paypal.com/signin and sign in with the personal sandbox credentials. In a separate browser, sign in with the business sandbox credentials.
- Make API calls with your app's access token to see sandbox money move between personal and business accounts.
- Patient schedules appointment with doctor.
- This action is redirects to Payment Page
- Checkout using Paypal option to test using sandbox credentials.
- Use the test Sandbox account credentials. Remember to use personal sandbox credentials for this flow. Business sandbox credentials are for merchants.
- Once logged in, authorise the payment.
- Ensure you have FastAPI-Mail installed. Install them using:
pip install fastapi-mail
- Mailtrap Account: Sign up for a free account at Mailtrap to obtain SMTP credentials.
-
Log in to your Mailtrap account.
-
Navigate to Inboxes → Select your inbox.
-
Find SMTP credentials:
- Host: sandbox.smtp.mailtrap.io
- Port: 587
- Username:
- Password:
-
Add the Username and Password in .env file with keys
MAIL_USERNAME
andMAIL_PASSWORD
- Log in to Mailtrap.io
- After logging in, you’ll land on the Dashboard.
- Under the Inboxes section, you’ll see a list of your inboxes.
- Select the inbox where you’ve configured your SMTP credentials (usually the default "My Inbox").
- Once inside the selected inbox, you’ll see a list of received emails.
- Click on any email to open and view its content.
Download and setup Google Authenticator App from the Play Store or the App Store
Due to the time lag between PyOTP and Google Authenticator web servers, the code expires after 30secs. In this case, wait until Authenticator creates a new code
- Follow the setup instructions from the Maps Embed API page
- Add the API key as one of your environment variables as
REACT_APP_GOOGLE_MAPS_API_KEY
export REACT_APP_GOOGLE_MAPS_API_KEY=<your_api_key> >> ~/.zshrc
- Restart your terminal and navigate to the client directory to restart the client application.
[!WARNING]
You need to add the API key in your system environment variables to avoid exposing it in the codebase.
Do not add it in the.env.dev
file.
- Visit the link: https://ai.google.dev/gemini-api/docs/api-key
- Click on "Get a Gemini API key in Google AI Studio"
- Once inside this page, Click "Create API Key"
- Once you have generated your api key, configure this api key inside .env.dev file like this: GEMINI_API_KEY="<your_api_key>"
- Now you are good to go!