This project is an application for the storage and management of project metadata. This repository contains both an ASP.NET Core backend providing a RESTful API and a VUE 3 web frontend.
.github:workflows: Github Actions
.vscode: Config for IDEdeployment: Files needed to build and deploy the projectdocker: Docker compose files and dockerfiles
screenshots: Screenshots of the frontend webpagesrc: Source filesbackend: Files of the backend projectfrontend: Files of the frontend project
- .NET 8 SDK
- Node.js (v16+)
- Corepack (manages package managers like Yarn)
- Yarn
-
Clone the repository:
git clone <repository-url> cd project-metadata-platform
-
Restore the backend dependencies:
cd src/backend dotnet restore -
Enable Corepack and install frontend dependencies:
cd ../../src/frontend corepack enable yarn install
The folder deployment/docker folder contains a minimal docker compose file for local deployment for testing purposes. To build and start the the application run this command in the directory:
docker compose -f docker-compose-local-build.yml up --build -dThe frontend is available at http://localhost:8090 and the Swagger UI of the backend API is available at http://localhost:8090/swagger/index.html.
If SSO should be enabled add the following env variables to deployment/docker/docker-compose-local-build.yml:
- AZURE_AUTHORITY=<Valid Authority Url>
- AZURE_BACKEND_CLIENT_ID=<Valid Webapi App Registration>
- AZURE_SCOPE=<Valid API Scope>
- AZURE_FRONTEND_CLIENT_ID=<Valid SPA App Registration>This project is an ASP.NET Core application using Entity Framework Core and PostgreSQL. It provides a RESTful API for managing metadata of projects.
dotnet buildBuilds the app.
Running the app locally requires a PostgreSQL database. The deployment folder 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 folder deployment/docker to start the database container:
docker compose -f docker-compose-database.yml up --remove-orphans -dWhen using Visual Studio Code its enough to start debugging wth the configuration C#: PMP Backend Debug. A pre-launch task will automatically start and post-debug task will automatically stop the database.
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 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.
The Application supports authentication via basic login and SSO with Microsoft Entra ID (modeled after BFF pattern). By default the config for SSO is filled with placeholder values. When needing to debug SSO the following values in ProjectMetadataPlatform.Api/Properties/launchsettings.json have to be changed:
"AZURE_AUTHORITY":"<Valid Authority URI>",
"AZURE_BACKEND_CLIENT_ID":"<Valid Client ID for WebApi App Registration>",
"AZURE_SCOPE":"<Valid API Scope>",
"AZURE_FRONTEND_CLIENT_ID":"<Valid Client ID for SPA App Registration>",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.
This project is a Vue 3 web application with TypeScript integration, utilizing modern tools like Vite, ESLint, Prettier, and Vitest for development and testing.
Development:
yarn devRuns the app in development mode.
Build:
yarn buildBuilds the app for production.
Preview:
yarn previewPreviews the production build.
Lint:
yarn lintLints the codebase with ESLint. Recommended to execute before committing.
Format:
yarn formatFormats the codebase with Prettier. Recommended to execute before committing.
Test:
yarn testRuns unit tests with Vitest.
Test UI:
yarn test:uiRuns the Vitest UI.
public: Static public files like favicon or fontssrc: Source filesassets: Static assets like imagescomponents: Vue reusable componentsmodels: TypeScript modelsrouter: Vue router configurationservices: API servicesstore: Pinia storesviews: Vue views/pages
When using Visual Studio Code you can debug the application with either Chrome or Firefox when using the debug configurations Chrome: PMP Frontend Debug or Firefox: PMP Frontend Debug. A pre-launch task will automatically run the application in development mode, so that the browser debugger can attach and a post-debug task will cstop the application. When using a version of Chrome / Firefox that was installed via snap package, Flatpak etc. it might be necessary to alter the launch.json and add a tmp directionary for the browser to use.
Otherwise, when not using Visual Studio Code, just start the application with:
yarn devTo use the backend service during development, one needs to run the backend service locally.
-
Start the backend as described in the Run-Script section.
-
The backend service should now be available at
http://localhost:5091. This URL is already configured in the.envfile of the frontend. Simply useimport.meta.env.VITE_BACKEND_URL + "/<your-endpoint>"to access the api. For example:const response = await fetch(import.meta.env.VITE_BACKEND_URL + '/projects');
-
The env files are already configured to use the correct backend URLs in the staging and production environments. No further changes are necessary after local development is over.
-
The Swagger UI of the backend service is available at
http://localhost:5091/swagger/index.html. -
To stop the backend service, hit
Ctrl+Cin the terminal where the service is running or when using Visual Studio Code stop the backend debugging session.
The Frontend supports authentication via basic login and SSO with Microsoft Entra ID (modeled after BFF pattern). By default the config for SSO is not set. When debugging SSO add the following env variables to .env:
VITE_AZURE_FRONTEND_CLIENT_ID=<Valid Client ID for SPA App Registration>
VITE_AZURE_AUTHORITY=<Valid Authority URI>
VITE_AZURE_SCOPE=<Valid API SCope>Auth also has to be configured in the backend as described in Backend-Auth.
Login Screen
Project View
Project View - Light Mode
Create Project View
Edit Project View
Settings View - User Management
Settings View - Team Management
Settings View - Global Plugins
Settings View - Global Logs - Light Mode
