[package]
name = "rest-api-template"
version = "1.0.0"
description = "Production-ready REST API template with multi-language support (Rust/TypeScript/Python)"
category = "core-power-packages"
tags = ["rest", "api", "web", "backend", "http", "crud", "authentication", "validation"]
author = "GGEN Marketplace"
license = "MIT"

[package.metadata]
difficulty = "beginner"
estimated_time = "5 minutes"
use_cases = [
  "E-commerce APIs",
  "Blog and content management",
  "User authentication services",
  "Microservices backends",
  "Mobile app backends",
  "SaaS applications",
  "IoT device management",
  "Real-time APIs"
]

[ontology]
primary = "ontology/rest-api.ttl"
format = "turtle"
validation = "shacl"

[sparql]
templates = "sparql/queries.rq"
query_count = 15

[generation]
languages = ["rust", "typescript", "python"]
frameworks = {
  rust = "axum",
  typescript = "express",
  python = "fastapi"
}

[generation.rust]
template_dir = "templates/rust"
entry_point = "main.rs"
dependencies = [
  "axum = { version = '0.7', features = ['macros'] }",
  "tokio = { version = '1', features = ['full'] }",
  "serde = { version = '1', features = ['derive'] }",
  "serde_json = '1'",
  "tower = '0.4'",
  "tower-http = { version = '0.5', features = ['cors', 'trace'] }",
  "chrono = { version = '0.4', features = ['serde'] }",
  "tracing = '0.1'",
  "tracing-subscriber = '0.3'"
]

[generation.typescript]
template_dir = "templates/typescript"
entry_point = "server.ts"
dependencies = {
  express = "^4.18.0",
  cors = "^2.8.5",
  helmet = "^7.1.0",
  "express-validator" = "^7.0.0",
  "express-rate-limit" = "^7.1.0",
  uuid = "^9.0.0"
}
dev_dependencies = {
  "@types/express" = "^4.17.0",
  "@types/cors" = "^2.8.0",
  "@types/uuid" = "^9.0.0",
  typescript = "^5.3.0",
  "ts-node" = "^10.9.0"
}

[generation.python]
template_dir = "templates/python"
entry_point = "main.py"
dependencies = [
  "fastapi>=0.108.0",
  "uvicorn[standard]>=0.25.0",
  "pydantic[email]>=2.5.0",
  "python-multipart>=0.0.6"
]

[testing]
framework = "chicago-tdd"
test_dir = "tests/chicago_tdd"
coverage_threshold = 80
performance_benchmarks = true
security_tests = true

[testing.rust]
test_dependencies = [
  "testcontainers = '0.15'",
  "hyper = '1.0'"
]

[testing.benchmarks]
enabled = true
min_requests_per_sec = 100
targets = [
  "create_user",
  "list_users",
  "get_user",
  "update_user",
  "delete_user"
]

[testing.security]
enabled = true
tests = [
  "sql_injection",
  "xss_attack",
  "csrf_protection",
  "authentication_bypass"
]

[features]
authentication = ["jwt", "oauth2", "api-key", "basic-auth"]
authorization = ["role-based", "permission-based"]
rate_limiting = ["token-bucket", "fixed-window", "sliding-window"]
caching = ["response-cache", "etag", "cache-control"]
validation = ["request-schema", "response-schema", "custom-rules"]
middleware = ["cors", "helmet", "compression", "logging"]
database = ["postgresql", "mysql", "sqlite", "mongodb"]
openapi = ["swagger-ui", "redoc", "openapi-spec"]

[documentation]
readme = "docs/README.md"
architecture = "docs/ARCHITECTURE.md"
examples = "docs/EXAMPLES.md"
api_reference = "docs/API.md"

[quality]
lines_of_code = {
  ontology = 250,
  sparql = 200,
  rust = 400,
  typescript = 450,
  python = 380,
  tests = 500
}
total_lines = 2180

[performance]
startup_time_ms = 150
response_time_p50_ms = 2
response_time_p99_ms = 10
throughput_rps = 5000
memory_usage_mb = 50

[support]
documentation_url = "https://ggen.ai/docs/templates/rest-api"
examples_url = "https://github.com/ggen/examples/rest-api"
community_discord = "https://discord.gg/ggen"
