Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9e64c9e
restructure for scale
PhilippTheServer Dec 6, 2025
fe909bb
add ruff and pytest
PhilippTheServer Dec 6, 2025
d465e26
feat(logger): add core enums and interfaces
PhilippTheServer Dec 6, 2025
bc971a1
feat(logger): add JSON and Console formatters
PhilippTheServer Dec 6, 2025
f46ce69
feat(logger): add log filters
PhilippTheServer Dec 6, 2025
44a1606
feat(logger): add log handlers
PhilippTheServer Dec 6, 2025
7aeb435
feat(logger): add configuration system
PhilippTheServer Dec 6, 2025
f47947e
feat(logger): add context management
PhilippTheServer Dec 6, 2025
8faabce
feat(logger): add AppLogger class
PhilippTheServer Dec 6, 2025
e99df6c
feat(logger): add factory pattern
PhilippTheServer Dec 6, 2025
87e94fb
test: add pytest configuration
PhilippTheServer Dec 6, 2025
fbc70b0
test(logger): add comprehensive test suite
PhilippTheServer Dec 6, 2025
4dc8366
docs(logger): add usage examples
PhilippTheServer Dec 6, 2025
807334f
docs: add logger and testing documentation
PhilippTheServer Dec 6, 2025
4383843
docs: add architecture and development guides
PhilippTheServer Dec 6, 2025
e20fb81
refactor: remove old service structure
PhilippTheServer Dec 6, 2025
2571f86
feat(crud-item-store): add item store service scaffold
PhilippTheServer Dec 6, 2025
a257152
refactor: update main app and authorization
PhilippTheServer Dec 6, 2025
ab580f3
build(docker): refactor build process for less build time/size
PhilippTheServer Dec 7, 2025
aaaede8
dist: update dependencys to latest
PhilippTheServer Dec 7, 2025
bf4b06b
build: add pydantic-settings and python-dotenv dependencies
PhilippTheServer Dec 7, 2025
e924a50
feat(config): add Environment enum for environment detection
PhilippTheServer Dec 7, 2025
af57ad6
feat(config): add secret loader for Docker/K8s secrets
PhilippTheServer Dec 7, 2025
d9f76a1
feat(config): add Settings class with environment-based configuration
PhilippTheServer Dec 7, 2025
a833ca0
feat(config): add get_settings() singleton factory
PhilippTheServer Dec 7, 2025
ce6938e
feat(config): add module public API exports
PhilippTheServer Dec 7, 2025
e909255
chore: add .env.example template and update .gitignore
PhilippTheServer Dec 7, 2025
2da1d3e
test(config): add comprehensive test suite (35 tests)
PhilippTheServer Dec 7, 2025
281f92b
docs(config): add comprehensive configuration guide
PhilippTheServer Dec 7, 2025
b44b8ea
refactor(logger): use shared Environment enum from config
PhilippTheServer Dec 7, 2025
c2bec3d
chore(main): update imports and formatting
PhilippTheServer Dec 7, 2025
8fc2f5c
feat(exceptions): add ErrorCode and ErrorCategory enums
PhilippTheServer Dec 7, 2025
71e7c4a
feat(exceptions): add IAppException and IExceptionHandler interfaces
PhilippTheServer Dec 7, 2025
829a114
feat(exceptions): add AppException base class with auto-logging
PhilippTheServer Dec 7, 2025
7a1b2d4
feat(exceptions): add 8 concrete exception classes
PhilippTheServer Dec 7, 2025
0d760fd
feat(exceptions): add 20+ helper functions for common error scenarios
PhilippTheServer Dec 7, 2025
9123099
feat(exceptions): add public API exports
PhilippTheServer Dec 7, 2025
1c54fe6
test(exceptions): add comprehensive test suite with 35 tests
PhilippTheServer Dec 7, 2025
48c0424
docs(exceptions): add complete module documentation
PhilippTheServer Dec 7, 2025
b29ff1f
docs(exceptions): add usage examples and patterns
PhilippTheServer Dec 7, 2025
8150c99
build: update dependencies
PhilippTheServer Dec 7, 2025
7bb6c7c
refactor: run ruff check --fix src/ tests/ && ruff format
PhilippTheServer Dec 7, 2025
f627648
feat(responses): add BaseResponse with common fields
PhilippTheServer Dec 7, 2025
ccba40b
feat(responses): add generic success response models
PhilippTheServer Dec 7, 2025
f2579db
feat(responses): add error responses with exception integration
PhilippTheServer Dec 7, 2025
258bf81
feat(responses): add pagination models for page and cursor-based navi…
PhilippTheServer Dec 7, 2025
d6f1422
feat(responses): add factory helper functions for quick response crea…
PhilippTheServer Dec 7, 2025
260f401
feat(responses): add public API exports for response module
PhilippTheServer Dec 7, 2025
ab19fe7
test(responses): add 34 tests for response models
PhilippTheServer Dec 7, 2025
dcfabbe
docs(responses): add comprehensive module documentation
PhilippTheServer Dec 7, 2025
f7a066c
docs: example shared moduls implementation
PhilippTheServer Dec 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# ==================================
# OpenTaberna API - Environment Configuration
# ==================================
#
# Copy this file to .env and customize for your environment
# Never commit .env files to version control!

# ----------------------------------
# Application
# ----------------------------------
APP_NAME=OpenTaberna API
APP_VERSION=0.1.0
ENVIRONMENT=development
DEBUG=false
SECRET_KEY=CHANGE_ME_IN_PRODUCTION

# ----------------------------------
# Server
# ----------------------------------
HOST=0.0.0.0
PORT=8000
WORKERS=1
RELOAD=false

# ----------------------------------
# Database
# ----------------------------------
# PostgreSQL connection URL
# Format: postgresql+asyncpg://user:password@host:port/database
DATABASE_URL=postgresql+asyncpg://opentaberna:opentaberna@localhost:5432/opentaberna

# Connection pool settings
DATABASE_POOL_SIZE=20
DATABASE_MAX_OVERFLOW=40
DATABASE_POOL_TIMEOUT=30
DATABASE_ECHO=false

# ----------------------------------
# Redis
# ----------------------------------
REDIS_URL=redis://localhost:6379/0
# REDIS_PASSWORD= # Load from Docker/K8s secret in production

# ----------------------------------
# Keycloak
# ----------------------------------
KEYCLOAK_URL=http://localhost:8080
KEYCLOAK_REALM=opentaberna
KEYCLOAK_CLIENT_ID=opentaberna-api
# KEYCLOAK_CLIENT_SECRET= # Load from Docker/K8s secret in production

# ----------------------------------
# CORS
# ----------------------------------
# Comma-separated list of allowed origins
# Use ["*"] for development, specific domains in production
CORS_ORIGINS=["*"]
CORS_CREDENTIALS=true

# ----------------------------------
# Logging
# ----------------------------------
LOG_LEVEL=INFO
LOG_FORMAT=console
# LOG_FILE=/var/log/opentaberna/app.log

# ----------------------------------
# Cache
# ----------------------------------
CACHE_ENABLED=true
CACHE_TTL=300

# ----------------------------------
# Rate Limiting
# ----------------------------------
RATE_LIMIT_ENABLED=true
RATE_LIMIT_PER_MINUTE=60

# ----------------------------------
# Feature Flags
# ----------------------------------
FEATURE_WEBHOOKS_ENABLED=false

# ==================================
# Notes:
# ==================================
#
# Sensitive values (passwords, secrets) should be loaded from:
# - Docker secrets: /run/secrets/<secret_name>
# - Kubernetes secrets: /var/run/secrets/<secret_name>
# - Environment variables (uppercase with underscores)
#
# Example production setup:
# - Store DATABASE_URL in /run/secrets/database_url
# - Store REDIS_PASSWORD in /run/secrets/redis_password
# - Store KEYCLOAK_CLIENT_SECRET in /run/secrets/keycloak_client_secret
#
# Generate secure SECRET_KEY:
# python -c "import secrets; print(secrets.token_urlsafe(32))"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,5 @@ cython_debug/

# PyCharm
# .idea/

.env.test
12 changes: 12 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
Pytest configuration for the fastapi_opentaberna project.

This file configures pytest to properly find and import modules.
"""

import sys
from pathlib import Path

# Add src directory to Python path
src_path = Path(__file__).parent / "src"
sys.path.insert(0, str(src_path))
Loading
Loading