Overview
Showtimes NG is built with Astro in static site generation mode (output: 'static'). This means the entire site is pre-rendered at build time into static HTML, CSS, and JavaScript files that can be deployed to any static hosting provider.
Prerequisites
Before deploying, ensure you have:- A working local development environment (see Development Setup)
- A Supabase project with the database schema configured
- Your Supabase credentials (
PUBLIC_SUPABASE_URLandPUBLIC_SUPABASE_ANON_KEY)
Build Process
Build the site
Run the build command:This will:
- Fetch data from your Supabase database
- Generate static pages for all movies and cinemas
- Optimize assets and create production bundles
- Output everything to the
./dist/directory
The build process queries your database to generate static paths for all movies and cinemas. Ensure your database is populated before building.
Deployment Options
Astro’s static output can be deployed to any static hosting provider. Here are the most popular options:Vercel
Vercel Configuration:
Vercel automatically detects Astro projects. No additional configuration needed.
Netlify
Netlify Configuration:
Create a
netlify.toml file in your project root:
Cloudflare Pages
Connect repository
- Log in to the Cloudflare dashboard
- Go to Pages and click Create a project
- Connect your Git repository
Configure build settings
- Build command:
npm run build - Build output directory:
dist - Framework preset: Astro (auto-detected)
Set environment variables
Add your Supabase credentials in the Environment variables section:
PUBLIC_SUPABASE_URLPUBLIC_SUPABASE_ANON_KEY
GitHub Pages
Configure secrets
In your GitHub repository, go to Settings > Secrets and variables > Actions and add:
PUBLIC_SUPABASE_URLPUBLIC_SUPABASE_ANON_KEY
AWS S3 + CloudFront
Environment Variables
All deployment platforms need these environment variables set:Your Supabase project URL (e.g.,
https://xxxxx.supabase.co)Your Supabase anonymous key for client-side access
Post-Deployment
Verify Deployment
After deployment, verify:- Homepage loads - Check that the now showing movies appear
- Movie pages - Navigate to individual movie pages
- Cinema pages - Navigate to cinema pages
- Showtimes display - Verify showtimes are correctly grouped by cinema/movie
- Sitemap - Check that
/sitemap-index.xmlis accessible
Update Content
Since Showtimes NG uses static site generation:Consider setting up a cron job or GitHub Action to automatically rebuild the site daily to keep showtimes up to date.
Automated Rebuilds
Example GitHub Action for daily rebuilds:Domain Configuration
The site is configured forhttps://showtimes.ng in astro.config.mjs:
Custom Domain Setup
For most hosting providers:- Add your custom domain in the hosting dashboard
- Update your DNS records to point to the hosting provider
- Enable HTTPS (usually automatic)
- Update
siteinastro.config.mjsto match your domain
Performance Optimization
Build Optimization
Astro automatically optimizes your build:- Image optimization - Automatic image resizing and format conversion
- CSS minification - Removes unused CSS
- JavaScript bundling - Minimal client-side JS
- HTML compression - Minified HTML output
CDN Benefits
Using a CDN-based host (Vercel, Netlify, Cloudflare Pages) provides:- Global edge caching - Fast load times worldwide
- Automatic HTTPS - SSL certificates managed for you
- DDoS protection - Built-in security
Troubleshooting
Build fails with “No data returned”
Ensure your database has data and your Supabase credentials are correct:Environment variables not working
Verify:- Variables are prefixed with
PUBLIC_for client-side access - Variables are set in your hosting provider’s dashboard
- You’ve triggered a new deployment after adding variables
Pages not generating
Check that your database has movies/cinemas with valid IDs. The build process uses:Sitemap not generating
Ensuresite is configured in astro.config.mjs:
Monitoring
Consider adding monitoring to track:- Uptime - Site availability
- Build success - Automated rebuild status
- Error logs - Client-side errors
- Performance - Page load times
- Vercel Analytics (if using Vercel)
- Sentry for error tracking
- Google Analytics for usage metrics
- Uptime Robot for availability monitoring