-
Notifications
You must be signed in to change notification settings - Fork 0
Instructions
a) Installing the Client:
The final submission client installer is located in the releases directory under the name #TODO. To install the client, please choose the right installer for your system. (.dmg for Mac and .msi for Windows)
b) Installing the Server:
To run the client successfully, no installation of the server is needed as the server is located on Google Cloud Platform. The client application will automatically send requests to the cloud server. More specifically, we have a Cloud SQL instance running for our Postgres database, and we have two Cloud Run instances for our Ktor server and our Spring Boot server.
c) Building/Running the Project
To build/run our project for grading, here are the following instructions for our three main components
1) Client:
-
Packaging:
To package the app, simply go to the Gradle menu on IntelliJ and go to the application folder and then the compose desktop folder in which you will find the command packageDmg (or for Windows packageMSI). This will create an installer on your local machine. The installer is usually installed in application/build/compose/binaries/main/dmg (or /msi).
-
Running locally
To run the source code to create our client, simply navigate to the main.kt file and run the main function.
2) Ktor Server:
-
Building/Running:
To run/build our ktor server to recreate a local instance of the server, there are three options depending on which is simplest for you:
-
Pulling from Docker Hub and running the image
-
Building the image from the Dockerfile yourself and running it.
-
Combine the building and running with Docker Compose.
Note that this local server will still connect to the Cloud for the database instance.
Option 1: Docker Hub
To pull our prebuilt image on Docker Hub, simply execute the following command on the terminal
docker pull calendarapp346/calendar-app-servers:tag1. After successfully pulling it, simply run the image with the following command:docker run -p 8080:8080 calendarapp346/calendar-app-servers:tag1.Option 2. Dockerfile To build the image yourself, you will first need to build the Fat Jar of the server. You can either go to the root of the project and do
./gradlew :server:buildFatJaror you can build it with the gradle menu on IntelliJ. It can be found in server/ktor/buildFatJar. Afterwards, navigate to the server directory and execute the following command:docker build -f Dockerfile .Note: the period is important in the command.After the image has been built, you can run it with
docker run -p 8080:8080 <image_name>where image_name is the name of the image you just built. You can see the image_name in Docker Desktop.Option 3. Docker Compose
Docker Compose will automate the whole process of building and running it. Docker Compose should already be available with the installation of Docker Desktop. Simply navigate to the plannerServer directory and execute
docker compose up --buildto up the server. After the building is done, the server will automatically be up just like the two previous options.
3) Spring Boot Server:
Building/Running:
To run/build our Spring Boot server to recreate a local instance of the server, there are three options depending on which is simplest for you:
-
Pulling from Docker Hub and running the image
-
Building the image from the Dockerfile yourself and running it.
-
Combine the building and running with Docker Compose.
Option 1: Docker Hub
To pull our prebuilt image on Docker Hub, simply execute the following command on the terminal
docker pull calendarapp346/calendar-app-servers:tag1After successfully pulling it, simply run the image with the following command:docker run -p 8081:8081 calendarapp346/calendar-app-servers:tag1Option 2. Dockerfile
To build the image yourself, simply navigate to the plannerServer folder and execute the following command:
docker build -f Dockerfile-planner .Note: the period is important in the command.The build might take some time, as it is taking care of building the Jar file as well. After the image has been built, you can run it with “docker run -p 8081:8081 <image_name>” where image_name is the name of the image you just built. You can see the image_name in Docker Desktop.
Option 3. Docker Compose
Docker Compose will automate the whole process of building and running it. Docker Compose should already be available with the installation of Docker Desktop. Simply navigate to the plannerServer directory and execute
docker compose up --buildto up the server. After the building is done, the server will automatically be up just like the two previous options.
**4) Running the Tests: **
Running the tests will take some extra work as they are set up to run on a local server due to us not wanting to send too many requests to the cloud and to not clutter our main database. We also want to use a local Postgres database instead of the Cloud one.
The installations are relatively simple. We have already set up Docker images to run that will create the local server and database for testing purposes.