The primary Firebase project stays fixed as the public deployment center for hosting and backend endpoints.প্রাইমারি Firebase project-ই public hosting এবং backend endpoint-এর স্থায়ী deployment center হিসেবে থাকবে।
Mission Scopeমিশন ও পরিধি
Why This Page Existsএই পেজটি কেন তৈরি করা হয়েছে
This page is no longer just a recovery note. It is now the operating guide for fresh setup, remote PowerShell use, primary Hosting + Functions deployment, and secondary Firebase replacement.এই পেজটি এখন আর শুধু recovery note নয়। এটি নতুন সেটআপ, remote PowerShell ব্যবহার, primary Hosting + Functions deployment, এবং secondary Firebase replacement-এর operating guide।
The goal is simple: any team member should be able to open PowerShell, understand what to type next, know what each command does, and understand which file or project each step changes.লক্ষ্য খুবই সহজ: দলের যেকোনো সদস্য PowerShell খুলে পরের command বুঝতে পারবে, command-এর কাজ জানতে পারবে, এবং কোন step কোন file বা project বদলায় সেটা বুঝতে পারবে।
Two-Project Modelদুই-প্রজেক্ট মডেল
Public pages, same-origin API routes, and deploy actions stay here. This project remains the long-term stable deployment anchor.public page, same-origin API route, এবং deploy action এখানে থাকবে। এই project-টাই দীর্ঘমেয়াদি স্থায়ী deployment anchor হিসেবে থাকবে।
User sessions and data systems live here. Public web config comes from public/js/xnet-secondary-config.js, while the private server credential lives only in Secret Manager.user session আর data system এখানে থাকবে। public web config আসে public/js/xnet-secondary-config.js থেকে, আর private server credential থাকবে শুধু Secret Manager-এ।
If the secondary Firebase project breaks, the static site still loads. But login-based tools, database-backed pages, and FCM-backed notification flows stop until the shared frontend config and private secret are updated.secondary Firebase project নষ্ট হয়ে গেলে static site তবুও লোড হবে। কিন্তু login-ভিত্তিক tool, database-backed page, এবং FCM notification flow বন্ধ হয়ে যাবে, যতক্ষণ না shared frontend config আর private secret update করা হয়।
Fresh Machine Bootstrapনতুন কম্পিউটার বুটস্ট্র্যাপ
Prerequisites Before The First Firebase Commandপ্রথম Firebase command-এর আগে যা লাগবে
On a fresh Windows machine, install Node.js LTS first. After that, PowerShell should recognize node and npm immediately.একদম নতুন Windows machine-এ আগে Node.js LTS install করতে হবে। তারপর PowerShell-এ node এবং npm command কাজ করছে কিনা পরীক্ষা করতে হবে।
node -v
npm -v
Run this first. If either command fails, stop and install Node.js LTS before doing anything else.এটাই আগে চালাও। যদি কোনো command fail করে, তাহলে আগে Node.js LTS install করো, তারপর বাকি কাজ শুরু করো।
npm install -g firebase-tools
firebase --version
This installs the global Firebase CLI and immediately verifies that PowerShell can run it.এতে global Firebase CLI install হবে, আর সঙ্গে সঙ্গে verify হবে যে PowerShell থেকে সেটা চালানো যাচ্ছে।
Recommended CLI Update Patternপ্রস্তাবিত CLI update pattern
npm install -g firebase-tools
firebase --version
Keep the CLI updated. New Hosting, Functions, and secrets features normally reach the newer CLI first.CLI আপডেট রাখা ভালো। নতুন Hosting, Functions, আর secrets feature সাধারণত নতুন CLI version-এই আগে আসে।
Remote Or Headless Loginরিমোট বা হেডলেস লগইন
firebase login
firebase projects:list
Use this on a normal machine with browser access. Always run firebase projects:list next to confirm the visible account and projects.browser access থাকলে এটা ব্যবহার করো। এরপর অবশ্যই firebase projects:list চালিয়ে account আর visible project check করো।
firebase login --no-localhost
firebase projects:list
Use this when the machine is remote, restricted, or cannot open the normal localhost browser callback flow.machine remote হলে, restriction থাকলে, অথবা localhost browser callback flow খুলতে না পারলে এই command ব্যবহার করো।
Before any create, use, secret, or deploy command, verify which Firebase account is currently active.create, use, secret, বা deploy command চালানোর আগে active Firebase account কোনটি সেটা verify করে নাও।
Project And Workspace Setupপ্রজেক্ট ও ওয়ার্কস্পেস সেটআপ
Create Or Attach The Primary Firebase Projectপ্রাইমারি Firebase project তৈরি বা attach করা
firebase projects:create YOUR_PRIMARY_PROJECT_ID
firebase use YOUR_PRIMARY_PROJECT_ID
Creates a new primary Firebase project and selects it locally for the current repo.এতে নতুন primary Firebase project তৈরি হবে এবং current repo-এর জন্য locally select হবে।
firebase projects:addfirebase YOUR_EXISTING_GCP_PROJECT_ID
firebase use YOUR_EXISTING_GCP_PROJECT_ID
Use this when the Google Cloud project already exists but Firebase still needs to be enabled on it.Google Cloud project আগে থেকেই থাকলে কিন্তু Firebase enable করা না থাকলে এই flow ব্যবহার করো।
Create The Secondary Data Project If Neededপ্রয়োজন হলে secondary data project তৈরি
firebase projects:create YOUR_SECONDARY_PROJECT_ID
firebase use YOUR_SECONDARY_PROJECT_ID
Use this only when the data plane must stay separate from the primary Hosting and Functions project.data plane-কে primary Hosting এবং Functions project থেকে আলাদা রাখতে হলে তবেই এই step দরকার হবে।
Initialize A Fresh Local Workspaceনতুন local workspace initialize করা
New-Item -ItemType Directory YOUR_WORKSPACE_NAME
Set-Location YOUR_WORKSPACE_NAME
firebase use YOUR_PRIMARY_PROJECT_ID
firebase init hosting
firebase init functions
Creates a clean folder, enters it, selects the primary project, and initializes Hosting plus Functions for the repo.এতে নতুন folder তৈরি হবে, সেই folder-এ ঢুকবে, primary project select হবে, এবং repo-এর জন্য Hosting ও Functions initialize হবে।
firebase use YOUR_SECONDARY_PROJECT_ID
firebase init firestore
Creates Firestore rules and index files locally for the secondary project.secondary project-এর জন্য local Firestore rules এবং index file তৈরি করবে।
firebase use YOUR_SECONDARY_PROJECT_ID
firebase init database
Creates Realtime Database rules files locally for the secondary project.secondary project-এর জন্য local Realtime Database rules file তৈরি করবে।
Secret, Deploy, And Verificationসিক্রেট, ডিপ্লয়, ও ভেরিফিকেশন
Set The Secondary Service Account Secretsecondary service account secret সেট করা
The private JSON file must never go inside public/. It is used once as input for Secret Manager, then the function reads it server-side only.private JSON file কখনও public/-এর মধ্যে রাখা যাবে না। এটাকে একবার Secret Manager-এ input হিসেবে দেওয়া হবে, তারপর function শুধু server-side থেকে এটাকে পড়বে।
firebase use primary
firebase functions:secrets:set SECONDARY_FIREBASE_SERVICE_ACCOUNT_JSON --data-file "service-account-file.json"
This uploads the local service account JSON into Secret Manager inside the primary project.এই command local service account JSON-কে primary project-এর Secret Manager-এ upload করবে।
Deploy The Primary Site And Functionprimary site এবং function deploy করা
firebase use primary
firebase deploy --only functions:sendAdminNotification,hosting
This is the main production deploy flow for the current Xnet Hub notification sender architecture.বর্তমান Xnet Hub notification sender architecture-এর জন্য এটাই মূল production deploy flow।
firebase deploy --only hosting
firebase deploy --only functions
firebase deploy --only functions:sendAdminNotification
Use these when only public files changed, only backend functions changed, or only one function changed.শুধু public file, শুধু backend function, অথবা শুধু একটিমাত্র function বদলালে এই variant-গুলো ব্যবহার করো।
Verification Flow After Deploydeploy-এর পর verification flow
- 01Open the public site and confirm the new visual version is live.public site খুলে নতুন visual version live হয়েছে কিনা confirm করো।
- 02Check login and profile pages if the secondary config changed.secondary config বদলালে login ও profile page check করো।
- 03Open admin tools such as admin-panel.html and users.html.admin tools খুলে admin-panel.html এবং users.html verify করো।
- 04Test notification send from notification-sender.html.notification-sender.html থেকে notification send test করো।
- 05Inspect source and confirm the private key is not present in any public output.source inspect করে নিশ্চিত হও যে private key public output-এ নেই।
Xnet Hub Exact RunbookXnet Hub এক্স্যাক্ট রানবুক
This section removes the generic placeholders and keeps only the command order that matters for the current Xnet Hub production setup.এই section-এ generic placeholder বাদ দিয়ে শুধু Xnet Hub-এর বর্তমান production setup-এর জন্য প্রয়োজনীয় command order রাখা হয়েছে।
First-Time Or Fresh-Machine Orderপ্রথমবার বা নতুন কম্পিউটারের command order
node -v
npm -v
npm install -g firebase-tools
firebase --version
firebase login
firebase projects:list
firebase use primary
This is the minimum first-time sequence for a normal machine: verify Node.js, install Firebase CLI, log in, confirm project visibility, and select the primary alias.সাধারণ machine-এর জন্য এটাই minimum first-time sequence: Node.js verify, Firebase CLI install, login, visible project check, এবং primary alias select।
node -v
npm -v
npm install -g firebase-tools
firebase --version
firebase login --no-localhost
firebase projects:list
firebase use primary
Use this when the machine is remote or cannot open the normal localhost browser callback flow.machine remote হলে বা সাধারণ localhost browser callback flow খুলতে না পারলে এই variant ব্যবহার করো।
Day-To-Day Commands For This Projectএই project-এর দৈনন্দিন command
firebase use primary
firebase deploy --only functions:sendAdminNotification,hosting
Use this when public pages or the notification function changed and both should go live together.public page বা notification function বদলালে এবং দুটো একসাথে live দিতে চাইলে এই command ব্যবহার করো।
firebase use primary
firebase functions:secrets:set SECONDARY_FIREBASE_SERVICE_ACCOUNT_JSON --data-file "service-account-file.json"
firebase deploy --only functions:sendAdminNotification,hosting
Use this exact order when the secondary service account has been rotated, replaced, or moved to a new Firebase project.secondary service account rotate, replace, বা নতুন Firebase project-এ সরানো হলে এই exact order ব্যবহার করো।
firebase use primary
firebase deploy --only hosting
Use this when only HTML, CSS, images, or public JavaScript changed.শুধু HTML, CSS, image, বা public JavaScript বদলালে এটা ব্যবহার করো।
firebase use primary
firebase deploy --only functions:sendAdminNotification
Use this when only the notification backend changed and Hosting did not.শুধু notification backend বদলালে, কিন্তু Hosting না বদলালে, এই command ব্যবহার করো।
firebase use primary
firebase functions:log
Use this when notification send fails and you need server-side error output.notification send fail করলে server-side error output দেখতে এটা ব্যবহার করো।
firebase use primary
firebase hosting:channel:deploy preview
Use this when the team wants to review a temporary public version before production release.production release-এর আগে team যদি temporary public version review করতে চায়, তাহলে এই command ব্যবহার করো।
The shortest Xnet Hub production checklist is this: firebase use primary, then firebase functions:secrets:set SECONDARY_FIREBASE_SERVICE_ACCOUNT_JSON --data-file "service-account-file.json" only when the key changed, then firebase deploy --only functions:sendAdminNotification,hosting.সবচেয়ে ছোট Xnet Hub production checklist হলো: আগে firebase use primary, তারপর key বদলালে firebase functions:secrets:set SECONDARY_FIREBASE_SERVICE_ACCOUNT_JSON --data-file "service-account-file.json", তারপর firebase deploy --only functions:sendAdminNotification,hosting।
Firebase CLI Command ReferenceFirebase CLI কমান্ড রেফারেন্স
Core PowerShell Commands And Their Jobsমূল PowerShell command এবং তাদের কাজ
| Commandকমান্ড | What It Doesকাজ | When To Use Itকখন ব্যবহার করবেন |
|---|---|---|
| firebase login | Authenticates the CLI using the normal browser flow.সাধারণ browser flow ব্যবহার করে CLI authenticate করে। | Use on a local machine with browser access.browser access থাকা local machine-এ ব্যবহার করুন। |
| firebase login --no-localhost | Authenticates without the local redirect server.local redirect server ছাড়া authenticate করে। | Use on a remote or restricted machine.remote বা restricted machine-এ ব্যবহার করুন। |
| firebase projects:list | Lists Firebase projects visible to the current account.current account থেকে visible Firebase project দেখায়। | Run before create, use, secret, or deploy commands.create, use, secret, বা deploy-এর আগে চালান। |
| firebase projects:create YOUR_PROJECT_ID | Creates a new Firebase project.নতুন Firebase project তৈরি করে। | Use when bootstrapping a new primary or secondary project.নতুন primary বা secondary project শুরু করতে ব্যবহার করুন। |
| firebase projects:addfirebase YOUR_GCP_PROJECT_ID | Adds Firebase to an existing Google Cloud project.বিদ্যমান Google Cloud project-এ Firebase যোগ করে। | Use when Cloud already exists before Firebase.Cloud আগে থেকে থাকলে এবং পরে Firebase যোগ করতে হলে। |
| firebase use YOUR_PROJECT_ID | Selects the active Firebase project in the local repo.local repo-এ active Firebase project নির্বাচন করে। | Run before init, secret, or deploy commands.init, secret, বা deploy-এর আগে চালান। |
| firebase init hosting | Initializes Firebase Hosting files and settings.Firebase Hosting file ও settings initialize করে। | Use for a fresh web hosting setup.নতুন web hosting setup-এ ব্যবহার করুন। |
| firebase init functions | Initializes the Cloud Functions codebase.Cloud Functions codebase initialize করে। | Use for a fresh backend setup.নতুন backend setup-এ ব্যবহার করুন। |
| firebase init firestore | Creates Firestore rules and index files.Firestore rules এবং index file তৈরি করে। | Use for local Firestore config management.local Firestore config management-এর জন্য ব্যবহার করুন। |
| firebase init database | Creates RTDB rules files.RTDB rules file তৈরি করে। | Use for local Realtime Database config management.local Realtime Database config management-এর জন্য ব্যবহার করুন। |
| firebase functions:secrets:set SECRET_NAME --data-file "file.json" | Stores a file-backed secret in Secret Manager.file-backed secret-কে Secret Manager-এ সংরক্ষণ করে। | Use for private server credential setup.private server credential setup-এর জন্য ব্যবহার করুন। |
| firebase deploy --only hosting | Deploys only Hosting content.শুধু Hosting content deploy করে। | Use when only HTML, CSS, or public JS changed.শুধু HTML, CSS, বা public JS বদলালে ব্যবহার করুন। |
| firebase deploy --only functions | Deploys all functions in the codebase.codebase-এর সব function deploy করে। | Use for backend-only releases.backend-only release-এ ব্যবহার করুন। |
| firebase deploy --only functions:NAME | Deploys one specific function.একটি নির্দিষ্ট function deploy করে। | Use for a smaller and safer function release.ছোট ও নিরাপদ function release-এর জন্য ব্যবহার করুন। |
| firebase deploy --only functions:sendAdminNotification,hosting | Deploys the current production notification function and the public site together.বর্তমান production notification function এবং public site একসাথে deploy করে। | Use as the main Xnet Hub release path.Xnet Hub-এর main release path হিসেবে ব্যবহার করুন। |
Preview, Logs, And Maintenanceপ্রিভিউ, লগস, ও মেইনটেন্যান্স
firebase emulators:start
Runs the Local Emulator Suite for Hosting and Functions before production deploy.production deploy-এর আগে Hosting ও Functions-এর Local Emulator Suite চালায়।
firebase hosting:channel:deploy preview
Creates a preview Hosting channel so the team can review a public page before production release.production release-এর আগে team যেন public page review করতে পারে, তার জন্য preview Hosting channel তৈরি করে।
firebase functions:log
Reads deployed function logs when auth, secret, or FCM flow behaves unexpectedly.auth, secret, বা FCM flow অস্বাভাবিক আচরণ করলে deployed function log পড়তে এটা ব্যবহার করো।
firebase functions:secrets:get SECONDARY_FIREBASE_SERVICE_ACCOUNT_JSON
firebase functions:secrets:prune
Checks secret metadata and removes unused secret versions or unreferenced secrets.secret metadata check করে এবং unused secret version বা unreferenced secret পরিষ্কার করে।
Recovery And Update Notesরিকভারি ও আপডেট নোটস
Replace the local file with the new secondary project service account, then run the secret setup command again.নতুন secondary project-এর service account দিয়ে local file replace করো, তারপর secret setup command আবার চালাও।
Update projectId, apiKey, authDomain, databaseURL, and databaseHost.projectId, apiKey, authDomain, databaseURL, এবং databaseHost update করো।
firebase use primary
firebase functions:secrets:set SECONDARY_FIREBASE_SERVICE_ACCOUNT_JSON --data-file "service-account-file.json"
firebase deploy --only functions:sendAdminNotification,hosting
This remains the main recovery sequence after updating the local service account file and the shared frontend config.local service account file আর shared frontend config update করার পরে এটিই প্রধান recovery sequence হিসেবে থাকবে।
This page now switches entirely between English and Bangla and uses a dedicated Bengali font in Bangla mode. No side panel, no drawer, and no mixed-language shortcut layout remains.এখন এই page পুরোপুরি English ও Bangla-র মধ্যে switch হয় এবং Bangla mode-এ dedicated Bengali font ব্যবহার করে। কোনো side panel, drawer, বা mixed-language shortcut layout আর নেই।