Created using Canva | Graphic resources from Canva and Freepik (macrovector)
Install the latest versions of Node.js, React Native and React
-
Clone the respository:
git clone git@github.com:bandaranayake/petbuddy.git
-
Select one Project:
Select Android Application
cd petbuddy-app
Select Admin Dashboard
cd petbuddy-admin-web
Select Cloud Functions
cd petbuddy-api
-
Update Firebase Configurations
Android Application
-
Rename
android\app\google-services.example.json
toandroid\app\google-services.json
-
Download the configuration file from Firebase console and update the
google-services.json
Admin Dashboard
-
Rename
.env.example
to.env
-
Add following configurations,
REACT_APP_API_KEY REACT_APP_AUTH_DOMAIN REACT_APP_DATABASE_URL
Cloud Functions
-
Rename
.env.example
to.env
-
Add following configurations,
REACT_APP_DATABASE_URL
-
Rename
credentials.example.json
tocredentials.json
-
Add Firebase Service Account details
-
-
Install packages:
# Using npm npm install # Using yarn yarn
-
Run:
Android Application
(i) via USB
# Using npm npm start # Using yarn yarn start
(ii) via WiFi
How to install and debug react-native app without USB
Admin Dashboard
# Using npm npm start # Using yarn yarn start
Cloud Functions
firebase serve
Build the app
- Create a release build
cd android && gradlew assembleRelease
- Create a debug build
yarn android
This project is hosted on firebase. React app should be build inorder to deploy.
-
Build the App
# Using npm npm run build # Using yarn yarn build
-
Deploy to Firebase
firebase deploy --only hosting
Deploy to Firebase
firebase deploy --only functions
- Change the current working directory to
petbuddy-app
cd petbuddy-app
- Build the image
docker build -t petbuddy-app .
- Create and start the container
docker run -tp 8081:8081 petbuddy-app
- Build and run the app
- Create a release build
cd android && ./gradlew assembleRelease
- Install and debug the app on a device via Wifi
Connect the device via USB to the host computer and run the following command on the host computer
adb tcpip <port-number>
Remove USB and run the following commands inside the container
adb connect <device-ip>:<port-number>
yarn android
Change bundle location on the device to
<host-ip>:8081
- Change the current working directory to
petbuddy-admin-web
cd petbuddy-admin-web
- Build the image
docker-compose up
- Create and start the container
docker run -tp 3000:3000 <image-name>