Add initial project configuration and setup for Reference Board Viewer application. Include EditorConfig for consistent coding styles, pre-commit hooks for linting and formatting, Docker Compose for local development with PostgreSQL and MinIO, and a Nix flake for development environment management. Establish CI/CD pipeline for automated testing and deployment.

This commit is contained in:
Danilo Reyes
2025-11-01 22:28:46 -06:00
parent 58f463867e
commit 1bc657e0fd
33 changed files with 1756 additions and 38 deletions

View File

@@ -0,0 +1,29 @@
"""CORS and other middleware configuration."""
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.trustedhost import TrustedHostMiddleware
from app.core.config import settings
def setup_middleware(app: FastAPI) -> None:
"""Configure application middleware."""
# CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=settings.CORS_ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Security headers (optional, add more as needed)
# Note: TrustedHostMiddleware not added by default in dev
# Uncomment for production:
# app.add_middleware(
# TrustedHostMiddleware,
# allowed_hosts=["yourdomain.com", "*.yourdomain.com"]
# )