Skip to content

Commit

Permalink
Fixed pharmacy rating and improved readme for delivery of the checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-j3sus committed May 9, 2024
1 parent 13a28e8 commit 278bdb5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 27 deletions.
65 changes: 40 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
- [110860 André Jesus](https://github.com/andre-j3sus)
- [110893 Nyckollas Brandão](https://github.com/Nyckoka)

Professor: João Garcia
Professors: João Coelho Garcia and David Rogério Póvoa de Matos

@IST<br>
Master in Computer Science and Computer Engineering<br>
Mobile and Ubiquitous Computing - Group 03<br>
Summer Semester of 2023/2024

## Table of Contents 📜
## Table of Contents

- [Architecture 🏗️](#architecture-)
- [Architecture](#architecture-)
- [Backend](#backend)
- [Frontend](#frontend)
- [How to Run ▶️](#how-to-run)

<!--For more in-depth knowledge about the project, check the paper about it [here](./ist-meic-cmu-g03.pdf).-->
- [How to Run](#how-to-run)

---

## Architecture 🏗️
## Architecture

### Backend

The backend code is located in the [`src/backend`](./src/backend) directory.

The backend is a **REST API** built using **[Spring Boot](https://spring.io/projects/spring-boot)** and
**[Kotlin](https://kotlinlang.org/)**. It is responsible for managing the data and the business logic of the
The backend is a **REST API** built using **[Spring Boot](https://spring.io/projects/spring-boot)**
and
**[Kotlin](https://kotlinlang.org/)**. It is responsible for managing the data and the business
logic of the
application.

It's implemented following the **layered architecture** pattern, with the following layers:
Expand All @@ -42,50 +42,65 @@ It's implemented following the **layered architecture** pattern, with the follow
- **Service**: responsible for the business logic of the application.
- **Repository**: responsible for managing the data.

For simplicity, the backend uses an **in-memory database** to store the data. This means that the data is not persisted
between runs of the application. A future improvement could be to use a **relational database** to store the data.
For simplicity, the backend uses an **in-memory database** to store the data. This means that the
data is not persisted
between runs of the application. A future improvement could be to use a **relational database** to
store the data.

### Frontend

The frontend code is located in the [`src/frontend`](./src/frontend) directory.

The frontend is a **mobile application** for **Android** built using **[Kotlin](https://kotlinlang.org/)** and
The frontend is a **mobile application** for **Android** built using *
*[Kotlin](https://kotlinlang.org/)** and
**[Jetpack Compose](https://developer.android.com/develop/ui/compose)**. It is
responsible for providing a user interface for the application.

The frontend code is organized as follows:

- [Domain](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/domain): contains the domain models of the
- [Domain](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/domain): contains the domain
models of the
application.
- [Service](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/service): contains the service classes that
- [Service](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/service): contains the
service classes that
interact with the backend.
- [Session](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/session): contains the session classes that
- [Session](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/session): contains the
session classes that
manage the user session.
- [UI](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/ui): contains the UI components of the application.
- [Screens](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/ui/screens): contains the screens of the
- [UI](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/ui): contains the UI components of
the application.
- [Screens](src/frontend/app/src/main/kotlin/pt/ulisboa/ist/pharmacist/ui/screens): contains the
screens of the
application, where each screen is implemented using a:
- **<ScreenName>Screen.kt**: the screen composable.
- **<ScreenName>ViewModel.kt**: the view model of the screen, responsible for managing the screen's state.
- **<ScreenName>ViewModel.kt**: the view model of the screen, responsible for managing the
screen's state.
- **<ScreenName>Activity.kt**: the activity that hosts the screen.

---

## How to Run ▶️
## How to Run

To run the project, follow these steps:

1. Clone the repository:
1. Clone the repository or download the source code;

2. Run the **Docker Compose** command in the `src/backend` directory to start the server:

```bash
git clone
cd src/backend
docker-compose up
```

2. Run the **Docker Compose** command in the `src/backend` directory to start the server:
**Note:** if you do not have Docker installed, you can run the backend server using the following command:

```bash
cd src/backend
docker-compose up
gradlew clean build
gradlew bootRun
```

3. Open the frontend project in **Android Studio** and run the application on an **Android Emulator** or a **Physical
Device**.
In any of the cases, the server will be running on `http://localhost:8080`.

3. Open the frontend project in **Android Studio** and run the application on an
**Android Emulator** or a **Physical Device**.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ fun PharmacyRating(

// Global Rating
Row {
Text(
text = "${pharmacy.pharmacy.globalRating ?: 0}",
Text(// only with one decimal
text = "${pharmacy.pharmacy.globalRating?.let { String.format("%.1f", it) } ?: 0}",
style = MaterialTheme.typography.titleLarge,
textAlign = TextAlign.Center,
fontSize = 40.sp,
Expand Down

0 comments on commit 278bdb5

Please sign in to comment.