Full-Stack Marketplace Suite

1. Package Overview & Folder Architecture

Thank you for purchasing SuperJobs24! Your download package contains all 4 synchronized applications plus Firebase security rules, composite indexes, and a single-command build & deploy runner:

Directory / File Technology Purpose
superjobs24-flutter/ Flutter 3.x + Dart 3 + flutter_stripe Customer & Provider native mobile app for Android & iOS
superjobs24-nextjs/ Next.js 16 + React 19 + Tailwind CSS Customer & Provider responsive web marketplace
superjobs-admin/ Next.js 16 + React 19 + Tailwind CSS SuperAdmin & Moderator control center + Support Helpdesk
firebase-functions/ Cloud Functions v2 (Node.js 22, TS) 31 serverless functions for Stripe Escrow, PINs, Ratings, Coupons, Seed & FCM
firestore.rules, firestore.indexes.json & storage.rules Firebase Rules & Composite Indexes Role-based access control, query indexes & cloud storage security
package.json & scripts/deploy-all.mjs Node.js Deploy Orchestrator Single-command typecheck, lint, static Next.js build & full Firebase Hosting + Rules + Functions deploy

2. Prerequisites

3. Branding, Colors & White-Label Customization (All in One Place!)

SuperJobs24 is engineered so you can rebrand the entire platform in minutes using two complementary methods:

Method A: Zero-Code Live Cloud Branding (Recommended)

Once your Admin Console is running, open Platform Settings → 1. General & Branding (/settings):

Method B: Single-File Static Code Defaults (1 File Per Workspace)

To permanently bake your brand defaults into the source code before compiling release builds, edit the single brand_config file in each workspace:

Workspace Single Branding & Config File Controls
Flutter App superjobs24-flutter/lib/config/brand_config.dart BrandConfig: App Name, Monogram Badge, Bundle ID, Primary/Accent/Dark Colors, Currency, Contact URLs, Default Map Lat/Lng & Google Maps fallback key
Web Marketplace superjobs24-nextjs/src/config/brand.config.ts BRAND_CONFIG: App Name, Short Name, Monogram Badge, Hex Palette, SEO Meta, Currency, Support Contact & Map Defaults
Admin Console superjobs-admin/src/config/brand.config.ts ADMIN_BRAND_CONFIG: Console Name, Badge, Primary/Accent Hex Colors, Currency & Marketplace URL
Cloud Functions firebase-functions/src/config/brand.config.ts BACKEND_BRAND_CONFIG: Default App Name, Email Brand Color, Currency, Commissions & Production URLs

Changing Mobile Package / Bundle ID, App Icon & Native Splash

  1. Replace superjobs24-flutter/assets/logo/logo.png (1024x1024 PNG) with your brand icon, and replace superjobs24-nextjs/public/logo.svg & superjobs-admin/public/logo.svg for web.
  2. To rename the Android/iOS package ID across the Flutter project:
    cd superjobs24-flutter
    dart pub global activate change_app_package_name
    dart pub global run change_app_package_name:main com.yourcompany.yourapp
  3. Regenerate Android & iOS launcher icons and native splash screens:
    flutter pub get
    dart run flutter_launcher_icons
    dart run flutter_native_splash:create

4. Step 1 — Create Firebase Project & Environment Files

  1. Open the Firebase Console, click Add project, and upgrade billing to the Blaze (Pay-as-you-go) plan (required for Cloud Functions v2 and Stripe webhooks).
  2. Under Build → Authentication → Sign-in method, enable Email/Password and Google.
  3. Under Build → Firestore Database, click Create database in Production mode.
  4. Under Build → Storage, click Get started in Production mode.
  5. Under Build → Hosting, click Get started once if Hosting has not yet been activated on your project (classic Firebase Hosting requires zero GitHub linking and zero App Hosting setup).
  6. Under Project Settings → General → Your apps, register a Web App and copy your firebaseConfig values (apiKey, authDomain, projectId, storageBucket, messagingSenderId, appId).
  7. Link the root repository to your Firebase project:
    npx firebase-tools@latest login
    npx firebase-tools@latest use --add
  8. Create your environment files from the templates inside all 3 backend/web workspaces before building or deploying:
    # 1) Cloud Functions v2
    cp firebase-functions/.env.example firebase-functions/.env
    
    # 2) Customer & Provider Next.js Web Marketplace
    cp superjobs24-nextjs/.env.example superjobs24-nextjs/.env.local
    
    # 3) SuperAdmin & Moderator Next.js Console
    cp superjobs-admin/.env.example superjobs-admin/.env.local
    Fill in your NEXT_PUBLIC_FIREBASE_* keys inside both superjobs24-nextjs/.env.local and superjobs-admin/.env.local, and ensure NEXT_PUBLIC_DEMO_MODE=false.
Zero GitHub / Zero App Hosting Required: Both superjobs24-nextjs and superjobs-admin export directly to standard Firebase Hosting static CDN sites (https://<your-site>.web.app), with /api/getLatLng and /api/getFormattedAddress handled automatically by Cloud Functions v2 rewrites.
Build → Verify → Deploy Together

5. Step 2 — 1-Command Build, Check & Full Firebase Deploy (Custom Site Names)

The root workspace links all 6 Firebase deployment targets — superjobs24-nextjs (Hosting target web), superjobs-admin (Hosting target admin), firestore:rules, firestore:indexes, storage, and functions — into a single orchestrated command that builds and checks everything locally first before publishing anything to Firebase.

What the Unified Deploy Command Checks Before Deploying

  1. Validates firebase.json, .firebaserc, firestore.rules, firestore.indexes.json, and storage.rules.
  2. Auto-installs node_modules if missing across firebase-functions, superjobs-admin, and superjobs24-nextjs.
  3. Runs TypeScript check & build in firebase-functions/ (tsc --noEmit + tsc).
  4. Runs next typegen, tsc --noEmit, ESLint & static Next.js export (out/) in superjobs-admin/ (automatically baking your live Customer site URL into NEXT_PUBLIC_WEB_APP_URL).
  5. Runs next typegen, tsc --noEmit, ESLint & static Next.js export (out/) in superjobs24-nextjs/.
  6. Aborts cleanly before touching Firebase if any typecheck, lint, or production export fails.
  7. Creates any missing Firebase Hosting sites for your custom names, binds them to the web and admin Hosting targets in .firebaserc, and deploys everything together via firebase deploy --only "hosting,firestore:rules,firestore:indexes,storage,functions".

Deploy Commands (Choose Custom Names for Both Sites)

# Option A: Interactive mode — prompts for Project ID, Customer Site Name & Admin Site Name
npm run deploy:custom

# Option B: Pass custom site names directly via CLI flags
npm run deploy -- --web-site mybrand-marketplace --admin-site mybrand-admin

# Option C: Deploy using the currently saved site names in .firebaserc
# (Default names: "<project-id>.web.app" for Customer Web and "<project-id>-admin.web.app" for Admin)
npm run deploy

# Option D: Run all local typechecks, lints & static builds ONLY (no Firebase deployment)
npm run check

# Option E: Run local builds & checks + Firebase dry-run validation
npm run deploy:dry-run
Flag / Script Description
--web-site <name> Custom Firebase Hosting site ID for superjobs24-nextjs → https://<name>.web.app
--admin-site <name> Custom Firebase Hosting site ID for superjobs-admin → https://<name>.web.app
--project <projectId> Override the target Firebase Project ID from .firebaserc
--install Force fresh npm install across all 3 Node workspaces before building
Site Naming Rules & Post-Deploy Authorized Domains: Firebase Hosting site IDs must be globally unique across Firebase and 4–30 characters using lowercase letters (a-z), digits (0-9), and hyphens (-). After deployment finishes, open Firebase Console → Authentication → Settings → Authorized domains and verify both <web-site>.web.app and <admin-site>.web.app (plus any custom domains) are listed, and update APP_BASE_URL / ADMIN_BASE_URL in firebase-functions/.env so Stripe redirects land on your production URLs.

Deploying to Vercel, Netlify, or Your Own Node.js VPS Instead of Firebase Hosting

Dual-Mode Build Flag (FIREBASE_STATIC_EXPORT): Both Next.js apps default to static export (FIREBASE_STATIC_EXPORT=true) for zero-config Firebase Hosting deploys. If you prefer deploying superjobs24-nextjs or superjobs-admin as a standard Node.js / Next.js server app on Vercel, Netlify, Railway, Render, or a VPS (npm run build && npm run start), simply add:
FIREBASE_STATIC_EXPORT=false
to your hosting provider's Environment Variables (or .env.local). Geocoding and address autocomplete automatically route through your deployed Firebase Cloud Functions (getLatLngApi & getFormattedAddressApi) with OpenStreetMap Nominatim fallback. Still deploy Firebase Rules, Indexes, Storage Rules & Cloud Functions once with npx firebase-tools@latest deploy --only "firestore:rules,firestore:indexes,storage,functions".

Running Locally During Development

To run both Next.js apps locally against your live Firebase backend during development:

cd superjobs24-nextjs && npm run dev   # http://localhost:3000
cd superjobs-admin   && npm run dev   # http://localhost:3001
Google Workspace / New GCP Org Note: If your Google Cloud account belongs to an organization created after July 2024 and Cloud Build reports a missing build permission when deploying Cloud Functions, open Google Cloud Console → IAM, locate <PROJECT_NUMBER>-compute@developer.gserviceaccount.com, grant it the Cloud Build Service Account (roles/cloudbuild.builds.builder) role, and re-run npm run deploy.
Zero-Admin Lock & RBAC Security

6. Step 3 — Initial Admin Dashboard Access Setup

On a fresh Firebase project, no Admin user exists yet. SuperJobs24 includes a cryptographically enforced First-Run Admin Setup gate inside Cloud Functions so only the very first person to bootstrap a clean database can claim owner admin privileges.

How Initial Admin Access Works (Step-by-Step)

  1. Open your deployed Admin Dashboard URL (e.g. https://<your-admin-site>.web.app/login) or local http://localhost:3001/login.
  2. On mount, the login screen calls the checkAdminBootstrapStatus Cloud Function to check whether any user with role == "admin" exists in Firestore users/.
  3. When zero admins exist, you will see a green banner titled First-Run Admin Setup Available and a toggle button labeled First-Run Admin Setup (Create First Admin). Click that button to switch the form into setup mode (or use Continue with Google (Staff Account) on first run).
  4. Enter your Admin Display Name, Staff Email, and Password (minimum 6 characters), then click Create Admin & Bootstrap.
  5. Behind the scenes, the app creates your Firebase Auth account and invokes the bootstrapPlatform Cloud Function, which automatically:
    • Verifies zero existing admins exist (returns permission-denied if an admin already exists).
    • Sets Firebase Auth custom claim { role: "admin" } via Admin SDK and writes your profile in users/{uid} with role: "admin", accountStatus: "active", and kycStatus: "verified".
    • Initializes settings/public (setting adminInitialized: true) and settings/secrets, plus seeds your clean production baseline (8 categories, 3 subscription plans, and 2 coupons).
    • Refreshes your Firebase ID token so Firestore & Storage Rules immediately recognize your Admin role, logs you into /dashboard, and permanently locks First-Run Admin Setup.
Important Note About the "1-Click Test Login" Buttons: On a brand-new empty Firebase database, the quick-login cards (admin@superjobs24.com / moderator@superjobs24.com) on /login will return an invalid-credential error until the starter demo accounts are seeded in Step 4. Always use First-Run Admin Setup (Create First Admin) first on a fresh database!

Adding More Admins or Moderators Later

Production Baseline + Demo Catalog

7. Step 4 — Initial Seeding to Firestore

SuperJobs24 separates clean production bootstrapping from optional sample/demo marketplace seeding so you never accidentally launch to real customers with fake bookings or test passwords.

Stage 1: Clean Production Baseline (Automatic During Step 3)

Completing First-Run Admin Setup automatically seeds only the essential marketplace skeleton into Firestore (with zero fake bookings or test users):

Firestore Collection / Doc Seeded Documents Contents
settings/public & settings/secrets 2 docs Branding defaults from BACKEND_BRAND_CONFIG, adminInitialized: true, commission rules, banners & secrets placeholders
categories/ 8 docs cat-cleaning, cat-repairing, cat-painting, cat-laundry, cat-appliance, cat-plumbing, cat-shifting, cat-more
subscriptionPlans/ 3 docs plan-starter (Free, 15% fee), plan-pro-growth ($29/mo, 8% fee), plan-elite-agency ($79/mo, 3% fee)
coupons/ 2 docs PROMO30 (30% off) & WELCOME15 ($15 off first booking)

Stage 2: Optional 1-Click Starter Marketplace & Sample Listings Seed

Want realistic services, reviews, sample bookings, and test accounts immediately for staging or previewing all 4 apps? Once signed into the Admin Console:

  1. Open Platform Settings (/settings) and click tab 7. Buyer Setup & Tools.
  2. Under Config Backup & System Tools, choose one of the two server-side Cloud Function seed actions:
    • Re-Seed Starter Catalog (Safe / Non-Destructive): Keeps your personal owner Admin account intact and runs bootstrapPlatform + seedMarketplaceData (purgeExtraUsers: false) to populate:
      • 8 taxonomy services under services/ and categories/{catId}/services/
      • 8 approved sample listings under userServices/ + verified reviews subcollections
      • Provider verification record (verification/user-provider) & active Pro Growth subscription (subscriptions/sub_user_provider)
      • 4 sample bookings (SJ24-BK100201–SJ24-BK100204) covering completed, upcoming (<1km & >1km), and disputed states with 4-digit startPins
      • 1 live customer–provider chat thread (chats/chat-customer-provider) with messages
      • The 4 canonical role test accounts below (created in both Firebase Auth & Firestore users/)
    • Reset to 4 Canonical Role Test Accounts (Danger Zone → purgeExtraUsers: true): Permanently deletes all other Firebase Auth accounts and clears users, verification, subscriptions, bookings, userServices, and chats before cleanly recreating only the 4 canonical role accounts and starter catalog. Ideal for resetting a public demo environment.

Seeded Canonical Role Accounts (QA & Demo Reference)

Role Email Password Where Used
admin admin@superjobs24.com Admin@123456 Admin Console (full system control & settings)
moderator moderator@superjobs24.com Mod@123456 Admin Console (KYC, disputes, support tickets, listings)
provider provider@superjobs24.com Pro@123456 Web Marketplace & Flutter App (8 seeded services)
customer customer@superjobs24.com Customer@123456 Web Marketplace & Flutter App (4 sample bookings)
Production Security Checklist: Before launching to real customers, delete the test accounts in Users & KYC (or rotate their passwords), remove or deactivate sample demo listings/bookings you don't serve, and verify only your real staff members hold admin / moderator roles.

8. Step 5 — Configure Flutter iOS & Android Mobile App

  1. Generate Firebase platform bindings (lib/firebase_options.dart, android/app/google-services.json, and ios/Runner/GoogleService-Info.plist) automatically with FlutterFire CLI:
    cd superjobs24-flutter
    dart pub global activate flutterfire_cli
    flutterfire configure --project=your-project-id
  2. Android Google Sign-In SHA Fingerprints: Run cd android && ./gradlew signingReport, copy your debug and release SHA-1 and SHA-256 fingerprints, and add them in Firebase Console → Project Settings → Your Android App, then re-download google-services.json.
  3. Native Stripe Android Requirements (Already Pre-Configured!): MainActivity.kt already extends FlutterFragmentActivity and all 4 Android styles.xml files (values, values-night, values-v31, values-night-v31) use Theme.MaterialComponents as required by flutter_stripe.
  4. Run on an emulator/device or build store binaries:
    flutter pub get
    flutter run
    flutter build appbundle --release
    flutter build ipa --release

9. Step 6 — Link Live Stripe Escrow, Subscriptions & Connect

  1. Open your Stripe Dashboard → Developers → API Keys and copy your Publishable Key (pk_test_... or pk_live_...) and Secret Key (sk_test_... or sk_live_...).
  2. Under Stripe Dashboard → Developers → Webhooks, click Add endpoint pointing to your deployed stripeWebhook Cloud Function URL and select these events:
    • payment_intent.succeeded & payment_intent.payment_failed
    • charge.refunded
    • checkout.session.completed
    • customer.subscription.created, customer.subscription.updated, customer.subscription.deleted
    • invoice.paid & invoice.payment_failed
    • (Optional Connect endpoint): account.updated
    Copy the Signing Secret (whsec_...).
  3. Under Stripe Dashboard → Settings → Billing → Customer portal, click Activate link / Save once so Stripe initializes your hosted Billing Portal configuration.
  4. Open SuperAdmin Console → Platform Settings → 3. Stripe & Payments, paste your Publishable Key, Secret Key, and Webhook Secret, and click Save Changes!
  5. Open SuperAdmin Console → Subscriptions & Plans and edit/save each plan & coupon once — Cloud Functions automatically create matching Stripe Products, Monthly/Yearly Prices, and Promotion Codes in your Stripe account!

10. 4-Role Architecture & Test Accounts

SuperJobs24 enforces 4 distinct roles (customer, provider, moderator, admin):

11. Support Tickets & Pronto-Style Live Bookings

12. Troubleshooting & FAQ