WealthFromAI's picture
FORGE-X: Upload source (553f7a4b-api.zip)
b12da69 verified
|
Raw
History Blame Contribute Delete
2.5 kB
# DevOps Infra Stack Recommender API
> REST API that recommends optimal DevOps infrastructure stacks based on team size, project type, budget constraints, and cloud provider preference. Input your engineering team profile and get back ranked tool recommendations with justification, cost estimates, migration paths, and integration guides. Covers CI/CD tools (GitHub Actions, GitLab CI, CircleCI, Jenkins), container orchestration (Kubernetes, ECS, Nomad), observability stacks (Prometheus, Grafana, Datadog), IaC tools (Terraform, Pulumi, CDK), and service mesh options. Each recommendation includes TCO analysis, team skill requirements, and step-by-step adoption roadmap. Built with FastAPI, Docker-ready, JWT auth, rate limiting, and full OpenAPI documentation included.
## Features
- Full REST API
## Quick Start
```bash
# 1. Install dependencies
pip install -r requirements.txt
# 2. Configure environment
cp .env.example .env
# Edit .env with your settings
# 3. Run locally
uvicorn main:app --reload --port 8000
# 4. View interactive docs
open http://localhost:8000/docs
```
## Docker Deployment
```bash
# Build and run
docker compose up -d
# Check health
curl http://localhost:8000/health
```
## Authentication
Get a token first:
```bash
curl -X POST "http://localhost:8000/auth/token?username=admin&password=admin123"
```
Use the token in subsequent requests:
```bash
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8000/items
```
## API Endpoints
| Method | Path | Description |
|--------|------|-------------|
| GET | `/health` | System health |
| POST | `/auth/token` | Get JWT token |
| GET | `/items` | List all items |
| POST | `/items` | Create item |
| GET | `/items/{id}` | Get item |
| PATCH | `/items/{id}` | Update item |
| DELETE | `/items/{id}` | Delete item |
| GET | `/stats` | API statistics |
Full interactive docs: `http://localhost:8000/docs`
## Rate Limits
| Endpoint | Limit |
|----------|-------|
| `/auth/token` | 10/minute |
| `GET /items` | 60/minute |
| `POST /items` | 30/minute |
| `DELETE /items` | 20/minute |
## Running Tests
```bash
pip install pytest httpx
pytest tests/ -v
```
## Production Notes
- Change `SECRET_KEY` in `.env` before deploying
- Replace in-memory `_db` with a real database
- Add proper user management to `auth.py`
- Configure `ALLOWED_ORIGINS` for CORS
- Use Nginx/Traefik as reverse proxy
## License
MIT