feat: Add initial SaaS application structure with .htaccess, index.php, and environment setup scripts
- Create .htaccess for Apache front-controller routing - Add README.md for public directory with project overview - Implement index.php as the main entry point with a preview of SaaS modules - Introduce PowerShell scripts to check prerequisites and prepare environment
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
param(
|
||||
[string]$ProjectRoot = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$saasAppPath = Join-Path $ProjectRoot 'saas-app'
|
||||
$envExamplePath = Join-Path $saasAppPath '.env.example'
|
||||
|
||||
function Test-Command {
|
||||
param([string]$Name)
|
||||
|
||||
return $null -ne (Get-Command $Name -ErrorAction SilentlyContinue)
|
||||
}
|
||||
|
||||
function Write-Check {
|
||||
param(
|
||||
[string]$Label,
|
||||
[bool]$Passed,
|
||||
[string]$Detail
|
||||
)
|
||||
|
||||
$status = if ($Passed) { '[OK]' } else { '[FEHLT]' }
|
||||
Write-Host "$status $Label - $Detail"
|
||||
}
|
||||
|
||||
Write-Host 'Pruefe lokale Voraussetzungen fuer Kaffeeliste SaaS...'
|
||||
Write-Host "Projektwurzel: $ProjectRoot"
|
||||
Write-Host ''
|
||||
|
||||
$phpExists = Test-Command 'php'
|
||||
$composerExists = Test-Command 'composer'
|
||||
$gitExists = Test-Command 'git'
|
||||
|
||||
Write-Check -Label 'PHP' -Passed $phpExists -Detail ($(if ($phpExists) { (php -r "echo PHP_VERSION;") } else { 'nicht gefunden' }))
|
||||
Write-Check -Label 'Composer' -Passed $composerExists -Detail ($(if ($composerExists) { (composer --version | Select-Object -First 1) } else { 'nicht gefunden' }))
|
||||
Write-Check -Label 'Git' -Passed $gitExists -Detail ($(if ($gitExists) { 'verfuegbar' } else { 'nicht gefunden' }))
|
||||
Write-Check -Label 'SaaS-App' -Passed (Test-Path $saasAppPath) -Detail $saasAppPath
|
||||
Write-Check -Label '.env.example' -Passed (Test-Path $envExamplePath) -Detail $envExamplePath
|
||||
|
||||
$envPath = Join-Path $saasAppPath '.env'
|
||||
Write-Check -Label '.env' -Passed (Test-Path $envPath) -Detail ($(if (Test-Path $envPath) { 'vorhanden' } else { 'noch nicht angelegt' }))
|
||||
|
||||
Write-Host ''
|
||||
Write-Host 'Naechste Schritte:'
|
||||
Write-Host '1. Falls Composer fehlt, zuerst Composer installieren.'
|
||||
Write-Host '2. Mit scripts/prepare-saas-env.ps1 eine lokale .env anlegen.'
|
||||
Write-Host '3. Danach saas-app konfigurieren und die Installationsanleitung in docs/installationshandbuch.md befolgen.'
|
||||
@@ -0,0 +1,23 @@
|
||||
param(
|
||||
[string]$ProjectRoot = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path,
|
||||
[switch]$Force
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$saasAppPath = Join-Path $ProjectRoot 'saas-app'
|
||||
$sourcePath = Join-Path $saasAppPath '.env.example'
|
||||
$targetPath = Join-Path $saasAppPath '.env'
|
||||
|
||||
if (-not (Test-Path $sourcePath)) {
|
||||
throw "Quelle nicht gefunden: $sourcePath"
|
||||
}
|
||||
|
||||
if ((Test-Path $targetPath) -and -not $Force) {
|
||||
throw ".env existiert bereits. Nutze -Force, wenn sie neu erzeugt werden soll."
|
||||
}
|
||||
|
||||
Copy-Item -Path $sourcePath -Destination $targetPath -Force
|
||||
|
||||
Write-Host "Lokale .env wurde angelegt: $targetPath"
|
||||
Write-Host 'Passe jetzt DB-, Mail-, Tenancy- und OIDC-Werte an.'
|
||||
Reference in New Issue
Block a user