No description
- Python 97.4%
- Dockerfile 2.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| app | ||
| tests | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
| uv.lock | ||
calculator-api
FastAPI calculator service. Deployed on a self-hosted Kubernetes cluster via GitOps.
CI/CD
Powered by Forgejo Actions. On push:
stagingbranch → builds image → deploys tocalc-staging.yhkze.netmasterbranch → builds image → deploys tocalc.yhkze.net
Pipeline: lint → test (Python 3.10 + 3.13) → build + push to ghcr.io → update image tag in gitops-manifests → ArgoCD syncs cluster.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /add |
Add two numbers |
| POST | /subtract |
Subtract two numbers |
| POST | /multiply |
Multiply two numbers |
| GET | /docs |
Swagger UI |
Usage
curl -X POST https://calc.yhkze.net/add \
-H "Content-Type: application/json" \
-d '{"a": 5, "b": 3}'
{"result": 8, "operation": "add"}
Local development
pip install -r requirements.txt
uvicorn app.main:app --reload
pytest