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
Vercel is the recommended hosting platform for the Ayuntamiento de Zongolica application. This guide walks you through deploying your Astro application with the Vercel adapter.Prerequisites
Before deploying, ensure you have:- A GitHub account with your code repository
- A Vercel account (free tier available)
- Completed Supabase setup
- Your environment variables ready
Project Configuration
The application is already configured for Vercel deployment:The
output: 'server' configuration enables SSR (Server-Side Rendering), which is required for authentication and dynamic content.Deploy from GitHub
Connect to Vercel
- Go to vercel.com and sign in
- Click Add New → Project
- Import your GitHub repository
Configure Build Settings
Vercel should auto-detect Astro. Verify these settings:
- Framework Preset: Astro
- Build Command:
astro build(ornpm run build) - Output Directory:
dist - Install Command:
npm install
Add Environment Variables
Click Environment Variables and add:Add any other optional variables your application needs.
Deploy Configuration
The application includes avercel.json file for advanced configuration:
URL Redirects
Configured redirects for legacy URLs and route corrections:These redirects maintain SEO value from old URLs and ensure visitors reach the correct pages.
Cache Headers
Optimized caching for static assets:- Caches Astro-generated assets for 1 year
- Marks them as
immutablefor maximum efficiency - Reduces bandwidth and improves load times
Custom Domain Setup
Add Domain in Vercel
- Go to your project Settings → Domains
- Click Add Domain
- Enter your domain (e.g.,
zongolica.gob.mx)
Configure DNS Records
Add these DNS records in your domain registrar:Option A: Using Vercel nameservers (Recommended)
- Update your domain’s nameservers to Vercel’s
Update Supabase URLs
Update redirect URLs in Supabase:
- Go to Authentication → URL Configuration
- Update Site URL:
https://your-domain.com - Add to Redirect URLs:
https://your-domain.com/auth/callback
Multi-Language Routes
The application supports three locales:es(Spanish - default):https://your-domain.com/turismoen(English):https://your-domain.com/en/tourismnah-MX(Nahuatl):https://your-domain.com/nah-MX/turismo
The default locale (
es) doesn’t include a prefix in the URL, following the prefixDefaultLocale: false configuration.Continuous Deployment
Vercel automatically deploys when you push to GitHub:Deployment Branches
- Production: Deploys from
mainbranch - Preview: Automatically created for pull requests
- Development: You can configure additional branches
Environment-Specific Variables
Set different values for different environments:Add Variable
When adding a variable, select which environments should use it:
- Production: Live site
- Preview: Pull request previews
- Development: Local development (optional)
Monitoring and Analytics
View Deployment Logs
Enable Vercel Analytics
Troubleshooting
Build Fails
Check build logs for specific errors:404 Errors After Deploy
Possible causes:- SSR routes not configured properly
- Missing pages
output: 'server' in astro.config.mjs
Environment Variables Not Working
- Verify variable names match exactly (case-sensitive)
- Check if variables need
PUBLIC_prefix - Redeploy after adding/changing variables
- Clear cache and redeploy if needed
Slow Build Times
Optimize build:- Remove unused dependencies
- Use Vercel’s build cache
- Optimize images before uploading
Vercel CLI (Optional)
For advanced users, deploy from the command line:Best Practices
✅ Recommended:- Use environment-specific variables
- Enable automatic deployments from main branch
- Set up preview deployments for pull requests
- Monitor build times and optimize as needed
- Use custom domains with SSL
- Enable Vercel Analytics for insights
- Committing
.envfiles - Using production credentials in preview environments
- Deploying without testing locally first
- Ignoring build warnings
Next Steps
After deploying to Vercel:- Configure OAuth providers with your production URL
- Set up storage buckets in Supabase
- Test authentication flow on your live site
- Configure your custom domain
