Skip to content

phase 4

Filipe Freitas edited this page Mar 14, 2022 · 1 revision

Phase 4

Introduction

This document describes the requirements for the fourth and final phase of the Software Laboratory project.

Requirements

Using PostgreSQL

Use the PostgreSQL Relational Database Management System, instead of SQL Server.

  • Install PostgreSQL on the development machines. Alternatively, use a docker image (see build.gradle).
  • Obtain and use a JDBC driver for PostgreSQL.
  • Change both the DDL and DML statements to use the PostgreSQL dialect.
  • Use the JDBC_DATABASE_URL environment variable to configure the PostgreSQL connection settings.

Hosting on Heroku

Host the application on the Heroku.

  • Create an Heroku free account. Heroku is an example of a Platform-as-a-Service (PaaS) provider.
  • Install the Heroku CLI (Command Line Interface) on all the development machines.
  • On the Heroku web site, create a new application
    • The name should follow the following structure:isel-ls-2021-2-g<número-do-grupo>.
    • Select the "Europe" region.
  • On the application home page, provision the "Heroku Postgres" add-on using the "Hobby Dev - Free" plan.
    • The JDBC_DATABASE_URL environment variable will be automatically added to Java the execution environment.
  • Create the Procfile file with web: followed up by the necessary to start the application.
  • On the command line, do heroku login.
  • On the command line, inside the project root folder, do heroku git:remote -a isel-ls-2021-2-gXX. This will create a Git remote pointing to the Heroku repository.

Resource creation via the HTTP interface

The main goal for this requirement is to add support for the commands with POST method in the HTTP interface. For that, the representations for the following resources should be augmented with HTML forms:

  • /users
  • /routes
  • /sports
  • /sports/{sid}/activities

Each one of these forms must, when submitted, send a POST request to the associated resource. For instance:

  • The representation returned on a GET /users request should contain a form with the fields name and email.
  • This form, when submitted, must send a POST request to /users containing these two fields in the body.
  • If the POST request is successful, i.e. a new user was created, its response should be a 303 See Other with the Location header pointing to the created resource (e.g. /users/{uid}).

Dependency management

For this last phase, the project should stop relying on locally stored vendor JARs and use the Gradle supported dependency management system.

Report

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.

Delivery

The completed project must be delivery until July 4 (end of week 15), via the creation of a 1.0.0 tag on the GitHub repository.

Clone this wiki locally