Files
api7-demo/web
d.viti ed660dce5a
Some checks failed
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 9s
Build and Deploy / build-api (push) Successful in 33s
Build and Deploy / build-web (push) Failing after 41s
Add LLM endpoints, web frontend, and rate limiting config
- 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
2025-10-07 17:29:12 +02:00
..
2025-10-03 01:20:15 +02:00
2025-10-03 01:20:15 +02:00

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:

Build Documentation Manually

mkdocs build -f docs/mkdocs.yml -d site

Docker

Build Image

docker build -t web-app .

The Dockerfile:

  1. Installs Python dependencies
  2. Copies application and documentation source
  3. Builds static documentation site with MkDocs
  4. 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

  1. Edit markdown files in docs/ directory
  2. Test locally:
    mkdocs serve -f docs/mkdocs.yml
    
  3. View at http://localhost:8001
  4. Rebuild with mkdocs build or 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.