9 Commits

Author SHA1 Message Date
steinhelge f80388351f Update .gitea/workflows/build.yml
Build & Push MinAttest / Wake Zorin (push) Successful in 12s
Build & Push MinAttest / build-and-push (push) Failing after 9m13s
2025-12-16 11:25:00 +00:00
steinhelge 9332f77959 Update .gitea/workflows/build.yml 2025-12-16 11:24:25 +00:00
steinhelge 6353e0c7b3 Update frontend/minattest-app-host/appsettings.Development.json
Build & Push MinAttest / build-and-push (push) Successful in 2m0s
2025-11-27 14:21:40 +00:00
steinhelge 1161717f74 Update frontend/minattest-app-host/appsettings.json
Build & Push MinAttest / build-and-push (push) Has been cancelled
2025-11-27 14:21:15 +00:00
steinhelge b50f928318 Update backend/src/MinAttest.Api/appsettings.json
Build & Push MinAttest / build-and-push (push) Successful in 9m33s
2025-11-27 13:57:57 +00:00
steinhelge 256858f169 Update .gitea/workflows/build.yml
Build & Push MinAttest / build-and-push (push) Successful in 19s
2025-11-27 12:46:50 +00:00
steinhelge fcab8b4a25 Update backend/src/MinAttest.Api/appsettings.json
Build & Push MinAttest / build-and-push (push) Successful in 8m36s
2025-11-27 12:27:10 +00:00
steinhelge fa62efc2e3 Merge pull request 'dev' (#3) from dev into main
Build & Push MinAttest / build-and-push (push) Successful in 17s
Reviewed-on: #3
2025-11-18 20:20:04 +00:00
steinhelge 3a4e8a2f5a Merge pull request 'dev' (#2) from dev into main
Build & Push MinAttest / build-and-push (push) Successful in 5m15s
Reviewed-on: #2
2025-11-17 20:35:47 +00:00
9 changed files with 111 additions and 327 deletions
-31
View File
@@ -1,31 +0,0 @@
---
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`.
+20
View File
@@ -8,8 +8,22 @@ on:
env: env:
REGISTRY: gitea.theriise.net/steinhelge REGISTRY: gitea.theriise.net/steinhelge
REGISTRY_HOST: gitea.theriise.net
REGISTRY_NAMESPACE: steinhelge
IMAGE_NAME: minattest
jobs: jobs:
wake-zorin:
name: Wake Zorin
runs-on: waker # t610-waker-runneren med label "waker"
steps:
- name: Wake Zorin via WOL
run: /home/steinhelge/wake-zorin.sh
- name: Vent på at Zorin våkner
run: sleep 10
build-and-push: build-and-push:
runs-on: self-hosted runs-on: self-hosted
@@ -76,4 +90,10 @@ jobs:
- name: Push App Host (${{ env.TAG }}) - name: Push App Host (${{ env.TAG }})
run: | run: |
docker push $REGISTRY/minattest-app-host:${TAG} docker push $REGISTRY/minattest-app-host:${TAG}
- name: Deploy (docker compose pull + up)
run: |
cd /srv/minattest # ← Endre denne pathen hvis compose ligger et annet sted
docker compose pull
docker compose up -d
+9 -9
View File
@@ -1,9 +1,9 @@
{ {
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning"
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*"
} }
@@ -1,42 +1,42 @@
{ {
"Serilog": { "Serilog": {
"Using": [ "Serilog.Sinks.Console" ], "Using": [ "Serilog.Sinks.Console" ],
"MinimumLevel": { "MinimumLevel": {
"Default": "Verbose", "Default": "Verbose",
"Override": { "Override": {
"Microsoft": "Information", "Microsoft": "Information",
"System": "Information" "System": "Information"
} }
}, },
"WriteTo": [ "WriteTo": [
{ {
"Name": "Console", "Name": "Console",
"Args": { "Args": {
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Literate, Serilog.Sinks.Console", "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Literate, Serilog.Sinks.Console",
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}|{RequestId}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}" "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}|{RequestId}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}"
} }
} }
], ],
"Enrich": [ "FromLogContext" ] "Enrich": [ "FromLogContext" ]
}, },
"ReverseProxy": { "ReverseProxy": {
"Routes": { "Routes": {
"userApiRoute": { "userApiRoute": {
"ClusterId": "clusterUser", "ClusterId": "clusterUser",
"Match": { "Match": {
"Path": "/api/{**catch-all}" "Path": "/api/{**catch-all}"
} }
} }
}, },
"Clusters": { "Clusters": {
"clusterUser": { "clusterUser": {
"Destinations": { "Destinations": {
"destination1": { "destination1": {
"Address": "https://localhost:7172/" "Address": "http://backend-api:8080/"
} }
} }
} }
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*"
} }
+41 -41
View File
@@ -1,42 +1,42 @@
{ {
"Serilog": { "Serilog": {
"Using": [ "Serilog.Sinks.Console" ], "Using": [ "Serilog.Sinks.Console" ],
"MinimumLevel": { "MinimumLevel": {
"Default": "Verbose", "Default": "Verbose",
"Override": { "Override": {
"Microsoft": "Information", "Microsoft": "Information",
"System": "Information" "System": "Information"
} }
}, },
"WriteTo": [ "WriteTo": [
{ {
"Name": "Console", "Name": "Console",
"Args": { "Args": {
"theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Literate, Serilog.Sinks.Console", "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Literate, Serilog.Sinks.Console",
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}|{RequestId}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}" "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}|{RequestId}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}"
} }
} }
], ],
"Enrich": [ "FromLogContext" ] "Enrich": [ "FromLogContext" ]
}, },
"ReverseProxy": { "ReverseProxy": {
"Routes": { "Routes": {
"userApiRoute": { "userApiRoute": {
"ClusterId": "clusterUser", "ClusterId": "clusterUser",
"Match": { "Match": {
"Path": "/api/{**catch-all}" "Path": "/api/{**catch-all}"
} }
} }
}, },
"Clusters": { "Clusters": {
"clusterUser": { "clusterUser": {
"Destinations": { "Destinations": {
"destination1": { "destination1": {
"Address": "https://localhost:7172/" "Address": "http://backend-api:8080/"
} }
} }
} }
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*"
} }
-53
View File
@@ -1,53 +0,0 @@
# 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"
-72
View File
@@ -1,72 +0,0 @@
#!/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)"
-39
View File
@@ -1,39 +0,0 @@
# 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
-41
View File
@@ -1,41 +0,0 @@
#!/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}"