Proof of Concept - Server

The server is the implementation of the agreed upon POC.

Only implement the POC, all the rest is fictional and for Adria documentation purposes only.

Starter Project

The start repository serves as the server-side starter project.

Requirements

  • Ensure unit testing for both the application and domain layers.
    • Refer to the project document for detailed testing guidelines.
  • Complete the docker-compose.yaml file with a mySQL database setup.
  • Complete the .gitlab-ci.yml file with a job to dockerize and push the image to the docker registry.
  • Correctly configure the .NET properties files.
    • appsettings.Test.json for the test environment.
      • The connection string should point to the database container defined in the docker-compose file.
    • appsettings.Development.json for the local development environment.
  • Sonar quality gates should be green.

Prerequisites

  • Ensure .NET 10 and docker desktop are installed on your machine.

Testing & quality checks locally

Running the project locally

  1. Boot your database container.
docker compose -f config/docker/docker-compose.yml up -d
  1. Run the server project with the command
 dotnet run --project src/AdProject.Main

Local Endpoints

  • Database:
    • Connect to the mysql database with any MySQL client (e.g. DataGrip).
  • Server Logs:
    • Available via terminal output.
  • Swagger Interface:
    • Run the application and navigate to http://localhost:8000/swagger/index.html.
  • Web Client Project:
    • Launch using an IDE like WebStorm/PhpStorm (refer to the client-side README).
  • Server API:
    • Accessible at http://localhost:8000/api/.

Production

In this project, there is no production environment.

There is only a test environment that will run on your local machine. That's why it's important that the gitlab-ci.yml file is correctly configured to push the docker image to the howest docker registry.

In the end the test environment will pull all images from the howest docker registry and run solution.

Build Pipeline

  • The build pipeline is partially pre-configured:

    • Executes unit tests on every push to the main branch.
    • Generates a SonarQube analysis.
  • The build pipeline is not fully configured, the following tasks are still required:

    • Dockerizing the application.
    • Pushing the docker image to a howest docker registry.

Command: Build and push Docker image locally

The build pipeline will build and push the Docker image to the howest docker registry.
However, you can also do this locally to speed up testing.

Please use brainpower to adapt the commands to your needs.

Building an image

docker build -t hcr.technet.howest.be/adria-server-group-XX:latest .

Pushing to the howest docker registry

docker push hcr.technet.howest.be/adria-server-group-00:latest

Running the client and server containers locally

To run the client and server locally, just execute the server and client projects from within their own IDEs or terminals.

Only do this during development. Integration testing should always be done using the test environment (see test environment documentation).

In real situations, it's not even common to run both client and server on the same machine.
Mostly, the server api is tested by implementing integration tests or by using Swagger or any api testing tool (e.g. Postman).