Compare commits
13 Commits
7d9cb5e611
..
bygg
| Author | SHA1 | Date | |
|---|---|---|---|
| 21107773db | |||
| 158bd873e2 | |||
| ffa48d5370 | |||
| 240d93ace1 | |||
| 693e906ab7 | |||
| a06c329e97 | |||
| 6027cc4415 | |||
| 6b8081497f | |||
| 378418b9b6 | |||
| 8c46889650 | |||
| 600cae63a2 | |||
| 4e305c0a4a | |||
| cecf5fddc1 |
@@ -0,0 +1,31 @@
|
||||
---
|
||||
description: Start the MinAttest project (Backend + Frontend)
|
||||
---
|
||||
|
||||
# Start MinAttest
|
||||
|
||||
This workflow starts the backend (with database) and the frontend.
|
||||
|
||||
## 1. Start Backend (API + Database)
|
||||
The backend uses .NET Aspire to orchestrate the API and the PostgreSQL container.
|
||||
|
||||
```bash
|
||||
// turbo
|
||||
dotnet run --project backend/MinAttest.AppHost/MinAttest.AppHost.csproj
|
||||
```
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Check the console output for the API URL (e.g., `https://localhost:7172` or similar).
|
||||
> You may need to update `frontend/minattest-app/vite.config.ts` if the port doesn't match `10001`.
|
||||
|
||||
## 2. Start Frontend
|
||||
Open a new terminal for the frontend.
|
||||
|
||||
```bash
|
||||
cd frontend/minattest-app
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> The frontend will be available at `http://localhost:5173`.
|
||||
@@ -0,0 +1,63 @@
|
||||
name: Build & Push MinAttest
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: self-hosted
|
||||
|
||||
env:
|
||||
# Denne gir f.eks:
|
||||
# main → latest
|
||||
# develop → dev
|
||||
# dev → dev
|
||||
TAG: ${{ github.ref_name == 'main' && 'latest' || 'dev' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.theriise.net -u steinhelge --password-stdin
|
||||
|
||||
# ---------- Frontend ----------
|
||||
- name: Build Frontend (${{ env.TAG }})
|
||||
run: |
|
||||
docker build \
|
||||
-t gitea.theriise.net/steinhelge/minattest-frontend:${TAG} \
|
||||
-f frontend/minattest-app/Dockerfile \
|
||||
frontend/minattest-app
|
||||
|
||||
- name: Push Frontend (${{ env.TAG }})
|
||||
run: |
|
||||
docker push gitea.theriise.net/steinhelge/minattest-frontend:${TAG}
|
||||
|
||||
# ---------- Backend API ----------
|
||||
- name: Build API (${{ env.TAG }})
|
||||
run: |
|
||||
docker build \
|
||||
-t gitea.theriise.net/steinhelge/minattest-api:${TAG} \
|
||||
-f backend/Dockerfile \
|
||||
backend
|
||||
|
||||
- name: Push API (${{ env.TAG }})
|
||||
run: |
|
||||
docker push gitea.theriise.net/steinhelge/minattest-api:${TAG}
|
||||
|
||||
# ---------- App Host / BFF ----------
|
||||
- name: Build App Host (${{ env.TAG }})
|
||||
run: |
|
||||
docker build \
|
||||
-t gitea.theriise.net/steinhelge/minattest-app-host:${TAG} \
|
||||
-f frontend/minattest-app-host/Dockerfile \
|
||||
frontend/minattest-app-host
|
||||
|
||||
- name: Push App Host (${{ env.TAG }})
|
||||
run: |
|
||||
docker push gitea.theriise.net/steinhelge/minattest-app-host:${TAG}
|
||||
@@ -0,0 +1 @@
|
||||
# ci ping ma. 17. nov. 20:22:27 +0100 2025
|
||||
@@ -0,0 +1,2 @@
|
||||
# test ma. 17. nov. 17:50:01 +0100 2025
|
||||
# test ma. 17. nov. 17:51:01 +0100 2025
|
||||
@@ -3,7 +3,7 @@
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "9.0.9",
|
||||
"version": "9.0.11",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
],
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<PackageReference Include="MediatR" Version="12.*" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.*" />
|
||||
<PackageReference Include="FluentValidation" Version="12.*" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.11" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MinAttest.Domain\MinAttest.Domain.csproj" />
|
||||
|
||||
Generated
+1
-1
@@ -20,7 +20,7 @@ namespace MinAttest.Infrastructure.Data.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ namespace MinAttest.Infrastructure.Data.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
backend/src/MinAttest.Infrastructure/Data/Migrations/20250913112309_EnableTemporalTables.Designer.cs
Generated
+1
-1
@@ -20,7 +20,7 @@ namespace MinAttest.Infrastructure.Data.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
Generated
+1
-1
@@ -20,7 +20,7 @@ namespace MinAttest.Infrastructure.Data.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ namespace MinAttest.Infrastructure.Data.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace MinAttest.Infrastructure.Data.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.9")
|
||||
.HasAnnotation("ProductVersion", "9.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.*" />
|
||||
<PackageReference Include="FluentAssertions" Version="8.*" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.*" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.11" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.11" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.11" />
|
||||
<PackageReference Include="Azure.Core" Version="1.48.0" />
|
||||
<PackageReference Include="Testcontainers" Version="4.*" />
|
||||
<PackageReference Include="Testcontainers.MsSql" Version="4.*" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>MinAttest</title>
|
||||
<title>MinAttest.</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
# Start MinAttest Development Environment (Windows)
|
||||
|
||||
Write-Host "🚀 Starting MinAttest Development Environment..." -ForegroundColor Cyan
|
||||
|
||||
# Function to check if a port is in use
|
||||
function Test-PortInUse {
|
||||
param (
|
||||
[int]$Port
|
||||
)
|
||||
$tcpConnection = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue
|
||||
return $tcpConnection -ne $null
|
||||
}
|
||||
|
||||
# 1. Start Backend (Aspire AppHost) - Port 7172
|
||||
if (Test-PortInUse -Port 7172) {
|
||||
Write-Host "✅ Backend (API) is already running on port 7172." -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "🚀 Starting Backend (Aspire AppHost)..." -ForegroundColor Yellow
|
||||
Start-Process -FilePath "dotnet" -ArgumentList "run --project backend/MinAttest.AppHost/MinAttest.AppHost.csproj" -NoNewWindow
|
||||
|
||||
# Wait loop (simple pause as checking port immediately might be flaky during startup)
|
||||
Start-Sleep -Seconds 5
|
||||
}
|
||||
|
||||
# 2. Start BFF (Reverse Proxy) - Port 10001
|
||||
if (Test-PortInUse -Port 10001) {
|
||||
Write-Host "✅ BFF is already running on port 10001." -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "🚀 Starting BFF..." -ForegroundColor Yellow
|
||||
Start-Process -FilePath "dotnet" -ArgumentList "run --project frontend/minattest-app-host/minattest-app-host.csproj" -NoNewWindow
|
||||
Start-Sleep -Seconds 2
|
||||
}
|
||||
|
||||
# 3. Start Frontend (Vite) - Port 5173
|
||||
if (Test-PortInUse -Port 5173) {
|
||||
Write-Host "✅ Frontend is already running on port 5173." -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "🚀 Starting Frontend..." -ForegroundColor Yellow
|
||||
Set-Location "frontend/minattest-app"
|
||||
|
||||
if (-not (Test-Path "node_modules")) {
|
||||
Write-Host "📦 Installing dependencies..." -ForegroundColor Yellow
|
||||
Start-Process -FilePath "npm" -ArgumentList "install" -NoNewWindow -Wait
|
||||
}
|
||||
|
||||
Start-Process -FilePath "npm" -ArgumentList "run dev" -NoNewWindow
|
||||
Set-Location "../.."
|
||||
}
|
||||
|
||||
Write-Host "✨ All services are starting up!" -ForegroundColor Cyan
|
||||
Write-Host " - Backend API: https://localhost:7172"
|
||||
Write-Host " - BFF: https://localhost:10001"
|
||||
Write-Host " - Frontend: http://localhost:5173"
|
||||
Executable
+72
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${BLUE}🚀 Starting MinAttest Development Environment...${NC}"
|
||||
|
||||
# Function to check if a port is in use
|
||||
is_port_in_use() {
|
||||
lsof -i :$1 -sTCP:LISTEN >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# 1. Start Backend (Aspire AppHost) - Port 7172 (API)
|
||||
# Note: AppHost also starts Postgres
|
||||
if is_port_in_use 7172; then
|
||||
echo -e "${GREEN}✅ Backend (API) is already running on port 7172.${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}🚀 Starting Backend (Aspire AppHost)...${NC}"
|
||||
dotnet run --project backend/MinAttest.AppHost/MinAttest.AppHost.csproj > backend.log 2>&1 &
|
||||
BACKEND_PID=$!
|
||||
echo " Started with PID $BACKEND_PID. Logs: backend.log"
|
||||
|
||||
# Wait for port to be ready (optional, but good for ordering)
|
||||
echo " Waiting for API to be ready on port 7172..."
|
||||
while ! is_port_in_use 7172; do
|
||||
sleep 1
|
||||
done
|
||||
echo -e "${GREEN} Backend is ready!${NC}"
|
||||
fi
|
||||
|
||||
# 2. Start BFF (Reverse Proxy) - Port 10001
|
||||
if is_port_in_use 10001; then
|
||||
echo -e "${GREEN}✅ BFF is already running on port 10001.${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}🚀 Starting BFF...${NC}"
|
||||
dotnet run --project frontend/minattest-app-host/minattest-app-host.csproj > bff.log 2>&1 &
|
||||
BFF_PID=$!
|
||||
echo " Started with PID $BFF_PID. Logs: bff.log"
|
||||
|
||||
echo " Waiting for BFF to be ready on port 10001..."
|
||||
while ! is_port_in_use 10001; do
|
||||
sleep 1
|
||||
done
|
||||
echo -e "${GREEN} BFF is ready!${NC}"
|
||||
fi
|
||||
|
||||
# 3. Start Frontend (Vite) - Port 5173
|
||||
if is_port_in_use 5173; then
|
||||
echo -e "${GREEN}✅ Frontend is already running on port 5173.${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}🚀 Starting Frontend...${NC}"
|
||||
cd frontend/minattest-app
|
||||
|
||||
if [ ! -d "node_modules" ]; then
|
||||
echo -e "${YELLOW}📦 Installing dependencies...${NC}"
|
||||
npm install
|
||||
fi
|
||||
|
||||
npm run dev > ../../frontend.log 2>&1 &
|
||||
FRONTEND_PID=$!
|
||||
cd ../..
|
||||
echo " Started with PID $FRONTEND_PID. Logs: frontend.log"
|
||||
fi
|
||||
|
||||
echo -e "${BLUE}✨ All services are up and running!${NC}"
|
||||
echo -e " - Backend API: https://localhost:7172"
|
||||
echo -e " - BFF: https://localhost:10001"
|
||||
echo -e " - Frontend: http://localhost:5173"
|
||||
echo -e " - Aspire Dash: (Check backend.log for port)"
|
||||
@@ -0,0 +1,39 @@
|
||||
# Stop MinAttest Development Environment (Windows)
|
||||
|
||||
Write-Host "🛑 Stopping MinAttest Development Environment..." -ForegroundColor Red
|
||||
|
||||
# Function to kill process on a port
|
||||
function Stop-PortProcess {
|
||||
param (
|
||||
[int]$Port,
|
||||
[string]$Name
|
||||
)
|
||||
$tcpConnection = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue
|
||||
|
||||
if ($tcpConnection) {
|
||||
$pid = $tcpConnection.OwningProcess
|
||||
Write-Host " Killing $Name (Port $Port, PID $pid)..." -ForegroundColor Yellow
|
||||
Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
|
||||
Write-Host " $Name stopped." -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " $Name is not running (Port $Port free)."
|
||||
}
|
||||
}
|
||||
|
||||
# 1. Stop Backend (API) - Port 7172
|
||||
Stop-PortProcess -Port 7172 -Name "Backend (API)"
|
||||
|
||||
# 2. Stop BFF - Port 10001
|
||||
Stop-PortProcess -Port 10001 -Name "BFF"
|
||||
|
||||
# 3. Stop Frontend - Port 5173
|
||||
Stop-PortProcess -Port 5173 -Name "Frontend"
|
||||
|
||||
# 4. Stop Aspire Dashboard & Resources (Cleanup)
|
||||
Write-Host " Cleaning up Aspire ports..." -ForegroundColor Yellow
|
||||
Stop-PortProcess -Port 17105 -Name "Aspire AppHost (HTTPS)"
|
||||
Stop-PortProcess -Port 15182 -Name "Aspire AppHost (HTTP)"
|
||||
Stop-PortProcess -Port 21157 -Name "Aspire Dashboard (OTLP)"
|
||||
Stop-PortProcess -Port 22256 -Name "Aspire Resource Service"
|
||||
|
||||
Write-Host "✨ All services stopped." -ForegroundColor Green
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${RED}🛑 Stopping MinAttest Development Environment...${NC}"
|
||||
|
||||
# Function to kill process on a port
|
||||
kill_port() {
|
||||
PORT=$1
|
||||
NAME=$2
|
||||
PID=$(lsof -ti:$PORT)
|
||||
if [ -n "$PID" ]; then
|
||||
echo -e "${YELLOW} Killing $NAME (Port $PORT, PID $PID)...${NC}"
|
||||
kill -9 $PID
|
||||
echo -e "${GREEN} $NAME stopped.${NC}"
|
||||
else
|
||||
echo -e " $NAME is not running (Port $PORT free)."
|
||||
fi
|
||||
}
|
||||
|
||||
# 1. Stop Backend (API) - Port 7172
|
||||
kill_port 7172 "Backend (API)"
|
||||
|
||||
# 2. Stop BFF - Port 10001
|
||||
kill_port 10001 "BFF"
|
||||
|
||||
# 3. Stop Frontend - Port 5173
|
||||
kill_port 5173 "Frontend"
|
||||
|
||||
# 4. Stop Aspire Dashboard & Resources (Cleanup)
|
||||
echo -e "${YELLOW} Cleaning up Aspire ports...${NC}"
|
||||
kill_port 17105 "Aspire AppHost (HTTPS)"
|
||||
kill_port 15182 "Aspire AppHost (HTTP)"
|
||||
kill_port 21157 "Aspire Dashboard (OTLP)"
|
||||
kill_port 22256 "Aspire Resource Service"
|
||||
|
||||
echo -e "${GREEN}✨ All services stopped.${NC}"
|
||||
Reference in New Issue
Block a user