Files
api7-demo/api
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
2025-10-03 01:20:15 +02:00

API Service - FastAPI

A RESTful API service built with FastAPI featuring Swagger documentation.

Features

  • 📚 Automatic Swagger/OpenAPI documentation
  • 🔄 RESTful API endpoints
  • Data validation with Pydantic
  • 📊 Statistics and monitoring endpoints
  • ❤️ Health check endpoints

Local Development

Run with Python

# Install dependencies
pip install -r requirements.txt

# Run the application
python main.py

# Or use uvicorn directly
uvicorn main:app --reload --host 0.0.0.0 --port 8000

Run with Docker

# Build image
docker build -t fastapi-api .

# Run container
docker run -p 8000:8000 fastapi-api

API Endpoints

Items

  • GET /items - List all items (with pagination)
  • GET /items/{item_id} - Get specific item
  • POST /items - Create new item
  • PUT /items/{item_id} - Update item
  • DELETE /items/{item_id} - Delete item

Users

  • GET /users - List all users
  • GET /users/{user_id} - Get specific user
  • POST /users - Create new user

Other

  • GET / - API information
  • GET /health - Health check
  • GET /info - Service information
  • GET /stats - API statistics

Documentation

Example Requests

Create Item

curl -X POST "http://localhost:8000/items" \
  -H "Content-Type: application/json" \
  -d '{
    "id": 4,
    "name": "Monitor",
    "description": "4K Display",
    "price": 299.99,
    "in_stock": true
  }'

Get Items

curl "http://localhost:8000/items?skip=0&limit=10&in_stock=true"

Get Statistics

curl "http://localhost:8000/stats"