Issue: Add authentication and API integration to samples app
Summary
Integrate authentication (login/logout) and connect the samples app to the Graph API and database, making all use cases work with real user data and live CRUD operations.
Goals
- Add login/logout functionality to samples app
- Integrate with Graph API authentication endpoints
- Connect use cases to real backend/database
- Enable authenticated CRUD operations
- Make app fully functional with real data
Scope
- Authentication UI:
- Add login page/component
- Add logout functionality
- Display user info when logged in
- Add authentication state management
- API Integration:
- Create API client service
- Configure API base URL (environment-based)
- Implement JWT token storage/refresh
- Add authorization headers to requests
- Connect to GraphContext:
- Wire up SPEC0200-0204 CRUD operations
- Connect use cases to real data:
- GitHub Issue tracker → real issues in graph
- Kanban Board → real tasks/workflow
- Todo List → real user todos
- User Context:
- Store authenticated user info
- Filter data by logged-in user
- Implement user-scoped operations
Acceptance Criteria
- Users can login with username/password
- JWT token stored and sent with API requests
- Users can logout and token is cleared
- Protected routes require authentication
- Use cases (GitHub Issue, Kanban, Todo) work with real user data
- CRUD operations persist to database via API
- User can only see/modify their own data
- Token refresh works when token expires
- Clear error messages for auth failures
Technical Implementation
- AuthenticationService:
- Login/logout methods
- Token storage (localStorage/sessionStorage)
- Token refresh logic
- User state management
- ApiClient Service:
- Base HTTP client with auth headers
- Methods for CRUD operations
- Error handling
- AuthenticationStateProvider:
- Track authentication state
- Provide user claims
- Protected Routes:
- Redirect to login when not authenticated
- Show/hide UI based on auth state
API Endpoints Needed
- POST /api/auth/login
- POST /api/auth/logout
- POST /api/auth/refresh
- GET /api/auth/user
- CRUD endpoints for nodes, edges, types, properties
Checklist
Dependencies
References
Issue: Add authentication and API integration to samples app
Summary
Integrate authentication (login/logout) and connect the samples app to the Graph API and database, making all use cases work with real user data and live CRUD operations.
Goals
Scope
Acceptance Criteria
Technical Implementation
API Endpoints Needed
Checklist
Dependencies
References