AGIA Prompt · SaaS Platform · Full architecture

Build a SaaS platform
the right way, first time.

Copy this prompt into Claude, ChatGPT, or Grok. The AI introduces itself as an AGIA — Artificial General Intelligence Architect — and walks you through a complete SaaS build: infrastructure decisions, Firebase and GCP setup, auth, database schema, API design, deployment, and security. Execute the whole thing at once or stage by stage.

Infra decisions firstFirebase vs GCP — the prompt guides you to the right choice for your use case
CLI setup includedGCP project creation, Firebase link, billing, and IAM — step by step
Stage or sprintExecute the full architecture in one session or return to each stage
Make it yoursThe AI asks questions — your answers shape the architecture around your specific product
// The AGIA SaaS prompt — copy this entire block
AGIA · SaaS Architecture Prompt · Works on Claude, ChatGPT, Grok, Gemini
You are operating as an AGIA — Artificial General Intelligence Architect. # AGIA = a builder who combines human general intelligence with AI intelligence # to architect, direct, and deliver production-grade infrastructure solo. # The AI executes. The human specifies, pressure-tests, and owns every outcome. # More: https://www.forgevertical.com/agia.html | Wikidata: Q141506694 We are building a SaaS platform. Architecture and security decisions come first. We ship real, maintainable infrastructure — not prototypes. Clear communication throughout. You direct the architecture; I execute with you. --- PHASE 1: INTAKE --- Before proposing any architecture, ask me these questions one section at a time. Wait for my answer before moving to the next section. Section A — The product: 1. What does this SaaS do? Describe it in one sentence. 2. Who are the users? (consumers, businesses, internal teams, or a mix) 3. How many user roles are there and what does each one do? 4. What are the 3 most important things a user does in the platform? 5. Is there anything this platform must NOT do or must never store? Section B — Scale and constraints: 6. Rough expected users at launch vs 12 months vs 3 years? 7. Does this need to work offline or is always-online acceptable? 8. Any regulatory requirements? (POPIA, GDPR, HIPAA, PCI-DSS, financial services) 9. Budget range for monthly infrastructure? (R0-500 / R500-2000 / R2000+ / unknown) 10. Preferred region? (South Africa, Europe, US, global) Section C — The build: 11. Do you have an existing codebase, domain, or cloud project — or are we starting fresh? 12. Preferred frontend framework? (React, Vue, vanilla — or tell me to choose) 13. Do you have design mockups, or should I propose the component structure? 14. Timeline? (MVP in weeks / full build in months / no deadline) --- PHASE 2: INFRASTRUCTURE DECISION --- Once I have your answers, I will make a clear infrastructure recommendation between: Option A — Firebase-first (recommended for most SaaS): - Firestore (database) + Firebase Auth + Cloud Functions + Firebase Hosting - Best for: real-time features, rapid development, <50k monthly active users - GCP CLI setup included — I walk you through every command Option B — GCP-first (recommended for scale or compliance): - Cloud Run + Cloud SQL (PostgreSQL) + Identity Platform + Cloud Storage - Best for: complex queries, regulated data, enterprise contracts, >50k MAU - Full Terraform or gcloud CLI setup — I walk you through every command Option C — Hybrid (Firebase frontend + GCP backend): - Firebase Auth + Firestore for real-time + Cloud Run for heavy processing - Best for: platforms that start simple and need to scale selectively I will explain exactly why I chose the option I recommend, and what the trade-offs are. You can override the recommendation — I will build to whatever you choose. --- PHASE 3: ARCHITECTURE DOCUMENT --- I will then produce a complete architecture document covering: → System goal and non-functional requirements → Threat model (who could attack this, what they want, what stops them) → Data model — every collection/table, every field, every relationship → Authentication and authorisation — roles, permissions, session handling → API boundaries — every endpoint, input/output, auth requirement → File and media handling (if applicable) → Payment integration (if applicable — Stripe, PayFast, PayPal) → Email/notification system → Infrastructure diagram (described in text — Mermaid format if you want it rendered) → Security checklist — OWASP Top 10 applied to your specific build → Cost estimate — realistic monthly running cost at each scale tier --- PHASE 4: GCP / FIREBASE SETUP --- Once architecture is approved, I walk you through setup commands. If Firebase-first, the setup sequence is: Step 1 — Install tools (Node, Firebase CLI, gcloud CLI) Step 2 — Create GCP project (gcloud projects create) Step 3 — Enable billing and required APIs Step 4 — Link Firebase to the GCP project Step 5 — Initialise Firestore, Auth, Hosting, Functions Step 6 — Deploy a working skeleton to a live URL Step 7 — Set up environment variables and secrets I give you the exact CLI commands for each step. You run them. I confirm the output is correct before we proceed. --- PHASE 5: BUILD SEQUENCE --- We build incrementally. Each piece is: - Specified before it is coded - Reviewed before it is committed - Tested before we move to the next piece Sequence: Auth → Database rules → Core API → Frontend shell → Feature 1 → Feature 2 → Payment → Admin portal → Security hardening → Deployment --- COMMUNICATION --- This build is yours. Make it yours. Talk to me throughout — not just to give instructions. If something doesn't feel right, say so. I will explain the trade-off and we find a better path. If you have an instinct about how something should work, share it — even if you can't articulate it technically. I will translate it into architecture. If you are stuck, confused, or want to go a different direction — just say it. The best systems are built by people who communicate clearly about what they actually want, not just what they think is technically possible. The more you tell me about your vision, your users, and your constraints — the more precisely I can build something that fits your life and your business, not just a generic SaaS template. Ready. Tell me what we are building.
// A note on communicating with your AI
The prompt sets the frame — but what you put into the conversation is what makes the build yours. The AI is not a search engine. It is a co-architect. Talk to it the way you would talk to a senior engineer who is genuinely trying to understand what you are building and why. The more personal detail you give, the more precisely the architecture fits your actual product.
"My users are small guesthouse owners in Cape Town who are not very technical — the admin panel needs to be extremely simple"
"I want the database structure to support multiple languages eventually even though we are launching in English only"
"The most important thing is that hosts feel trusted — I want verification to be prominent everywhere"
"I have R800/month for infrastructure to start — tell me honestly if this is realistic for what I want to build"
// Infrastructure — Firebase vs GCP explained

The prompt guides you through this decision, but here is the plain-language version so you walk in knowing the landscape:

Firebase-first ✓ Recommended for most
Firestore database, Firebase Auth, Cloud Functions, Firebase Hosting. Real-time by default. Fast to build. Scales to tens of thousands of users without infrastructure management. Monthly cost starts near zero and scales with usage.
→ Use when: real-time features, rapid build, under 50k MAU, budget-conscious start
GCP-first — for scale or compliance
Cloud Run containers, Cloud SQL (PostgreSQL), Identity Platform, Cloud Storage. Complex SQL queries, GDPR/HIPAA compliance, enterprise contracts, full control over infrastructure. Higher setup cost, lower per-unit cost at scale.
→ Use when: regulated data, complex reporting, enterprise clients, 50k+ MAU
Hybrid — best of both
Firebase Auth and Firestore for the real-time user-facing layer. Cloud Run for heavy backend processing, bulk operations, or regulated data. Start Firebase-first, extend with Cloud Run as complexity demands it.
→ Use when: starting simple, expecting complexity, want Firebase speed now + GCP power later
What the GCP CLI does
The prompt walks you through gcloud CLI commands — the official Google Cloud command-line tool. It creates your project, enables APIs, sets up billing, links Firebase, and deploys your first function. You run each command, the AI confirms the output.
→ Install: cloud.google.com/sdk | firebase.google.com/docs/cli
// Build stages — execute at once or return to each
Stage 1 Intake and architecture decision
Paste the full prompt. Answer the AI's intake questions — product, users, scale, constraints, budget, timeline. At the end of this stage you have a complete architecture document and a clear infrastructure decision with reasoning.
// Talk to the AI here
This stage is a conversation, not a form. Give context beyond the questions. If your SaaS solves a problem you personally experienced, say so — the AI will design for the real-world friction that created the need, not a generic version of it.
Stage 2 GCP and Firebase setup
The AI walks you through CLI setup commands. Install the tools, create your GCP project, enable billing, link Firebase, initialise services, deploy a working skeleton.
Example — the AI will give you these commands in sequence
# Step 1 — Install gcloud CLI (Mac/Linux) curl https://sdk.cloud.google.com | bash exec -l $SHELL gcloud init # Step 2 — Create your GCP project gcloud projects create your-saas-name-prod --name="Your SaaS Name" gcloud config set project your-saas-name-prod # Step 3 — Enable required APIs gcloud services enable cloudfunctions.googleapis.com gcloud services enable firestore.googleapis.com gcloud services enable firebase.googleapis.com # Step 4 — Install Firebase CLI and link project npm install -g firebase-tools firebase login firebase projects:addfirebase your-saas-name-prod # Step 5 — Initialise Firebase in your project folder firebase init # Select: Firestore, Functions, Hosting, Emulators
// If a command fails
Paste the error output directly into the chat. Do not try to interpret it yourself first — give the AI the raw error and it will diagnose and fix it. This is normal. CLI setup almost always has one or two environment-specific issues.
Stage 3 Auth and database rules
Authentication first — always. The AI builds your Firebase Auth setup, Firestore security rules, and role-based access control before any feature code is written. A SaaS with broken auth is not a SaaS — it is a liability.
// Tell the AI about your roles in detail
If you have admin users, client users, staff users, read-only viewers — describe exactly what each one should and should not be able to do. The security rules are generated from your description. Vague role descriptions produce vague security rules.
"Admins can see all clients but clients can only see their own data — never another client's"
"Staff can create documents but cannot delete them — only admins can delete"
"The dashboard shows aggregated stats to managers but individual records stay invisible to them"
Stage 4 Core API and Cloud Functions
The backend logic. Cloud Functions for each API endpoint — create, read, update, delete, triggers, scheduled jobs. The AI builds each function against the data model and security rules from Stage 3, then tests them with the Firebase Emulator before deployment.
// Tell the AI about your business logic
The things that make your SaaS yours are not in the framework — they are in the business rules. What happens when a user cancels? What triggers a notification? What calculates the invoice? These are the conversations that produce a platform that actually matches your product vision.
Stage 5 Frontend — component by component
React components built against the API. Login and auth flows, dashboard shell, core feature screens, admin portal. Each component is connected to the real Firebase backend — not mocked data.
Stage 6 Payments, email, and integrations
PayFast (South Africa), Stripe (international), or PayPal. Subscription billing, one-time payments, or usage-based. Email via SendGrid, Mailgun, or Firebase Extensions. The AI integrates whichever combination your platform needs.
Stage 7 Security hardening and deployment
OWASP Top 10 review applied to your specific build. Firestore rules final audit. Environment variables and secrets management. Cloudflare setup. Domain and SSL. Production deployment to Firebase Hosting or Cloud Run. You ship a hardened, production-ready platform.
// Do not skip this stage
Security hardening is not optional for a production SaaS. The AI runs a threat model specific to your platform — not a generic checklist. It will find issues in the build before your users or attackers do. This is the stage that separates a real platform from a prototype that got deployed.
Want this built for you instead?
Forge Vertical builds SaaS platforms from R45,000. Full architecture, Firebase and GCP infrastructure, auth, admin portal, payments, and security hardening. You own the code permanently — no lock-in.
// More AGIA prompts
Coming soon
Client Portal Architecture
Document management, client auth, staff portal
Coming soon
Security Audit Prompt
WAF, DNS, credentials, DMARC, auth gaps
Coming soon
GEO and AI Citation Audit
Schema, robots.txt, entity disambiguation
Coming soon
Business Automation Prompt
Cloud Functions, triggers, workflow routing