| name | fastapi-dapr-agent |
| description | Create FastAPI microservices with Dapr and AI agents |
FastAPI + Dapr + AI Agent Service Generator
When to Use
- Building microservices for LearnFlow platform
- Need Dapr pub/sub for event-driven architecture
- Integrating AI agents (OpenAI SDK) into services
- Creating REST APIs with automatic documentation
Instructions
Generate New Service
- Run generator:
python scripts/generate_service.py <service-name> --port 8080
- Review generated files
- Install dependencies:
pip install -r requirements.txt
Run Service with Dapr
- Start with Dapr:
python scripts/run_with_dapr.py <service-name> --port 8080
- Test endpoints:
curl http://localhost:8080/health
- Check Dapr dashboard:
dapr dashboard -p 8081
Deploy to Kubernetes
- Run deploy:
python scripts/deploy.py <service-name> --namespace apps
- Verify:
kubectl get pods -n apps
- Test:
kubectl port-forward svc/<service-name> -n apps 8080:80
Generated Structure
<service-name>/
├── main.py # FastAPI application
├── requirements.txt # Python dependencies
├── Dockerfile # Container build
├── dapr.yaml # Dapr configuration
├── k8s/
│ ├── deployment.yaml
│ ├── service.yaml
│ └── dapr-component.yaml
└── tests/
└── test_main.py
Validation
See REFERENCE.md for Dapr patterns and AI integration.