Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Jesus-Puertos/h-ayuntamiento/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Ayuntamiento de Zongolica platform is built as a modern, server-side rendered (SSR) web application using Astro 5.x as the core framework. The architecture follows a hybrid approach combining static site generation with dynamic server-side rendering for optimal performance and flexibility.High-Level Architecture
The platform consists of four main layers:Frontend Layer
Astro 5.x Framework- Server-side rendering (SSR) enabled via
output: 'server'configuration - Partial hydration with React islands for interactive components
- File-based routing in
/src/pages - Built-in i18n support for multilingual content (es, en, nah-MX)
- Interactive UI components using React 19 with
client:*directives - Hydrated only when needed for optimal performance
- TypeScript for type safety across all components
Backend Layer
Supabase Integration- Authentication: OAuth providers (Google, Facebook) for user login
- Database: PostgreSQL with real-time capabilities
- Storage: Asset and media file storage
- Real-time: Subscriptions for live data updates
Deployment Layer
Vercel Serverless Platform- Configured via
@astrojs/verceladapter - Automatic deployments from Git
- Edge network for global CDN
- Serverless functions for dynamic routes
- Environment variable management
Request Flow
Static Page Request
- User requests a page (e.g.,
/comunicacion) - Vercel edge network serves cached HTML if available
- If not cached, Astro SSR renders the page on-demand
- Response is cached at the edge for subsequent requests
- Client receives fully rendered HTML
Dynamic Page Request (with Auth)
- User visits
/turismo(authenticated route) - Request hits Vercel serverless function
- Astro checks for Supabase session cookie
- If authenticated:
- Fetches user profile from Supabase
- Renders personalized content
- Returns HTML with user-specific data
- If not authenticated:
- Redirects to login or shows public content
- React components hydrate on client for interactivity
Interactive Component Hydration
client:load- Hydrate immediately on page loadclient:idle- Hydrate when browser is idleclient:visible- Hydrate when component enters viewportclient:only- Skip SSR, render only on client
Data Flow
User Authentication Flow
See Authentication for implementation details.Tourism Preferences Flow
- User completes onboarding wizard
TurismoOnboarding.tsxcollects preferences- Data saved to
user_preferencestable viasaveUserPreferences() - Recommendation engine generates personalized route
- Route saved to
user_routestable with share code - User receives digital ticket with QR code
File Structure Mapping
Performance Optimizations
Server-Side Rendering
- Pages rendered on server for fast First Contentful Paint (FCP)
- HTML delivered immediately, no client-side bundle required for initial render
- SEO-friendly with complete markup
Partial Hydration
- Only interactive components ship JavaScript to client
- Static content remains HTML-only
- Reduces JavaScript bundle size significantly
Tailwind CSS 4.x
- Configured via Vite plugin for zero-runtime CSS
- Purged unused styles in production
- Atomic CSS classes for minimal file size
Image Optimization
- WebP format for modern browsers
- Lazy loading with
loading="lazy" - Responsive images with
srcset
Internationalization (i18n)
Multilingual support configured inastro.config.mjs:
- es: Spanish (default, no prefix)
- en: English (
/en/*) - nah-MX: Nahuatl (
/nah-MX/*)
/src/i18n/xochitlanis/*.json.
See Internationalization for usage details.
Security Considerations
Environment Variables
- Public keys safe for client-side use
- Service role keys kept server-side only
- Managed via Vercel environment variables
Row-Level Security (RLS)
- All Supabase tables protected with RLS policies
- Users can only access their own data
- Authentication required for mutations
CORS & CSP
- Vercel handles CORS automatically
- Content Security Policy configured for production
Monitoring & Analytics
The platform uses Vercel Analytics for performance monitoring and tracks Core Web Vitals automatically.
Next Steps
Tech Stack
Explore all technologies and libraries used
Folder Structure
Navigate the project directory layout
Supabase Integration
Database schema and helper functions
Authentication
Implement user authentication flows
