Skip to content
BrunoRosendo edited this page Jul 2, 2023 · 16 revisions

Website NIAEFEUP - Backend Documentation

Welcome to the NIAEFEUP Backend Documentation!

This documentation is meant to be a guide for the development of the NIAEFEUP BackEnd, and is meant to be used by the developers of the project.

Contents

Development Setup

Prerequisites

Running

With IntelliJ

Simply load the Gradle project and run the application. For automatic restart to fire up every time a source file changes, make sure that Build project automatically under File | Settings | Build, Execution, Deployment | Compiler is checked.

With the command line

Run the following command in your shell:

./gradlew bootRun

Linting

We use ktlint to ensure a consistent coding style according to the community standards, through a Gradle plugin.

With IntelliJ

Although IntelliJ does not provide linting suggestions for Kotlin out of the box, you can use a third-party plugin to run the linter at real time.

With the command line

You can fire up the analysis yourself by running in your shell:

./gradlew ktlintCheck

You can fix the lint automatically by running in your shell:

./gradlew ktlintFormat

With a git hook

You can setup a local precommit git hook for lint analysis running a Gradle task provided by the used linting plugin:

./gradlew addKtlintCheckGitPreCommitHook

Or even an auto-format hook, if that is your thing:

./gradlew addKtlintFormatGitPreCommitHook

Testing

With IntelliJ

Run the test suite as usual, selecting the respective task for running.

With the command line

Run the following command in your shell:

./gradlew test