Phase 2 notes:
- The REST server is now hosted on an Azure Cloud virtual machine at
http://20.124.182.63:8080
. - By Default, the android application will access this remote server to fetch resources. If you wish to change this behaviour, edit the url constant at
BobaBuddyUI/lib/utils/constant.dart
. - If you are running the server on your local machine, use the android loopback address
http://10.0.2.2 :8080
.
- Clone the repo
- Let gradle set up the project dependencies
- Note that this project requires Java 11 and higher.
- run BobabuddyApplication in src/main/java
- Spring boot will initialize an embedded tomcat web server on localhost, which you can access with curl through
url:
http://127.0.0.1:8080/<api-endpoints>
- If you wish to interface with this backend server directly, you can do so via the http clients built into intellij. Note that A firebase idToken in header
X-Authentication-Firebase
need to be passed to the server for the request to be authenticated. Without completely breaching security by leaking the firebase project private key, this key can only be generated by the android app with email/password login. - The database has a default admin user
[email protected]
with passwordmas123
. You can use this credential to login from the android app.
###Sample api calls:
- creating a store (require admin privilege):
POST http://localhost:8080/admin/stores
Content-Type: application/json
X-Authentication-Firebase: <idToken>
{
"name": "bob's bubble tea",
"location": "St.George"
}
- creating an item and add it to a store (require admin privilege):
POST http://localhost:8080/stores/<storeId>/items
Content-Type: application/json
X-Authentication-Firebase: <idToken>
{
"price": 17,
"name": "milk tea"
}
creating a user
POST http://localhost:8080/users
Content-Type: application/json
{
"email": "[email protected]",
"name": "yeye",
}
creating a rating and add association
POST http://localhost:8080/stores/<storeId>/ratings/[email protected]
Content-Type: application/json
X-Authentication-Firebase: <idToken>
{
"rating": 1
}
###
POST http://localhost:8080/items/<itemId>/ratings/[email protected]
Content-Type: application/json
X-Authentication-Firebase: <idToken>
{
"rating": 0
}
search item by partial name match
GET http://localhost:8080/items/?name-contain=milk
search item by price leq & sort
GET http://localhost:8080/items/?price-leq=15&sorted=true
For all available api methods, see http://20.124.182.63:8080/swagger-ui.html
or http://127.0.0.1:8080/swagger-ui.html
when the program is running on the same machine.
The frontend android client of the application. We chose to write the UI in dart using the flutter sdk to give us complete control of design and functionality. For a full walkthrough of functionality, there is a playlist here: https://youtube.com/playlist?list=PLECF-cwue5-sygEJ1i_h4csWJfxgqw_er
Currently, the UI reflects the core functionality of our application, however, moving forward we would like to have our UI utilize all features in our backend such as finding drinks by category.
We designed this UI with the simple and intuitive use principle in mind by keeping the layout familiar, clutter-free, and easily navigable.
- the prebuilt apk is available at
BobaBuddyUI/build/app/outputs/apk/debug
. - It is recommended to run this app on a Pixel 4 emulator, as this is our development environment.
- If you wish to build from source, the following are required:
- Flutter
- Android studio
- Once you setup Flutter and android sdk in android studio, you may connect to an emulator and build the app from source.