This monorepo contains the code for both https://www.aphiria.com and https://api.aphiria.com.
- apps: The source code for the web and API applications
- docs: The documentation for the Aphiria framework
- infrastructure: The applications' infrastructure code
- specs: The GitHub Spec Kit specs
- tests: End-to-end tests of the entire website using Playwright
- tools: Tools for building and indexing the documentation
Pull requests automatically generate ephemeral preview environments for testing changes before merging.
- Web Preview:
https://{PR}.pr.aphiria.com - API Preview:
https://{PR}.pr-api.aphiria.com
For contributors: Preview deployments happen automatically after maintainer approval. No setup required!
For maintainers:
- Secrets management:
SECRETS.md
make installThis installs Docker, kubectl, Minikube, Pulumi, Node.js, npm dependencies, and PHP dependencies.
Note: You may need to run
chmod +x ./install.shfirst if the script isn't executable.
Note: To install only specific tools, pass arguments to
install.sh:make install INSTALL_ARGS="--install-pulumi" # Only install Pulumi
Add the following to your host file:
127.0.0.1 aphiria.com
127.0.0.1 api.aphiria.com
127.0.0.1 www.aphiria.com
127.0.0.1 grafana.aphiria.com
For rapid iteration on frontend changes without deploying to Kubernetes:
make web-devVisit http://localhost:3000
Note: Doc search won't work in standalone mode since it requires the API backend. All other features (navigation, TOC, syntax highlighting) work normally.
make minikube-startNote: The
metrics-serveraddon is required for Grafana dashboards to display CPU/memory metrics.
In a separate terminal, run Minikube tunnel (required for LoadBalancer access):
make minikube-tunnelNote: You'll need to enter your sudo password. Keep this terminal running.
make upThis will:
- Build all Docker images in Minikube's Docker daemon (base, build, API, web)
- Deploy infrastructure to Kubernetes
- Run database migrations
Note: The local stack uses passphrase
"password"for encryption (safe to share - no actual secrets in local stack). Set it with:export PULUMI_CONFIG_PASSPHRASE="password"
Note: For non-interactive deployment (useful in scripts), add Pulumi flags:
make up PULUMI_ARGS="--yes --skip-preview"
Note: If you need to log back into the cloud instance, run
pulumi logout, thenpulumi loginto authenticate with Pulumi Cloud.
After modifying code, rebuild and restart deployments:
make minikube-redeploy-appsNote: This picks up new Docker image changes without re-running
pulumi up.
- https://www.aphiria.com (web)
- https://api.aphiria.com (API documentation)
- https://grafana.aphiria.com (monitoring dashboards)
Note: You'll see a certificate warning (self-signed cert). In Chrome, type
thisisunsafe(there is no input - just type that phrase with the page displayed) to bypass. In other browsers, click advanced and accept the certificate.
Run all unit tests (TypeScript and PHP):
make testOr run tests by stack:
make test-ts # TypeScript tests (web, pulumi, tools)
make test-php # PHP testsFor TypeScript tests, you can also pass in web, pulumi, or build-docs as the PROJECT parameter to make test-ts:
make test-ts PROJECT=web
make test-ts PROJECT=pulumi
make test-ts PROJECT=build-docsFirst-time setup (installs Playwright browsers):
make test-e2e-installRun tests:
make test-e2e-local # Against local minikube (accepts self-signed certs)
make test-e2e-preview PR=123 # Against preview environment
make test-e2e-production # Against productionNote: E2E tests run automatically after deployments via GitHub Actions. See
.github/workflows/cd.yamlfor the full workflow.
Run all quality gates (linting, formatting, and tests - the same checks as CI):
make quality-gatesOr run individual checks:
make lint # Run all linters (TypeScript + PHP)
make format # Auto-format all code (TypeScript + PHP)
make format-check # Verify formatting without changesAll infrastructure commands accept STACK and PULUMI_ARGS parameters:
# Set passphrase for Pulumi commands (required for local stack)
export PULUMI_CONFIG_PASSPHRASE="password"
# Preview changes before applying
make preview # Local stack (interactive)
make preview STACK=production # Production stack
make preview PULUMI_ARGS="--diff" # Show detailed diff
# Apply infrastructure changes
make up # Local stack (interactive)
make up PULUMI_ARGS="--yes --skip-preview" # Non-interactive (for CI)
# Tear down the local environment (requires confirmation)
make destroy CONFIRM=yes
make destroy STACK=preview-pr-123 CONFIRM=yes
# Sync Pulumi state with actual cluster state
make refreshView the cluster state visually:
make minikube-dashboardThe local stack includes Grafana monitoring. Before running make up, configure these values:
cd infrastructure/pulumi
# Prometheus monitoring
pulumi config set prometheus:authToken "dummy-password" --secret --stack local
# GitHub OAuth (for authentication)
pulumi config set grafana:githubClientId "YOUR_CLIENT_ID" --stack local
pulumi config set grafana:githubClientSecret "local-dev-client-secret" --secret --stack local
pulumi config set grafana:githubOrg "aphiria" --stack local
pulumi config set grafana:adminUser "your-github-username" --stack local
# SMTP (for alerts - can use dummy values for local)
pulumi config set grafana:smtpHost "smtp.example.com" --secret --stack local
pulumi config set grafana:smtpPort "587" --stack local
pulumi config set grafana:smtpUser "noreply@example.com" --secret --stack local
pulumi config set grafana:smtpPassword "dummy-password" --secret --stack local
pulumi config set grafana:smtpFromAddress "noreply@example.com" --stack local
pulumi config set grafana:alertEmail "admin@example.com" --stack localNote: For local development, you can use placeholder values. GitHub OAuth won't work with dummy credentials, but Grafana will still deploy. For production setup, see SECRETS.md.
Run make help to see all available commands.