-
Notifications
You must be signed in to change notification settings - Fork 0
Phase 4
This document describes the requirements for the fourth and final phase of the Software Laboratory project.
- Update the create user operation, to receive a password.
- Create a new operation that receives the user's email and password, and returns the user's token.
- Produce views to create a new user (Sign In) and to obtain the user's token (Login).
- The received token should be stored until the user closes the browser window/tab or explicitly executes logout.
Host the application on the Render.
-
Create a Render free account. Render is an example of a Platform-as-a-Service (PaaS) provider.
-
On the Render web site, create a new PostgreSQL instance
- Give it the
Name
:db-ls-2223-2-<turma>-g<número-do-grupo>
; - You can leave the
Database
andUser
fields empty; - Select the "Frankfurt(EU Central)" region;
- Select the Free instance type, and click
Create Database
; - Wait for the creation of the database;
- Create the tables in the render Postgres database, use psql, pgAdmin or a similar tool.
- Note that the connection URL must be in the JDBC format (ex.
jdbc:postgresql://<hostname>.frankfurt-postgres.render.com:<port>/<database>?user=<username>&password=<password>
), so you will need to build it from the information provided in the render dashboard.
- Note that the connection URL must be in the JDBC format (ex.
- Give it the
-
On the command line, run
gradlew build
in the project root directory. -
Create a docker free account; for more information about the Docker environment, check here.
-
Install Docker Desktop
-
Add the
Dockerfile
to the root of the group repository, this file should contain all the information to create the docker image, see our example here. -
On the command line, do
docker login
. -
Create the docker image , on the command line, do
docker build -t <docker-username>/img-ls-2223-2-<turma>-g<número-do-grupo> .
(for Mac computers with M1 or M2 include --platform linux/amd64) -
Push the image to docker hub, on the command line, do
docker push <docker-username>/img-ls-2223-2-<turma>-g<número-do-grupo>
-
On the Render web site, create a new Web Service with the name
service-ls-2223-2-<turma>-g<número-do-grupo>
- Select
Deploy an existing image from a registry
- Insert Image URL,
docker.io/<docker-username>/img-ls-2223-2-<turma>-g<número-do-grupo>
- Name your application and select the "Frankfurt(EU Central)" region
- Select the free instance type
- Add a
JDBC_DATABASE_URL
environment variable to your the new Web Service, using the credentials available in render Postgres dashboard (ex.jdbc:postgresql://<hostname>.frankfurt-postgres.render.com:<port>/<database>?user=<username>&password=<password>
)
- Select
- Click create service and wait for the service creation
Note: The service port must be obtained from the environment variable PORT
.
To launch application in developer machine:
docker run -d -p 9000:8080 --env PORT=8080 --env JDBC_DATABASE_URL="jdbc:postgresql://host.docker.internal/<database>?user=<username>&password=<password>" <username docker>/img-ls-2223-2-<turma>-g<número-do-grupo>
This phase should be used to critically review all code baseline, and refactoring to improve code quality should be a goal. Also, more tests should be produced ir order to increase the overall coverage.
The technical report should be updated and/or extended with the relevant technical information. The sections developed in the previous phases can be improved or changed. There should not be a separate report for each phase.
The completed project must be delivery until June 11 (end of week 15), via the creation of a 1.0.0
tag on the GitHub repository.