This is a monorepo managed with NPM workspaces containing the following components:
- React Native app (Expo/Javascript)
- Database/API backend (Typescript)
- Bluetooth server (Python)
As NPM only manages JavaScript libraries, NPM Workspaces only handles running scripts for the Bluetooth server, not its packages. Python packages are managed by pip.
- Install the LTS version of Node.js: https://nodejs.org/en/download/current
npm installornpm i- Install the latest version of Python: https://www.python.org/downloads/
pip install -r requirements.txt
If the dependency is universal, you can use the usual npm install <PACKAGE NAME> - but if the package is specific to a workspace, it must be indicated explicitly.
npm i <PACKAGE NAME> -w <WORKSPACE NAME>
- Example installation of axios to workspace "frontend":
npm i axios -w frontend
pip install <PACKAGE NAME>
- Python packages are not managed through NPM Workspace; no special package installation command is required.
- Install all dependencies -
npm install - Generate prisma files -
npm run generate - Create a
.envfile at the root of the project and add all secrets necessary. This should be available somewhere private and secure to the team.
- Navigate to
frontend>src>components>data>LocalHost.json - In the command line, run
ipconfig, and copy the ipv4 address - Change the ipAddress parameter in the JSON file to the one on your computer
- Navigate to the frontend branch
- Delete node_modules in every folder
- Navigate to the root, run
npm install expo - Once expo is installed run
npm run prebuild - If you don't have gradle already installed on your computer navigate to https://gradle.org/install/ and follow the instructions provided for manually installation. Remember to install v8.4. Tp check which version you have run
gradle -v - If you don't have jdk already installed on your computer navigate to https://docs.oracle.com/en/java/javase/22/install/installation-jdk-microsoft-windows-platforms.html and follow the instructions provided. Remember to install JDK 17 if you have a newer version you may need to uninstall it for the application to work, the link provides instructions to do so
- Once you have verified navigate to the project's root directory and run
npm run android - In a separate terminal run
npm run serverto run the backend server
FAILURE: Build failed with an exception. What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. Could not determine the dependencies of null. SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at <FILE_LOCATION>
- Check if you have the following file in this path:
C:\Users\<UserName>\Documents\GitHub\MuHASS\frontend\android\local.properties - If you do not have this file, create the local.properties file inside the directory
C:\Users\<UserName>\Documents\GitHub\MuHASS\frontend\android\you can use the commandnotepad local.properties - Add the following line to the file:
sdk.dir=C:\\Users\\<UserName>\\AppData\\Local\\Android\\SdkThis is the location of your android sdk. - Rerun the command
npm run androidin the root directory