Aller au contenu

TP03 : Deliver the Planets API implementation

In this assignment, you will deliver the first part of results of the Node.js and OpenAPI codelab.

You must deliver the code of your Express Node.js application on git. When loading the Node.js application into WebStorm, one must be capable of successfully testing the application locally, without any other step than performing npm install.

Goals

After accomplishing this assignement, students will have implemented their first RESTful API defined with an OpenAPI specification document. This assignment should familiarize the students with the Express Node.js concept and with other Node.js modules that make an OpenAPI specification easier to implement. Delivering the Planets API is an intermediate step towards delivering your own API that will be implemented in the next assignement.

At the end of this assignment, students:

  • have installed all required tools for writing Express Node.js applications using WebStorm;
  • will know how to use those tools;
  • will understand the important concepts behind any Express Node.js application, such as routing and middleware;
  • will know how to use git for delivering the expected contentt.

The deliverables of the assignement are:

  • a git repository named “tp03” in your group on “gitlab.forge.hefr.ch” with the Express Node.js application that implements the Planets API defined in a OpenAPI specification document. Note that the Node.js modules required for the application must NOT be pushed to the repository, but must rather be added to the project/application dependencies;
  • the modified OpenAPI specification document for the Planets API that contains the correct definitions for errors, pushed to the same git repository.
  • a report in pdf format delivered using the related Teams assignment.
  • a fix for all issues that have been reported for “tp02”. Issues will be reported at latest 4 days before the deadline for delivering “tp03”. The issues must be reported as closed on git.

Deadline

The deadline for delivering this assignment is given in the semester planning and in the corresponding assignment on Teams.

Testing

Add a section in your report that document the tests that were done as documented for the Planets API in the Node.js and OpenAPI codelab codelab.

Code Analysis

You must run a static code analysis on your program. For this purpose you must:

  • Configure WebStorm properly using “File” -> “Settings” -> “Languages & Frameworks” -> “JavaScript” -> “Code Quality Tools”. In this pane, you must configure “JSHint” and “ESLint” as described below.

  • Configure “JSHint” as follows:

    • Enable “JSHint” and select the latest version (it should be version “2.13.6” that is bundled with WebStorm).
    • Select “Node.js” as environment.
    • Select ECMAScript version 6 under “Warn about incompatibilities with the specified ECMAScript version”.
  • Configure “ESLint” by selecting “Automatic ESLint configuration”.

  • Under “File” -> “Settings” -> “Languages & Frameworks” -> “Node.js”, you must enable “Coding Assistance for Node.js”.

After configuring the code quality tools, you must run a static code analysis of your project by selecting “Code” -> “Inspect Code” -> “Analyze” with the Inspection Scope set to “Whole Project”. If errors are detected, you must fix them. If this applies, you may suppress the warning - but in this case, you must document why it is safe to suppress the warning.

Report

The report must follow the following guidelines:

  • It must be written in French or English.
  • One title page with at least:
    • the school name and logo (official logo)
    • the course name : Module Application des données : Développement back-end
    • the title of the document : “Travail Pratique 3 : Réalisation de l’API Planets”
    • your group number
    • the authors’ name
    • the report delivery date
  • One short introduction for describing the context and goals
  • A summary of the concepts that are important and that you should retain/fully understand, by commenting whether
    • the concept is not well understood (non acquis);
    • the concept is essentially understood, but some points remain to be exercised; (acquis, à exercer);
    • the concept is fully undertood (acquis).
  • The parts of the code/source/specification that should be highlighted and that require specific attention.
  • Some conclusions like what you have liked or not, remarks on how the codelab or assignement can be improved, and the number of hours that you have spent for each student of the group (outside hours in the classroom).

Important

Deliver your report based on instructions received during the lesson and according to the schedule. Your document must be named “report03.pdf”.