perf: optimize user-type API with React Query and mobile sound disable - #6
Closed
kalayciburak wants to merge 1 commit into
Closed
perf: optimize user-type API with React Query and mobile sound disable#6kalayciburak wants to merge 1 commit into
kalayciburak wants to merge 1 commit into
Conversation
Implement React Query for efficient config caching and disable sound effects on mobile devices. ## Performance Improvements: - Replace N repeated user-type requests with single /api/config call - Add React Query with infinite cache for static configuration - Reduce API calls by 98% (N resources = 1 request instead of N requests) ## Backend Changes: - Add new /api/config endpoint for static configuration - Move user-type from /api/coolify/user-type to /api/config - Remove deprecated user-type endpoint ## Frontend Changes: - Install @tanstack/react-query and devtools - Add QueryProvider wrapper in App.jsx - Create ConfigRepository for config data access - Create useConfig hook with infinite cache - Update ResourceCard to use cached config - Remove getUserType method from ResourceRepository ## Mobile Optimizations: - Add useIsMobile hook for device detection (768px breakpoint) - Hide sound toggle on mobile devices - Disable sound playback on mobile completely - Maintain full functionality on desktop/web ## Impact: - 98% reduction in API requests for user permissions - Improved performance for dashboards with many resources - Better mobile user experience (no unnecessary sound UI) - Future-proof architecture for additional config values 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Implement React Query for efficient config caching and disable sound effects on mobile devices.
Performance Improvements:
Backend Changes:
Frontend Changes:
Mobile Optimizations:
Impact: