Skip to content

Conversation

@abhigyaabs2
Copy link

@abhigyaabs2 abhigyaabs2 commented Aug 1, 2025

1. Title: Refactored database table creation into FastAPI startup event
Description:
The database tables were created using Base.metadata.create_all() at the top-level script. This can lead to unexpected behaviors in production or during test runs.
Fixes:
Moved the table creation logic into a FastAPI @app.on_event("startup") function to ensure tables are only created when the app start

2. Title: Added CORS middleware support for frontend integration
Description:
To allow cross-origin requests from the frontend (e.g., React/Vue app), CORS headers has be added. Without CORS middleware, requests from different origins (e.g., frontend on localhost:3000) may be blocked.

Fixes:
Used FastAPI’s CORSMiddleware to enable cross-origin requests.

3. Title: Enhanced Swagger UI with route tags

Description:
The routes in Swagger (docs) were ungrouped. Adding tags while including routers will help organize them logically and improve developer usability.

Fixes:
Used:
app.include_router(favorites.router, tags=["Favorites"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant