Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

System Manual

Burak Onur Duman edited this page Jan 7, 2022 · 14 revisions

Mobile

1. System requirements

Minimum

SDK Version/API Level Release Name Target
21 Lollipop Android 5.0 Google Inc

Target

SDK Version/API Level Release Name Target
30 R Android 11.0 Google Inc

Minium

Node.JS Version
16.0.0 or higher

Minium

Npm Version
8.3.0

2. Installation instructions with APK

Creating APK

  1. Clone the project
git clone https://github.com/bounswe/2021SpringGroup3.git
  1. Go to the project directory and run the command:
cd 2021SpringGroup3/mobile/CmpE451_App
  1. Copy the .env file for the API key.
  2. You should install necessary packages from the terminal.
npm i 
  1. You should install last version Android Studio and Android emulator
  2. Open an emulator from the android studio
  3. Check the emulator to figure out whether it is running or not
adb devices // You should see running emulators' port numbers on the terminal. 
  1. Run the project code
npx react-native run-android // If everything is okay
  1. Open the 'android' directory with android studio as project
  2. Click the 'build' button at the top of the studio
  3. Click 'Generate Signed Bundle / APK' button listed in the opened menu
  4. Select APK and click Next
  5. Generate New Key Store Path
  6. Select path and fill wanted info from you (Password, First and Last Name, Organization, ....) and then click ok.
  7. Enter the 'Key Store Password' and 'Key Password'
  8. You can enter 'Key alias' which is optional.
  9. Click Next
  10. Select release and then click Finish
  11. You should see 'Gradle Build Running' label at the right bottom of the studio // It takes a few minutes
  12. Click 'Locate' button on the 'finish' pop-up of the studio. Then you should see 'release' directory. APK is under the that directory.

Installing APK

  1. Download the APK file on your android device
  2. Click the file and install the application // You should configure phone settings

3. Running APK on Android emulator

  1. Clone the project
git clone https://github.com/bounswe/2021SpringGroup3.git
  1. Go to the project directory and run the command:
cd 2021SpringGroup3/mobile/CmpE451_App
  1. Copy the .env file for the API key.
  2. You should install necessary packages from the terminal.
npm i 
  1. You should install last version Android Studio and Android emulator
  2. Open an emulator from the android studio in AVD manager
  3. Check the emulator to figure out whether it is running or not
adb devices // You should see running emulators' port numbers on the terminal. 
  1. Run the project code
npx react-native run-android // You should see the app interface running on the emulator

Web

1. System Requirements & Prerequisites

You can run the setup explained below in any operating system, however, Windows 10 is recommended. After the deployment, for the client-side, you can use most of the browsers, and again Google Chrome is recommended. You will need those ready to start with your deployment.

  1. GitHub Account
  2. NodeJS
  3. Docker Desktop
  4. Azure Account

2. Deployment Instructions

  1. Clone the project:
git clone https://github.com/bounswe/2021SpringGroup3.git
  1. Go to the web folder inside the project directory and install npm modules:
cd web
npm install
  1. In the "web" directory, create a ".env" file and enter the following line (you need to obtain a Google Maps API Key for this step):
REACT_APP_GOOGLE_MAPS_API_KEY={YOUR_API_KEY}
  1. Add a "Dockerfile.prod":
# build environment
FROM node:13.12.0-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN npm ci --silent
RUN npm install react-scripts@3.4.1 -g --silent
COPY . ./
RUN npm run build

# production environment
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
# new
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
  1. Create a new folder named "nginx" and in that folder, create a "nginx.conf":
server {

  listen 80;

  location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
    try_files $uri $uri/ /index.html;
  }

  error_page   500 502 503 504  /50x.html;

  location = /50x.html {
    root   /usr/share/nginx/html;
  }

}
  1. Using the production Dockerfile, build and tag the Docker image:
docker build -f Dockerfile.prod -t sample:prod .
  1. Log in to Docker Hub
docker login
  1. Before pushing your image, rename it in the following format:
docker tag sample:prod {YOUR_DOCKERHUB_NAME}/{IMAGE_NAME}
  1. Push your image to the Docker Registry
docker push {YOUR_DOCKERHUB_NAME}/{IMAGE_NAME}
  1. Go back to the "web" directory and enter the following command to log in to Azure:
cd ..
docker login azure
  1. After logging in to Azure, create a new ACI context:
docker context create aci myacicontext
  1. Finally, run your container:
docker --context myacicontext run -p 80:80 {YOUR_DOCKERHUB_NAME}/{IMAGE_NAME}
  1. Now, you can head to Azure Portal, navigate to your subscription, find your resource group and you will be able to see a resource of type "Container Instances". In the overview page of that resource, you can find the public ip address which you can use to access your deployed application.

Backend

1. System requirements

You can run our backend almost on any machine, but Ubuntu 16 is recommended. Our Nodejs version is 14.17.6

2. MongoDB Installation instructions

1.Create a new MongoDB deployment. If you wish you can also use SaaS solutions like MongoDB Atlas (recommended) . If you want to install community version, you can get it from this link MongoDB Download

2.Create a user inside the database to access it. User should have read/write access MongoDB User Creation

3.Create a connection uri for Nodejs server, guide can be founded here Connection Uri Creation

3. NodeJS Installation instructions

1.Create a new virtual machine with any service you like such as AWS, Digital Ocean

2.Go to repository settings and add credentials of this machine, IP adress, username and password required

3.Download git cli to your machine if it doesn’t have it from this link. Recommended Ubuntu have this package preinstalled Git Download

4.Download Nodejs and npm to your machine from this link NodeJS Download

5.Install yarn package manager and pm2 process controller globally to your machine using npm

npm i -g yarn pm2

6.Create a new .env file in your root directory (or into your login directory when you ssh), example file: Example .env file for backend. The file we used will be sent to you.

7.Go to Actions in the repo, run backend-deploy. Nodejs server will be deployed to your machine.

4. Getting MongoDB Dump

  1. Install MongoDB Community package to your machine Guide Link. You can use the command below to get dump of the database. --uri parameter can be set to any working connection uri. Dump will be created in dump folder.
mongodump --uri="mongodb://backend:6CSn4seaXmabjdYQ@64.225.110.78:1234/prod?authSource=admin&retryWrites=true&w=majority"

5. Restoring MongoDB Dump

  1. You can simply restore the dump file with mongorestore command. MongoDB Community package should be installed on your computer. You can find instructions Guide Link here.
mongorestore --uri="your new connection uri" /dump

Clone this wiki locally