Deployment Manual
How to deploy our system.
Backend
- Make sure you have PostgreSQL installed on your machine. You can download and install PostgreSQL from the official website: https://www.postgresql.org/download/
-
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 insrc/main/resources/database.sql
You can import it using thepsql
command line tool or a graphical user interface like pgAdmin or DBeaver. - Open the project in your favorite IDE and navigate to the "src/main/resources" folder.
-
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. -
Run the project using the Gradle wrapper. Open a terminal and navigate to the
/porterble/
directory. Run the following command:
./gradlew bootRun
- The Spring Boot application should now be running. You can access it by navigating to http://localhost:8080/ in your web browser.
- Deployment to production is fully automated and is triggered on every commit in the pipeline
Frontend
-
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 -
Navigate to the frontend directory
/porterble-ui/
inside the project folder. -
Install all the dependencies required for the React application by running the following
command:
npm install
-
Once all the dependencies are installed, start the React application by running the
following command:
npm start
- This will start the React development server. You can access it by navigating to http://localhost:3000
Android Application
- Install Android Studio from: https://developer.android.com/studio to be able to compile our app source code.
-
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. -
Next, in Android Studio, navigate to
Build > Build Bundle(s) / APK(s) > Build APK(s)
-
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 - Transfer this file to your Android device.
- After this is done, go to the "Settings" app on your device.
- Click on "Security and Privacy".
- Turn on the "Unknown Sources" option to allow the installation of apps from sources other than the Google Play Store.
- 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.
- Click on "Install" to start the installation process.
- 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.
- Turn on Bluetooth and Location tracking on your device.
- Launch the app.