feat: Complete frontend master upgrade with PWA, SEO, Bundle Analysis, and State Management

- Install nanostores for lightweight state management
- Add enhanced Directus client with auth and realtime
- Configure PWA with offline support and service worker
- Enable auto-sitemap generation for SEO
- Add Partytown for web worker analytics
- Implement image optimization with astro-imagetools
- Add bundle visualizer for performance analysis
- Enable Brotli compression for all assets
- Add Vite Inspect for debugging
- Create sidebar state management store
- Install TipTap rich text editor
- Add React Hook Form + Zod validation
- Add TanStack Query for data fetching

All plugins tested and build verified successfully.
This commit is contained in:
cawcenter
2025-12-13 17:35:09 -05:00
parent c67cb6b205
commit b2d548c5fb
7 changed files with 11236 additions and 21 deletions

View File

@@ -0,0 +1,12 @@
import { createDirectus, rest, authentication, realtime } from '@directus/sdk';
import type { SparkSchema } from '@/types/schema';
const DIRECTUS_URL = import.meta.env.PUBLIC_DIRECTUS_URL || 'https://spark.jumpstartscaling.com';
export const directus = createDirectus<SparkSchema>(DIRECTUS_URL)
.with(authentication('cookie', { autoRefresh: true, mode: 'json' }))
.with(rest())
.with(realtime());
// Re-export for convenience
export { readItems, readItem, createItem, updateItem, deleteItem, aggregate } from '@directus/sdk';

View File

@@ -0,0 +1,17 @@
import { atom } from 'nanostores';
// Sidebar open/close state
export const isSidebarOpen = atom(true);
// Active route for highlighting
export const activeRoute = atom('/admin');
// Helper to toggle sidebar
export function toggleSidebar() {
isSidebarOpen.set(!isSidebarOpen.get());
}
// Helper to set active route
export function setActiveRoute(route: string) {
activeRoute.set(route);
}