Fix syntax errors in MapView.vue and improve backend production robustness (CORS, DB URL, auto-migrations, and seeding)

This commit is contained in:
2026-02-22 16:00:52 -05:00
parent 33154169c8
commit 532aad16df
18 changed files with 2460 additions and 2995 deletions

View File

@ -42,5 +42,12 @@ class Settings(BaseSettings):
)
# Global settings instance
# Global settings instance
@property
def get_database_url(self) -> str:
url = self.database_url
if url.startswith("postgres://"):
url = url.replace("postgres://", "postgresql://", 1)
return url
settings = Settings()

View File

@ -8,7 +8,12 @@ from app.core.config import settings
# Create database engine
# Convert asyncpg URL to psycopg2 for synchronous operations
database_url = settings.database_url.replace("+asyncpg", "+psycopg2")
database_url = settings.get_database_url
if "+asyncpg" in database_url:
database_url = database_url.replace("+asyncpg", "+psycopg2")
elif "postgresql://" in database_url and "+psycopg2" not in database_url:
database_url = database_url.replace("postgresql://", "postgresql+psycopg2://")
engine = create_engine(
database_url,
echo=settings.debug,