feat: rewrite as TanStack Todo App (beginner-friendly)#8
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
2 issues found across 31 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="client/src/routes/login.tsx">
<violation number="1" location="client/src/routes/login.tsx:36">
P2: Use the incoming `redirect` search param after login instead of always hard-coding `/todo`.</violation>
</file>
<file name="client/src/components/Navigation.tsx">
<violation number="1" location="client/src/components/Navigation.tsx:15">
P1: Calling the store logout directly bypasses the actual logout flow, leaving the HTTP client tokens and query cache alive in this tab.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| const handleLogout = () => { | ||
| logoutMutation.mutate() | ||
| logout() |
There was a problem hiding this comment.
P1: Calling the store logout directly bypasses the actual logout flow, leaving the HTTP client tokens and query cache alive in this tab.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At client/src/components/Navigation.tsx, line 15:
<comment>Calling the store logout directly bypasses the actual logout flow, leaving the HTTP client tokens and query cache alive in this tab.</comment>
<file context>
@@ -1,186 +1,40 @@
const handleLogout = () => {
- logoutMutation.mutate()
+ logout()
+ navigate({ to: '/login' })
}
</file context>
| setUser(response.user) | ||
| setAuthenticated(true) | ||
| toast.success('Welcome back!') | ||
| navigate({ to: '/todo' }) |
There was a problem hiding this comment.
P2: Use the incoming redirect search param after login instead of always hard-coding /todo.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At client/src/routes/login.tsx, line 36:
<comment>Use the incoming `redirect` search param after login instead of always hard-coding `/todo`.</comment>
<file context>
@@ -1,131 +1,91 @@
+ setUser(response.user)
+ setAuthenticated(true)
+ toast.success('Welcome back!')
+ navigate({ to: '/todo' })
+ } catch (error: any) {
+ toast.error(error.message || 'Login failed')
</file context>
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.
Summary
Refactor the entire client app from a complex chat application to a clean, beginner-friendly Todo App showcasing the TanStack ecosystem.
Changes
✅ Added / Updated
/) with TanStack feature highlights🗑️ Removed
/chat,/room/:id)📦 Tech Stack Showcased
For Reviewers
This is a beginner learning project. The goal is clean, readable code that demonstrates each TanStack library's core patterns.
🔄 This PR completely transforms the application from a complex MERN stack chat app into a clean, beginner-friendly TanStack Todo App. It removes all chat/socket functionality, simplifies the UI components, and refocuses the codebase on demonstrating core TanStack ecosystem patterns for learning purposes.
🔍 Detailed Analysis
Key Changes
/chat,/room/:id,/profile,/forgot-password, and/verify-otproutes, keeping only essential auth and todo routesTechnical Implementation
flowchart TD A[Complex Chat App] --> B[Remove Chat Components] B --> C[Remove Socket.io Provider] C --> D[Simplify Navigation] D --> E[Update Landing Page] E --> F[Clean Auth Pages] F --> G[TanStack Todo App] H[Old Features] --> I[Chat Rooms] H --> J[Real-time Messaging] H --> K[Socket Connection] H --> L[Token Monitoring] M[New Focus] --> N[TanStack Router] M --> O[TanStack Query] M --> P[Zustand Auth] M --> Q[Clean UI/UX]Impact
Created with Palmier
Summary by cubic
Rewrote the client into a beginner-friendly TanStack Todo App, replacing the chat experience. Simplifies auth and layout, removes sockets and token monitor, and sets up
@tanstack/react-queryat the root.New Features
QueryClientProviderandReactQueryDevtools.Refactors
/chat,/room/:id, chat components/services).Written for commit b5b3e0f. Summary will update on new commits.