Repository navigation
Authentication Integration, CORS & DB Session Optimizations, and UI Profile Menu - #8
Merged
Merged
Conversation
… routes, and stats endpoints
…nd UI state enhancements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Authentication Integration, CORS & DB Session Optimizations, and UI Profile Menu
Summary of Changes
This PR introduces critical architectural improvements across the frontend and backend of SelfSmart, including secure authenticated API requests, database connection pool auto-coercion for async SQLite, CORS middleware support, and frontend user profile section in the sidebar.
Key Changes
1. Dependencies & Configuration (
chore)frontend/next.config.tsto forward/api/*and/statuscalls to the backend service.@radix-ui/react-avatar,@radix-ui/react-dropdown-menu,zod,aiolimiter, and updated locking files (uv.lock,package-lock.json).DATABASE_URLdefault dialect tosqlite+aiosqlite:///'in.env.exampleand updated startup docs inREADME.md.*.db,*.sqlite3).2. Backend API & Database Infrastructure (
feat)src/db/session.pyto auto-coerce sync SQLite URLs tosqlite+aiosqlite:///and useNullPoolfor SQLite to prevent connection lock issues.CORSMiddlewareinsrc/api/main.pyallowing origins likehttp://localhost:3000.SubOrchestratorinsrc/db/models.py.src/api/routes/chat.pyandsrc/api/routes/stats.pyto sourcechat_runtimedependencies cleanly.feedback.jsonlin the/statsendpoint.FreeAPIClientinsrc/api/free_api_client.pyfor dynamicaiohttp.TCPConnectorinitialization without proxy issues.3. Frontend Authentication & UI Enhancements (
feat)authFetch(frontend/src/lib/authFetch.ts) to automatically attach JWTAuthorization: Bearer <token>headers on API calls.useChatStore,useStreamingChat, andChatMessagecomponents to leverageauthFetch.Sidebar.tsx.AuthWrapperintofrontend/src/components/auth/AuthWrapper.tsxand updated local storage user name handling.Verification Plan
Automated Tests
scripts/test_app.py.Manual Verification
uvicorn src.api.main:app --reloadcd frontend && npm run devauthFetch.