Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

appsfactorygmbh/project-metadata-platform-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Appsfactory "Metadata Platform" Backend

Overview

This project is an ASP.NET Core application using Entity Framework Core and PostgreSQL. It provides a RESTful API for managing metadata of projects.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd backend
  2. Restore the dependencies:

    dotnet restore

Scripts

Build:

dotnet build

Builds the app.

Run:

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 -d

Next, 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 update

With 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 run

Test:

dotnet test

Runs unit tests with NUnit.

Project Structure

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

Development

Running the application

See the Run-Script section for how to run the application with a local database.

Database Migrations

When changing the domain models or their configurations in the infrastructure layer, you need to create a new migration.

  1. Create a local database container according to the instructions in the Run-Script section.

  2. Open a terminal in the ProjectMetadataPlatform.Api directory.

  3. 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
  4. Make the required changes to the domain models or their configurations.

  5. 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>
  6. Commit the generated migration files. The files can be found in the ProjectMetadataPlatform.Infrastructure/Migrations directory.

  7. Push the changes to github and create a merge request.

  8. 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>
  9. Run the migration script on the database once the merge request is approved and merged onto main.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 12

Languages