Skip to content

Latest commit

 

History

History
144 lines (110 loc) · 3.69 KB

INSTALLATION.md

File metadata and controls

144 lines (110 loc) · 3.69 KB

Installation Guide

Dependencies

  • Python: Version 3.8 or higher (download it from here).
  • Node.js: Version 14.x or higher (download it from here).
  • Android Studio.
  • MongoDB: Either a local instance or an Atlas account.
  • React Native CLI: Follow the setup instructions here.

Installation Instructions

Clone the Repository

git clone https://github.com/your-username/VitalTrack.git
cd VitalTrack

Backend Installation (VitalTrackServer)

Navigate to the Backend Directory

cd VitalTrackServer

Install Python Dependencies

Run the following command to install all required Python packages:

pip install -r requirements.txt

Set Up Environment Variables

Copy the example .env file to configure your environment:

cp example.env .env

Update the .env file with your MongoDB connection string and other required variables.

Run the Backend Server

Start the server by running:

flask run

Testing Instructions

Run the following command in your command line:

pip install -U pytest

run pytest in command line

Formatting

Run the following command in your command line:

pip install black

After that you specify black filename.py in the terminal and black automatically formats your code. If you want to format the whole directory, you can run black ./VitalTrackServer in the VitalTrack Directory


Frontend Installation (VitalTrackApp)

Navigate to the Frontend Directory

cd VitalTrackApp

Install Frontend Dependencies

Run the following command to install all required Node.js packages:

npm install

Running the Android Application

Option 1: Using Android Studio Emulator

  1. Open Android Studio and configure your environment.
  2. Create an emulator using the AVD Manager.
  3. Start the Metro Bundler:
    npx react-native start
  4. Launch the app on the emulator:
    npx react-native run-android

Option 2: Using a Physical Device

  1. Enable Developer Options on your Android device:
    • Go to Settings > About Phone > Software Information.
    • Tap on Build Number seven times to enable Developer Mode.
  2. Enable USB Debugging:
    • Go to Settings > Developer Options and toggle USB Debugging.
  3. Connect your phone to your PC via USB.
  4. Start the Metro Bundler:
    npx react-native start
  5. Launch the app on your device:
    npx react-native run-android

Debugging

If you encounter issues during setup, follow these steps:

MongoDB Connection

Ensure that your MongoDB server is running, and your IP address is whitelisted in the MongoDB Atlas dashboard.

Node.js Cache

If you encounter frontend issues, clear the build cache:

npm start --reset-cache

Python Dependencies

If the server fails to start, confirm all Python dependencies are correctly installed by re-running:

pip install -r requirements.txt

Android Studio

Ensure your Android Studio installation includes the required SDKs, and your emulator is properly configured. If errors persist, clean the Gradle build by running:

cd android
./gradlew clean

Additional Resources