- Added OpenAI-compatible LLM endpoints to API backend - Introduced web frontend with Jinja2 templates and static assets - Implemented API proxy routes in web service - Added sample db.json data for items, users, orders, reviews, categories, llm_requests - Updated ADC and Helm configs for separate AI and standard rate limiting - Upgraded FastAPI, Uvicorn, and added httpx, Jinja2, python-multipart dependencies - Added API configuration modal and client-side JS for web app
Web Application with Documentation
FastAPI web application serving a demo dashboard and comprehensive MkDocs documentation.
Features
- Web Dashboard: Simple HTML interface with metrics display
- Documentation Site: Complete API7 Enterprise setup guide at
/docs - Health Checks: Monitoring endpoint at
/health
Documentation
The application includes comprehensive documentation built with MkDocs Material theme, covering:
- Architecture Overview: Complete infrastructure and component details
- Getting Started: Quick setup and deployment guide
- API7 Configuration: Route and service configuration with examples
- Kubernetes Resources: Complete resource reference
- CI/CD Pipeline: Gitea Actions workflow documentation
- Troubleshooting: Common issues and solutions
Running Locally
Prerequisites
pip install -r requirements.txt
Start Application
python main.py
Access:
- Main Page: http://localhost:8000
- Documentation: http://localhost:8000/docs/
- Health Check: http://localhost:8000/health
Build Documentation Manually
mkdocs build -f docs/mkdocs.yml -d site
Docker
Build Image
docker build -t web-app .
The Dockerfile:
- Installs Python dependencies
- Copies application and documentation source
- Builds static documentation site with MkDocs
- Serves both the app and docs
Run Container
docker run -p 8000:8000 web-app
Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
namespace: api7ee
spec:
replicas: 2
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: git.commandware.com/demos/api7-demo/web:main
ports:
- containerPort: 8000
name: http
livenessProbe:
httpGet:
path: /health
port: 8000
readinessProbe:
httpGet:
path: /health
port: 8000
---
apiVersion: v1
kind: Service
metadata:
name: web-service
namespace: api7ee
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8000
name: http
selector:
app: web
Documentation Structure
docs/
├── mkdocs.yml # MkDocs configuration
├── index.md # Documentation home
├── getting-started.md # Quick start guide
├── architecture.md # Infrastructure architecture
├── kubernetes-resources.md # K8s resources reference
├── api7-configuration.md # API7 Gateway config guide
├── cicd-pipeline.md # CI/CD documentation
└── troubleshooting.md # Troubleshooting guide
Endpoints
| Endpoint | Description |
|---|---|
/ |
Main web dashboard |
/docs/ |
Documentation site (MkDocs) |
/health |
Health check endpoint |
CI/CD
Images are automatically built and pushed to Gitea registry on every push:
Registry: git.commandware.com/demos/api7-demo/web:<branch>
See CI/CD Pipeline documentation for details.
Development
Update Documentation
- Edit markdown files in
docs/directory - Test locally:
mkdocs serve -f docs/mkdocs.yml - View at http://localhost:8001
- Rebuild with
mkdocs buildor rebuild Docker image
Dependencies
- fastapi: Web framework
- uvicorn: ASGI server
- mkdocs: Documentation site generator
- mkdocs-material: Material theme for MkDocs
FastAPI web application with integrated MkDocs documentation for API7 Enterprise demo.