Deployment Manual

How to deploy our system.

Backend

  1. Make sure you have PostgreSQL installed on your machine. You can download and install PostgreSQL from the official website: https://www.postgresql.org/download/
  2. Open the PostgreSQL command prompt and enter the following commands to create a new database called "postgres":
    CREATE DATABASE postgres;
    or, you can use a graphical user interface like pgAdmin. The rest will be created by the application on the startup. Alternatively, you can use the database dump provided in src/main/resources/database.sql You can import it using the psql command line tool or a graphical user interface like pgAdmin or DBeaver.
  3. Open the project in your favorite IDE and navigate to the "src/main/resources" folder.
  4. Open the "application.yml" file and update the following properties:
    spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
    spring.datasource.username=username
    spring.datasource.password=password
    Replace "username" and "password" with your PostgreSQL username and password.
  5. Run the project using the Gradle wrapper. Open a terminal and navigate to the /porterble/ directory. Run the following command:
    ./gradlew bootRun
  6. The Spring Boot application should now be running. You can access it by navigating to http://localhost:8080/ in your web browser.
  7. Deployment to production is fully automated and is triggered on every commit in the pipeline

Frontend

  1. First, make sure you have Node.js and npm (Node Package Manager) installed on your system. You can download them from the official website: https://nodejs.org/en/download/
    We used npm@9.5.0 and node@18.15.0
  2. Navigate to the frontend directory /porterble-ui/ inside the project folder.
  3. Install all the dependencies required for the React application by running the following command:
    npm install
  4. Once all the dependencies are installed, start the React application by running the following command:
    npm start
  5. This will start the React development server. You can access it by navigating to http://localhost:3000

Android Application

  1. Install Android Studio from: https://developer.android.com/studio to be able to compile our app source code.
  2. In Android Studio, go to File > Open and locate our project folder, which should be called PorterBLE-Scanner. It may take a few moments for Android Studio to load the folder, sync the Gradle implementationa and install other dependencies.
  3. Next, in Android Studio, navigate to Build > Build Bundle(s) / APK(s) > Build APK(s)
  4. The building of the APK file will commence, which may take a couple of minutes, but once this is done, a pop-up message will appear with a button to click on which shows where the APK file has been created. It should be stored under PorterBLE-Scanner \ app \ build \ outputs \ apk \ debug and it should be called app-debug.apk
  5. Transfer this file to your Android device.
  6. After this is done, go to the "Settings" app on your device.
  7. Click on "Security and Privacy".
  8. Turn on the "Unknown Sources" option to allow the installation of apps from sources other than the Google Play Store.
  9. Go to "My Files" on your device, find the location where you saved the APK file and click on it to start the installation process.
  10. Click on "Install" to start the installation process.
  11. The application needs a few permissions:
    • Go to the "Settings" app on your device.
    • Click on "Apps & Notifications".
    • Find the PorterBLE Scanner app you just installed and click on it.
    • Click on "Permissions".
    • Turn on the "Location", "Nearby Devices" and "Notifications" permissions.
      These should be requested by default by the app, however, make sure they are allowed.
  12. Turn on Bluetooth and Location tracking on your device.
  13. Launch the app.