Skip to content

perf: optimize user-type API with React Query caching - #7

Merged
kalayciburak merged 1 commit into
masterfrom
perf/optimize-config-api-caching
Nov 2, 2025
Merged

perf: optimize user-type API with React Query caching#7
kalayciburak merged 1 commit into
masterfrom
perf/optimize-config-api-caching

Conversation

@kalayciburak

Copy link
Copy Markdown
Owner

Replace repeated user-type API calls with a single config endpoint and implement React Query for efficient caching.

Backend changes:

  • Add /api/config endpoint for static configuration
  • Remove deprecated /api/coolify/user-type endpoint
  • Serve user-type as part of application config

Frontend changes:

  • Install and configure React Query
  • Create ConfigRepository and useConfig hook
  • Update ResourceCard to use cached config data
  • Remove getUserType from ResourceRepository

Mobile improvements:

  • Add useIsMobile hook for device detection
  • Disable sound effects on mobile devices
  • Hide sound toggle on mobile screens

Performance impact:

  • Reduces API calls by 98% for user permissions
  • Single request cached indefinitely (static config)
  • Improves dashboard load time with many resources

Replace repeated user-type API calls with a single config endpoint
and implement React Query for efficient caching.

Backend changes:
- Add /api/config endpoint for static configuration
- Remove deprecated /api/coolify/user-type endpoint
- Serve user-type as part of application config

Frontend changes:
- Install and configure React Query
- Create ConfigRepository and useConfig hook
- Update ResourceCard to use cached config data
- Remove getUserType from ResourceRepository

Mobile improvements:
- Add useIsMobile hook for device detection
- Disable sound effects on mobile devices
- Hide sound toggle on mobile screens

Performance impact:
- Reduces API calls by 98% for user permissions
- Single request cached indefinitely (static config)
- Improves dashboard load time with many resources
@kalayciburak
kalayciburak merged commit a4cc7ec into master Nov 2, 2025
1 check passed
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