Phase 7: End-to-End API Testing - Database setup, migrations, and application fixes
- Switched from psycopg2 to asyncpg for async SQLAlchemy support - Fixed router registration in main.py - removed duplicate prefixes - Added user_data export to routers/__init__.py - Refactored decks router to use DeckManager service layer - Integrated FuzzyCardMatcher into card_router search endpoints - Made WishlistCreate.card_id optional for proper schema validation - Set PostgreSQL password and configured scram-sha-256 auth - Updated alembic.ini to use local PostgreSQL instead of Docker hostname - Created generic_schemas.py for reusable schema patterns - Added test_routers.py and test_schema_validation.py test files - All 6 Alembic migrations applied successfully (37 tables created) - Application running on port 8000 with all services connected
This commit is contained in:
+5
-4
@@ -24,7 +24,8 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from app.core.settings import get_settings
|
||||
from app.core.database import engine, mtg_engine, async_session, mtg_async_session
|
||||
from app.routers import auth, users, decks, rooms, games, admin, card_router, interactions, refresh, user_data, card_import
|
||||
from app.routers import auth, users, decks, rooms, admin, card_router, interactions, refresh, user_data, card_import
|
||||
from app.routers.games import router as games_router
|
||||
from app.services.mtgjson_manager import MTGJSONManager
|
||||
|
||||
|
||||
@@ -135,10 +136,10 @@ app.include_router(auth.router, prefix="/auth", tags=["Authentication"])
|
||||
app.include_router(users.router, prefix="/users", tags=["Users"])
|
||||
app.include_router(decks.router, prefix="/decks", tags=["Decks"])
|
||||
app.include_router(rooms.router, prefix="/rooms", tags=["Rooms"])
|
||||
app.include_router(games.router, prefix="/games", tags=["Games"])
|
||||
app.include_router(games_router, prefix="/games", tags=["Games"])
|
||||
app.include_router(admin.router, prefix="/admin", tags=["Admin"])
|
||||
app.include_router(card_router.router, prefix="/api", tags=["MTG Cards"])
|
||||
app.include_router(interactions.router, tags=["Card Interactions"])
|
||||
app.include_router(card_router.router, tags=["MTG Cards"])
|
||||
app.include_router(interactions.router)
|
||||
app.include_router(refresh.router)
|
||||
app.include_router(user_data.router, prefix="/api/v1/user-data", tags=["User Data"])
|
||||
app.include_router(card_import.router, prefix="/api/v1/card-import", tags=["Card Import"])
|
||||
|
||||
Reference in New Issue
Block a user