Deploy to Firebase Hosting
Three sites in one Firebase project, each on its own address.
Firebase Hosting is free for ordinary traffic, gives you HTTPS automatically and serves from a CDN. One project can host all three sites as separate hosting sites.
Create the three sites
firebase hosting:sites:create myacademy
firebase hosting:sites:create myacademy-instructor
firebase hosting:sites:create myacademy-admin
Each becomes https://<name>.web.app. Names are global, so you may need to try a couple.
Point each app at its site
In each app folder, add a hosting block to firebase.json:
{
"hosting": {
"site": "myacademy",
"public": "build/web",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [{ "source": "**", "destination": "/index.html" }]
}
}
The rewrite is what makes deep URLs work
Without rewrites, visiting /course/flutter-basics directly returns a 404 — the server looks for a file at that path. The rewrite sends every unknown path to index.html so the app can route it. Keep it in all three sites.
Deploy
cd user_app && firebase deploy --only hosting
Repeat in instructor/ and admin_panel/. Each prints its live URL when it finishes.
Authorise the domains for sign-in
Firebase console → Authentication → Settings → Authorised domains. The web.app addresses are added automatically; add any custom domain. Sign-in is refused on a domain that is not listed.
Do not deploy rules from an app folder
Each app's generated firebase.json still has firestore and storage blocks pointing at ../firebase_rules/, a folder that no longer exists. firebase deploy --only hosting is safe and ignores them; a bare firebase deploy will fail on the missing path. Always pass --only hosting here, and deploy rules from the setup tool.
Deploying an update later
flutter build web --release
firebase deploy --only hosting
Firebase keeps previous releases, so you can roll back from the Hosting page in the console if an update goes wrong.
Keep the admin panel quiet
There is no public sign-up for admins, so nothing links to the admin site. Give it an address people will not guess, and consider adding <meta name="robots" content="noindex"> to its web/index.html so it stays out of search results. Security still comes from the rules, not obscurity — but there is no reason to advertise it.