Files
simple-mensa/api/config.yaml
T
Matteo Benedetto d592e0f32b feat: Refactor API structure and implement core functionalities
- Updated requirements to include asyncpg, pyyaml, aiofiles, and httpx.
- Modified schema.sql to add 'tipo_pasto' column in 'pasti' table.
- Created .gitignore file to exclude unnecessary files and directories.
- Added README.md for API implementation details and directory structure.
- Introduced config.yaml for centralized configuration management.
- Implemented core modules for database management, authentication, and exception handling.
- Developed models for 'pietanze', 'pasti', and 'prenotazioni' with validation.
- Created routes for CRUD operations on 'pietanze' with pagination and filtering.
- Established logging and error handling mechanisms throughout the application.
- Set up FastAPI application with CORS and health check endpoint.
2025-06-05 18:31:36 +02:00

82 lines
1.7 KiB
YAML

# Simple Mensa API Configuration
# Database Configuration
database:
host: "localhost"
port: 5432
name: "postgres"
user: "postgres"
password: "example"
pool_min_size: 5
pool_max_size: 20
pool_max_queries: 50000
pool_max_inactive_connection_lifetime: 300.0
# Authentication Configuration
auth:
algorithm: "RS256"
# JWT settings for external providers (Azure AD / Keycloak)
jwks_url: "https://login.microsoftonline.com/common/discovery/v2.0/keys"
issuer: "https://login.microsoftonline.com/{tenant_id}/v2.0"
audience: "api://simple-mensa"
# Token expiration in seconds
access_token_expire_minutes: 60
# API Server Configuration
server:
host: "0.0.0.0"
port: 8000
debug: false
reload: false
workers: 1
# CORS Configuration
cors:
allow_origins:
- "http://localhost:3000"
- "http://localhost:8080"
allow_credentials: true
allow_methods:
- "GET"
- "POST"
- "PUT"
- "DELETE"
- "OPTIONS"
allow_headers:
- "Authorization"
- "Content-Type"
- "Accept"
# Rate Limiting
rate_limiting:
enabled: true
requests_per_minute: 60
burst_size: 10
# Logging Configuration
logging:
level: "INFO"
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
file: "logs/api.log"
max_file_size: "10MB"
backup_count: 5
# Business Logic Configuration
business:
# Maximum days in advance for booking
max_booking_days: 7
# Minimum hours before meal time to allow booking
min_booking_hours: 2
# Default page size for pagination
default_page_size: 20
max_page_size: 100
# Notification Settings
notifications:
enabled: true
email_provider: "smtp"
smtp_host: "localhost"
smtp_port: 587
smtp_user: ""
smtp_password: ""