This project was archived on the 02.09.2025. A new Repository was created that combines both the Frontend and the backend of the "Project Metadata Platform". It can be found here: https://github.com/appsfactorygmbh/project-metadata-platform
This project is an ASP.NET Core application using Entity Framework Core and PostgreSQL. It provides a RESTful API for managing metadata of projects.
-
Clone the repository:
git clone <repository-url> cd backend
-
Restore the dependencies:
dotnet restore
dotnet buildBuilds the app.
Running the app locally requires a PostgreSQL database. The repository already contains a corresponding docker compose file. First, install Docker and Docker Compose: https://docs.docker.com/get-docker/ and https://docs.docker.com/compose/install/. Then, run the following command inside the repository directory to start the database container:
docker compose -f docker-compose-database.yml up --remove-orphans -dNext, open a terminal in the ProjectMetadataPlatform.Api directory and run the following command to apply any existing migrations to the database:
With powershell (You may have to run dotnet tool update --global PowerShell first):
pwsh .\dotnet_ef.ps1 database updateWith bash:
sh ./dotnet_ef.sh database update
```
You can now run the app with the following command or an IDE of your choice:
```sh
dotnet rundotnet testRuns unit tests with NUnit.
The project is build following the Clean Architecture principles. The project is structured as follows:
-
ProjectMetadataPlatform.Application: Application layer -
ProjectMetadataPlatform.Domain: Domain layer -
ProjectMetadataPlatform.Infrastructure: Infrastructure layer -
ProjectMetadataPlatform.Api: Api/Presentation layer -
tests/ProjectMetadataPlatform.Application.Tests: Application layer tests -
tests/ProjectMetadataPlatform.Domain.Tests: Domain layer tests -
tests/ProjectMetadataPlatform.Infrastructure.Tests: Infrastructure layer tests -
tests/ProjectMetadataPlatform.Api.Tests: Api/Presentation layer tests
See the Run-Script section for how to run the application with a local database.
When changing the domain models or their configurations in the infrastructure layer, you need to create a new migration.
-
Create a local database container according to the instructions in the Run-Script section.
-
Open a terminal in the
ProjectMetadataPlatform.Apidirectory. -
Run the following command to apply the existing migrations to the database:
With powershell:
pwsh .\dotnet_ef.ps1 database update
With bash:
sh ./dotnet_ef.sh database update
-
Make the required changes to the domain models or their configurations.
-
Run the following command to create a new migration:
With powershell:
pwsh .\dotnet_ef.ps1 migrations add <migration-name>
With bash:
sh ./dotnet_ef.sh migrations add <migration-name>
-
Commit the generated migration files. The files can be found in the
ProjectMetadataPlatform.Infrastructure/Migrationsdirectory. -
Push the changes to github and create a merge request.
-
Run the following command to create the migration script, then add it to the merge request description:
With powershell:
pwsh .\dotnet_ef.ps1 migrations script <name-of-the-last-migration>
With bash:
sh ./dotnet_ef.sh migrations script <name-of-the-last-migration>
-
Run the migration script on the database once the merge request is approved and merged onto main.