Numerous Flutter-developed web app hosting within the same Firebase project is a realistic solution that takes advantage of Firebase Hosting’s support for multiple sites. Here’s a step-by-step guide for setting things up.
- Setup Firebase for Flutter web app hosting
First, make sure you have the Firebase CLI installed. If not, install it using the following command:
npm install -g firebase-tools
Log in to your Firebase account:
firebase login
Set firebase project
firebase use – -add projectname
- Initialize Firebase Hosting
Navigate to your project directory and initialize firebase hosting
firebase init hosting
During initialization,
- Hosting: Configure files for firebase hosting and set up github action deploys
- Do you want to use a web framework : No
- What do you want to use as public directory : build/web
- Set No other questions
- Build Web
flutter build web
- Add Multiple Sites to Firebase Hosting
Firebase allows you to construct numerous sites within a single project. Each site can run a different Flutter web app.
firebase hosting:sites:create SITE_ID
Instead of SITE_ID give a hosting name.
- Configure firebase.json
Go to firebase project navigate to Hosting, select created hosting site then instruction, copy and paste to firebase.json inside your project.
- Deploy web app
firebase deploy –only hosting:sitename
Benefits of Using Firebase Hosting for Multiple Flutter Web Apps
Centralized Management: Multiple web app hosting and management will be done under a single Firebase project.
Scalability: Firebase Hosting scales automatically to handle your web apps’ traffic.
Security: Take advantage of Firebase’s security features like SSL, custom domains, and more.
Why Choose Sreyas For the Flutter Web App Hosting
At Sreyas IT Solutions, we are highly experienced in setting up and managing multiple web apps within a single Firebase project. Our project, Flutter Hub, which includes desktop, web, and mobile admin panels, is built using this very approach. Our team possesses extensive knowledge and expertise in Flutter development and Firebase integration, ensuring a smooth and efficient setup process.
We provide end-to-end support, covering everything from initial setup to deployment and ongoing maintenance. Our proficiency in Firebase Hosting allows us to offer scalable, secure, and high-performance solutions tailored to your business needs. Whether you’re launching multiple web apps or looking to streamline your web app hosting, Sreyas IT Solutions is here to assist you every step of the way.
By leveraging our services, you can focus on building your Flutter web apps while we handle the complexities of hosting and deployment. Contact us today to learn more about how we can help you achieve your goals with Firebase and Flutter.