Deploy Web App
ShipFlutter web apps are optimized for Firebase Hosting, providing fast and secure hosting with automatic SSL and CDN.
Prerequisites
-
Install Firebase CLI:
-
Login to Firebase:
-
Enable App Check for web (see App Check setup)
Configure Firebase
-
Initialize Firebase in your project root:
-
Select the following features:
- Hosting
- Emulators (optional, for local testing)
-
Configure hosting:
- Select your Firebase project
- Use
build/web
as the public directory - Configure as a single-page app
- Set up automatic builds and deploys (optional)
Build for Production
-
Update
web/index.html
: -
Build the web app:
-
Test the production build locally:
Deploy
-
Deploy to Firebase Hosting:
-
Your app will be available at:
https://<project-id>.web.app
https://<project-id>.firebaseapp.com
-
Set up a custom domain (optional):
- Go to Firebase Console > Hosting
- Click “Add custom domain”
- Follow the DNS configuration steps
CI/CD Setup
For automated deployments, add this to your GitHub Actions workflow:
Performance Tips
-
Optimize Assets
- Compress images using WebP format
- Use appropriate image sizes
- Lazy load non-critical resources
-
PWA Support
- Update
manifest.json
with your app info - Add necessary icons in
web/icons
- Test offline functionality
- Update
-
SEO
- Add proper meta tags
- Include a sitemap
- Set up robots.txt