Remove Azure deployment stack; Proxmox 7810 is canonical production.

Delete Static Web Apps workflow, Bicep infra, Azure Functions api/, SWA configs, and Azure-only scripts; document Proxmox deploy path and refresh QuickStart and prerequisites.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
defiQUG
2026-06-15 19:41:08 -07:00
co-authored by Cursor
parent d5a8a263cb
commit e3a171c5ff
39 changed files with 168 additions and 10642 deletions
+43 -108
View File
@@ -1,139 +1,74 @@
# Quick Start Guide
Fast path to get the Miracles in Motion project running, tested, and deployed.
Fast path to run, test, and deploy the Miracles in Motion public site.
## 1. Prerequisites
| Tool | Recommended Version | Notes |
|------|---------------------|-------|
| Node.js | 20.x / 22.x | Functions runtime Standard supports node:20; local dev can use 22 |
| npm | 10+ | Bundled with recent Node |
| Azure CLI | >= 2.60 | For infra & Static Web Apps commands |
| SWA CLI (@azure/static-web-apps-cli) | latest | Local API + front-end emulation |
| Git | latest | Source control |
| WSL2 | Enabled | Shell environment (Ubuntu recommended) |
| Tool | Version | Notes |
|------|---------|-------|
| Node.js | 22.x | CI and local dev |
| npm | 10+ | Use `npm ci` (`.npmrc` sets `legacy-peer-deps`) |
| ImageMagick | any recent | Required for `npm run brand:export` / `prebuild` |
| Git | latest | |
Production deploy additionally requires LAN access to Proxmox — see [PROXMOX_DEPLOYMENT.md](./deployment/PROXMOX_DEPLOYMENT.md).
## 2. Clone & install
```bash
# Verify versions
node -v
npm -v
az version
git clone https://github.com/Order-of-Hospitallers/miracles_in_motion.git
cd miracles_in_motion
npm ci
```
## 2. Clone & Install
```bash
git clone https://github.com/Miracles-In-Motion/public-web.git
cd public-web
npm install --legacy-peer-deps
cd api && npm install --legacy-peer-deps && cd ..
```
## 3. Environment
## 3. Environment Setup
Create a `.env.local` (frontend) and `api/local.settings.json` (Azure Functions) as needed.
Copy `.env.example` to `.env.local` (do not commit secrets):
Example `.env.local` (do NOT commit secrets):
```
```env
VITE_API_BASE=/api
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_xxx
VITE_DEFAULT_LANGUAGE=en
VITE_SUPPORTED_LANGUAGES=en,es,fr,de,zh,ar,pt,ru
```
Example `api/local.settings.json`:
```json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node"
}
}
```
## 4. Run locally
## 4. Run Locally (Integrated)
Use SWA CLI to serve front-end + Functions together.
```bash
npm run build:api # Optional: compile API TypeScript
swa start http://localhost:5173 --api-location ./api --devserver-run-command "npm run dev" --api-language node
npm run dev
# http://localhost:5173
```
If you prefer two terminals:
## 5. Test & validate
```bash
npm run dev # Front-end (Vite)
cd api && npm start # Functions runtime
npm test # unit tests (Vitest)
npm run type-check # tsc --noEmit
npm run a11y:header-audit # WCAG header contrast tokens
npm run validate:ci # all three above
```
## 5. Testing
## 6. Production build
```bash
npm test # Front-end tests (Vitest / Testing Library)
npm run build
# output: dist/
npm run preview # optional local preview
```
Add more tests under `src/components/__tests__/` or `src/test`.
## 6. Build
## 7. Deploy to mim4u.org (Proxmox)
From the **proxmox** repo on operator LAN:
```bash
npm run build # Produces front-end dist/
cd api && npm run build # Compiles Functions to dist (if configured)
./scripts/mim4u-deploy-to-7810.sh
```
## 7. Azure Deployment (Static Web App Standard)
Verify:
```bash
# Login
az login
# Ensure resource group exists
az group create --name rg-mim-prod --location eastus2
# Create Static Web App (front-end + managed functions)
az staticwebapp create \
--name mim-prod-web-standard \
--resource-group rg-mim-prod \
--location eastus2 \
--source . \
--branch main \
--app-location / \
--output-location dist
curl -I -H 'Host: mim4u.org' http://192.168.11.37/
```
To deploy updates without GitHub Actions (manual token):
```bash
TOKEN=$(az staticwebapp secrets list --name mim-prod-web-standard --resource-group rg-mim-prod --query properties.apiKey -o tsv)
swa deploy ./dist --env production --deployment-token $TOKEN
```
## 8. CI
## 8. Custom Domain
1. Add CNAME `www` → `<defaultHostname>`.
2. Set hostname:
```bash
az staticwebapp hostname set \
--name mim-prod-web-standard \
--resource-group rg-mim-prod \
--hostname miraclesinmotion.org
```
Azure provisions SSL automatically.
## 9. Configuration (staticwebapp.config.json)
Key elements:
- `navigationFallback` ensures SPA routing.
- `globalHeaders` for security (CSP, HSTS). Adjust `Content-Security-Policy` as integrations evolve.
## 10. Useful Scripts
| Script | Purpose |
|--------|---------|
| `npm run dev` | Start Vite dev server |
| `npm test` | Run tests |
| `npm run build` | Build front-end |
| `npm run analyze` | (If defined) Bundle analysis |
## 11. Troubleshooting
| Issue | Resolution |
|-------|------------|
| 404 on portal route | Ensure hash routing `/#/portals` or SPA fallback set |
| Functions 500 error | Check `api` logs, run locally with `func start` if using standalone Functions |
| CSP blocking script | Update CSP in `staticwebapp.config.json` to allow required domain |
| Node version mismatch | Use Node 20 for SWA managed functions, 22 locally if desired |
## 12. Next Steps
- Configure GitHub Actions for CI/CD.
- Add monitoring (Application Insights) if using standalone Functions.
- Replace test Stripe keys with live keys in production.
---
Last updated: 2025-11-11
GitHub Actions runs on PR (`validate.yml`) and main push (`deploy.yml`). See [DEPLOYMENT_PREREQUISITES.md](./DEPLOYMENT_PREREQUISITES.md).