Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ updates:
# npm dependencies - grouped
- package-ecosystem: "npm"
directories:
- "/src/app/frontend"
- "/src/app/frontend-server"
- "/src/App"
- "/src/App/server"
schedule:
interval: "monthly"
target-branch: "dependabotchanges"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
- demo
paths:
- 'src/backend/**'
- 'src/app/frontend/**'
- 'src/app/frontend-server/**'
- 'src/App/src/**'
- 'src/App/server/**'
- '.github/workflows/docker-build.yml'
pull_request:
types:
Expand All @@ -23,8 +23,8 @@ on:
- demo
paths:
- 'src/backend/**'
- 'src/app/frontend/**'
- 'src/app/frontend-server/**'
- 'src/App/src/**'
- 'src/App/server/**'
- '.github/workflows/docker-build.yml'
workflow_dispatch:

Expand Down Expand Up @@ -88,8 +88,8 @@ jobs:
- name: Build and Push Docker Image for Frontend Server
uses: docker/build-push-action@v6
with:
context: ./src/app
file: ./src/app/WebApp.Dockerfile
context: ./src/App
file: ./src/App/WebApp.Dockerfile
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }}
tags: |
${{ secrets.ACR_LOGIN_SERVER || 'acrlogin.azurecr.io' }}/content-gen-app:${{ steps.determine_tag.outputs.tagname }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/job-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:
env:
DOCKER_BUILD_SUMMARY: false
with:
context: ./src/app
file: ./src/app/WebApp.Dockerfile
context: ./src/App
file: ./src/App/WebApp.Dockerfile
push: true
tags: |
${{ secrets.ACR_TEST_LOGIN_SERVER }}/content-gen-app:${{ steps.generate_docker_tag.outputs.AZURE_ENV_IMAGE_TAG }}
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ eggs/
*.swo

# Node
/src/app/frontend/node_modules/
/src/app/frontend-server/node_modules/
/src/app/frontend-server/static/
/src/app/frontend-server/*.zip
/src/App/node_modules/
/src/App/server/node_modules/
/src/App/server/static/
/src/App/server/*.zip
node_modules/

# Build output
/src/app/static/
/src/app/frontend/dist/
/src/App/static/
/src/App/dist/

# Logs
*.log
Expand Down
2 changes: 1 addition & 1 deletion azure_custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ infra:

services:
frontend:
project: ./src/app/frontend-server
project: ./src/App/server
language: js
host: appservice
dist: ./dist
Expand Down
4 changes: 2 additions & 2 deletions docs/AZD_DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Error: az acr build failed
**Solution**: Check the Dockerfile and ensure all required files are present:
```bash
# Manual build for debugging
cd src/app
cd src/App
docker build -f WebApp.Dockerfile -t content-gen-app:test .
```

Expand All @@ -251,7 +251,7 @@ Error: az webapp deploy failed

**Solution**: Ensure the frontend builds successfully:
```bash
cd src/app/frontend
cd src/App
npm install
npm run build
```
Expand Down
2 changes: 1 addition & 1 deletion docs/TECHNICAL_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pip install -r requirements.txt
python app.py

# Frontend
cd src/app/frontend
cd src/App
npm install
npm run dev
```
Expand Down
6 changes: 3 additions & 3 deletions infra/scripts/package_frontend.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Package frontend for App Service deployment
# This script is called by AZD during prepackage hook
# Working directory is ./src/app/frontend-server (project directory)
# Working directory is ./src/App/server (project directory)

$ErrorActionPreference = 'Stop'

Write-Host "Building React frontend..." -ForegroundColor Cyan

# Build React frontend (one level up)
Push-Location ../frontend
Push-Location ..
npm ci --loglevel=error
if ($LASTEXITCODE -ne 0) { throw "npm ci failed with exit code $LASTEXITCODE" }
npm run build -- --outDir ../frontend-server/static
npm run build -- --outDir ./server/static
if ($LASTEXITCODE -ne 0) { throw "npm run build failed with exit code $LASTEXITCODE" }
Pop-Location

Expand Down
8 changes: 4 additions & 4 deletions infra/scripts/package_frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ set -euo pipefail

# Package frontend for App Service deployment
# This script is called by AZD during prepackage hook
# Working directory is ./src/app/frontend-server (project directory)
# Working directory is ./src/App/server (project directory)

echo "Building React frontend..."

# Build React frontend (one level up)
cd ../frontend
cd ..
npm ci --loglevel=error
npm run build -- --outDir ../frontend-server/static
cd ../frontend-server
npm run build -- --outDir ./server/static
cd ./server

echo "Packaging frontend server..."

Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ if ($continue -eq "y" -or $continue -eq "Y") {
Write-Host "Step 3: Building and deploying frontend..." -ForegroundColor Green
Write-Host "==========================================" -ForegroundColor Green

Set-Location "$ProjectDir\src\frontend"
Set-Location "$ProjectDir\src\App"
npm install
npm run build

# Copy built files to server directory
Copy-Item -Path "$ProjectDir\src\static\*" -Destination "$ProjectDir\src\frontend-server\static\" -Recurse -Force
Copy-Item -Path "$ProjectDir\src\static\*" -Destination "$ProjectDir\src\App\server\static\" -Recurse -Force

Set-Location "$ProjectDir\src\frontend-server"
Set-Location "$ProjectDir\src\App\server"

# Create deployment package
if (Test-Path "frontend-deploy.zip") {
Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Step 3: Building and deploying frontend..."
echo "=========================================="

cd "$PROJECT_DIR/src/frontend"
cd "$PROJECT_DIR/src/App"
npm install
npm run build

# Copy built files to server directory
cp -r "$PROJECT_DIR/src/static/"* "$PROJECT_DIR/src/frontend-server/static/"
cp -r "$PROJECT_DIR/src/static/"* "$PROJECT_DIR/src/App/server/static/"

cd "$PROJECT_DIR/src/frontend-server"
cd "$PROJECT_DIR/src/App/server"

# Create deployment package
rm -f frontend-deploy.zip
Expand Down
2 changes: 1 addition & 1 deletion scripts/local_dev.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$ProjectRoot = Split-Path -Parent $ScriptDir
$SrcDir = Join-Path $ProjectRoot "src"
$BackendDir = Join-Path $SrcDir "backend"
$FrontendDir = Join-Path $SrcDir "app\frontend"
$FrontendDir = Join-Path $SrcDir "App"

# Default ports
$BackendPort = if ($env:BACKEND_PORT) { $env:BACKEND_PORT } else { "5000" }
Expand Down
2 changes: 1 addition & 1 deletion scripts/local_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
SRC_DIR="$PROJECT_ROOT/src"
BACKEND_DIR="$SRC_DIR/backend"
FRONTEND_DIR="$SRC_DIR/app/frontend"
FRONTEND_DIR="$SRC_DIR/App"

# Default ports
BACKEND_PORT=${BACKEND_PORT:-5000}
Expand Down
2 changes: 1 addition & 1 deletion src/app/.dockerignore → src/App/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Build outputs (will be built in container)
static/
**/dist/
frontend-server/static/
server/static/

# Development files
*.log
Expand Down
14 changes: 7 additions & 7 deletions src/app/WebApp.Dockerfile → src/App/WebApp.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ============================================
# Frontend Dockerfile
# Multi-stage build for Content Generation Frontend
# Combines: frontend (React/Vite) + frontend-server (Node.js proxy)
# Combines: React/Vite frontend + server (Node.js proxy)
# ============================================

# ============================================
Expand All @@ -11,14 +11,14 @@ FROM node:20-alpine AS frontend-build

WORKDIR /app

# Copy frontend package files
COPY frontend/package*.json ./
# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm ci

# Copy frontend source code
COPY frontend/ ./
COPY . ./

# Build the frontend (outputs to ../static, but we're in /app so it goes to /static)
# Override outDir to keep it in the container context
Expand All @@ -31,14 +31,14 @@ FROM node:20-alpine AS production

WORKDIR /app

# Copy frontend-server package files
COPY frontend-server/package*.json ./
# Copy server package files
COPY server/package*.json ./

# Install only production dependencies
RUN npm ci --only=production

# Copy the server code
COPY frontend-server/server.js ./
COPY server/server.js ./

# Copy built frontend assets from stage 1
COPY --from=frontend-build /app/dist ./static
Expand Down
File renamed without changes.
File renamed without changes
Loading
Loading