Muqira โ The Bible ๐
Your single source of truth: build, security, no-bug discipline, growth from 1 week to 5 years, marketing and business. One platform โ Core, AI, Workflow Engine, Integrations, Analytics โ many workflow modules built on top.
๐งญ How to use this tracker
This file is self-contained โ no login, no cloud dependency. Everything lives in your browser, with backup/restore to keep it safe across devices.
1
Navigate with the sidebar โ grouped by layer: Core, AI, Workflow Engine, Integrations, Analytics, then Workflow Modules, Security/QA, Growth Timeline, and Marketing/Business.
2
Click any task to mark it done (turns green โ). Click again to unmark.
3
Growth Timeline has horizon tabs โ 1 Week, 1 Month, 3/6/12 Months, 2โ5 Years โ each with its own focus and checklist.
4
Press "๐พ Save Progress" (or Ctrl+S) โ saves to browser localStorage. Progress persists between sessions.
5
Use "โฌ Backup / Restore" to download a .json file regularly. Re-import on any device to sync progress โ treat this like a save file.
Tasks Done
0
of 0 total tracked tasks
Overall Progress
0%
Across every layer
Current Phase
Phase 0
Repo & Environment Setup
Products & Modules
6 live + 6 planned
AI Studio ยท Flow ยท Social ยท SEOventra ยท AlShorty ยท Documateo + more
Loadingโฆ0%
๐ฏ Today's Mission
Loadingโฆ
๐ธ AI Spend (month)$0
โค๏ธ Platform Healthโ
๐ฆ Release Ready0 / 4
๐ Critical Security Closed0 / 0
๐ Recent Activity
- No activity yet โ tick a task to get started.
๐ฅ Phase 0 โ Repo & Environment Setup โ Done
Monorepo structure confirmed โ apps/api + apps/web on muqira-web / muqira-live
CI/CD pipeline โ lint, test, build, deploy on every merge to main
Staging + production Cloudflare environments separated
Secrets management baseline โ Wrangler secrets, never committed
Resolve production Worker naming conflict (if still open)
Exit criteria: blank "hello world" Worker deploys automatically on merge to main
๐ The Core Question
Before building any feature: Can another workflow module use this in the next 12 months? YES โ build in Core/Layer. NO โ build in the module folder. This single test keeps "build once, reuse forever" real.
Muqira
โ
โโโ Core Layer (identity, orgs, projects, billing, storage, settings โ DONE)
โโโ AI Layer (Muqira AI โ router, 27-model registry, prompts, cost engine โ DONE)
โโโ Workflow Engine Layer (trigger โ step โ step โ validation โ output โ DONE, 9 step types)
โโโ Muqira Connect (25 live connectors, one registry, one SDK โ DONE)
โโโ Analytics Layer (events, performance, engagement โ NOT STARTED)
โโโ Admin Console (12 pages, platform operator control plane โ DONE)
โโโ Marketing Site (blog, docs, changelog, status, tools, labs โ DONE)
โ
โโโ Products (the things users actually buy)
โโโ AI Studio โ Purpose-First v2, live
โโโ Muqira Flow โ workflow automation, live
โโโ Social Media Automation โ Workflow #1, in progress
โโโ SEOventra โ live sub-product
โโโ AlShorty โ live sub-product
โโโ Documateo โ live sub-product
โโโ SEO Automation (planned)
โโโ Content Marketing Automation (planned)
โโโ Research Automation (planned)
โโโ Product Launch Automation (planned)
โโโ Directory Submission Automation (planned)
North Star & Strategy
The strategic frame every other decision in this tracker hangs off of.
๐งญ The Strategic Shift
The unit of value is a Workflow Module running inside Muqira โ not a separately branded app.
Social Media Automation ships first, then SEO, Content, Research, Product Launch, and Directory Submission. SEOventra, AlShorty, and Documateo continue as real products consuming the same Core, AI, Workflow Engine, Integration, and Analytics layers โ the platform-layer work already done isn't thrown away, it gets a sharper first customer-facing target.
โ ๏ธ One Open Question โ Confirm Before Phase 4 Locks In
This blueprint assumes Workflow Modules ship as features inside Muqira rather than as separately branded standalone products. If the separately-branded product line (SEOventra, AlShorty, Documateo) is meant to run in parallel rather than be superseded by this structure, it's worth confirming how the two fit together โ easy to adjust now, expensive to unwind after customers are already using named products.
๐ Wrong Metric vs Correct Metric
Track outcomes, not activity. A completed workflow is the actual unit of value delivered โ not a prompt sent or a message generated.
| Instead of tracking | Track this | Why it matters |
|---|---|---|
| Prompts sent | Workflows completed | A completed workflow is the actual unit of value delivered |
| Messages generated | Campaigns published | Output that reaches the real world, not just generated text |
| โ | Products launched | Direct measure of the Product Launch workflow's success |
| โ | Content generated AND published | Generation alone isn't the goal โ publication is |
| โ | Rankings improved | The SEO workflow's actual promise to the customer |
| โ | Traffic / leads generated | The downstream business outcome every workflow ultimately serves |
| โ | Time-to-completion per run, falling over time | Proves the engine is actually getting better, not just busier |
๐ท๏ธ Revenue Model
Gate by workflow runs/month and AI tier, not by feature lockout within a workflow โ keeps the product feeling complete at every tier, which matters more for trust than upsell pressure does.
| Tier | Workflow Access | AI Tier | Limits |
|---|---|---|---|
| Free | 1 workflow module, limited runs/month | Free-tier models (Groq/OpenRouter free) | Capped runs, single project, no scheduling |
| Starter | All shipped workflow modules | Paid tier (GPT/Claude/Gemini Pro) | Higher run cap, scheduling enabled, single project |
| Professional | All workflow modules | Premium tier available | Multiple projects, full analytics, priority support |
| Agency | All workflow modules | Premium tier | Teams/orgs, unlimited projects, white-label option, seat-based pricing |
Guiding Principles
Every architectural decision must comply. Re-read before any sprint that touches more than one module.
Standing rule for every decision: if a feature could be reused by more than one Workflow Module, it belongs in a Layer (Core/AI/Workflow Engine/Integration/Analytics). If it's specific to one workflow's logic, it belongs in that module. This is the single test that keeps the platform from turning into disconnected products.
1
Build once, reuse forever
Auth, billing, AI routing, storage, notifications โ built once in a Layer, consumed by every Workflow Module. If you're writing similar code in two places, stop and extract it.
2
No workflow module ever calls an AI provider directly
Every AI call passes through Muqira.AI.generate() โ the single front door. Zero exceptions, even for "just a quick test."
3
AI providers are replaceable implementation details
7 providers behind one interface. A new model becomes a config-registry change, not a code change in any workflow.
4
Every Core table is scoped by org_id, with zero exceptions
A single missing filter is a cross-customer data leak. This is the #1 item on the risk register โ treat it that way.
5
Keep Core generic โ no module-specific tables
No social_posts or seo_audits table in Core. Workflow-specific data lives in workflow_runs.state_json / workflows.definition_json, or in a module-owned table outside Core if genuinely needed.
6
Workflow definitions are data, not code
JSON-schema validated, no proprietary DSL. The execution engine has zero workflow-module-specific logic inside it.
7
Adding a connector should never touch the workflow engine
The Connector contract in registry.ts is the only interface. If adding WordPress or Ghost had required engine changes, the SDK abstraction would be leaking โ proven correct by shipping 25 connectors without touching the engine.
8
Cost visibility before scale, not after the surprising bill
The Cost Engine must exist before Workflow #1 has real paying users. Budget-aware model selection is not optional.
9
Track completed workflows, not generated text
A completed, published, real-world outcome is the unit of value โ not a prompt sent or a message drafted.
10
If a module needs a feature that doesn't fit an existing Layer, redesign the module
Don't bolt on a one-off. Scope creep across workflow modules is named explicitly as a top platform risk.
All Platform Modules
Every sub-module across Core, AI, Workflow Engine, Integration, and Analytics layers. Status, maturity, and dependencies โ auto-tracked from your checklists, the rest editable inline.
Identity, Organizations & Core
2.1.1โ2.1.4 & 2.1.6โ2.1.7 โ one login system, multi-tenancy, projects, permissions, storage, settings. Build Phase 1.
Exposes:
getCurrentUser(), requireAuth(), getCurrentOrg(), requireOrgMember(), requireRole(role), getProject(), can(user, action, resource), uploadAsset(), getSetting(scope, key) โ middleware and helpers every other layer depends on.๐ Identity & Authentication
Email OTP (Resend), Google OAuth, GitHub OAuth, JWT sessions all working locally
RBAC middleware confirmed on every mutating route
Production Cloudflare deployment of auth confirmed end-to-end
๐ข Organizations & Teams
Create/rename/delete org, personal org auto-created on signup
Invite by email, accept/decline, remove member, org switcher UI
Admin-driven org suspension with a reason shown to the org, enforced at the auth middleware
๐ Projects & ๐ก๏ธ Permissions
Project CRUD, settings_json, brand voice / tone / audience context
Four fixed roles (Owner/Admin/Member/Viewer) โ no custom permission engine yet
๐๏ธ Asset Storage & โ๏ธ Settings
R2 direct upload, signed URLs, per-org storage quota
Settings UI shared across all workflow modules
Sane defaults so nothing requires configuration before first use
D1 schema (23 migrations applied) confirmed matches Drizzle definitions in production
Billing & Subscriptions
2.1.5 โ razorpay integration, plan enforcement, usage metering, credit system, GST-aware discounts. The thing that turns workflows into revenue. Build Phase 1.
Exposes:
checkUsageLimit(org, metric), getPlan(org), getCreditBalance(org), applyDiscount(org, code), webhook handler for razorpay events.razorpay Checkout + Billing Portal + Webhooks integrated
Plan limits enforced at the API layer (runs/month, AI usage/month, seats) โ not just UI-hidden
Usage dashboard, failed-payment handling, proration on upgrade
Credit-based usage system live across all four plans (Free/Starter/Professional/Agency)
GST-aware discount system โ USD-priced, INR-converted at checkout, discounts apply correctly either way
Critical Build Order
The spine of the platform. Build top to bottom โ each layer unlocks the next. Support modules run in parallel alongside it.
๐ช The Spine
๐ง Support Modules (parallel, non-blocking)
Impact & Priority
Score every module on Business Value, Engineering Effort, Reuse, Risk, and Strategic Fit. Click a star to re-rate โ it's saved instantly.
Muqira AI โ Router, Tiering & Fallback
2.2.1โ2.2.4 & 2.2.6 โ single front door for every AI call. No workflow module is ever allowed to call a provider directly. Build Phase 2.
Exposes:
Muqira.AI.generate({ prompt, context, tier }) โ the only function any workflow step is allowed to call. Also: selectModel(tier, taskType), renderPrompt(templateKey, variables), buildContext(projectId).โก AI Router v2 โ 7 Providers
7 providers (Groq, OpenAI, Anthropic, Gemini, Mistral, DeepSeek, OpenRouter) behind one OpenAI-compatible caller
BYOK org-level encrypted provider keys, mk_live_ external API token generation
๐๏ธ Model Routing & Tiering
27-model registry, Free/Starter/Professional/Agency tier mapping, pricing_tier + constraints field on every model
requireApiKeyOrAuth middleware confirmed on external API routes
Model registry audit system โ weekly cron, snapshot diffing, live provider checks, admin email alerts via Resend
Manual audit trigger endpoint exposed in Admin Console โ Model Registry page
๐ Prompt Template Engine & ๐งฉ Project Context
DB-backed, versioned prompt templates with category field
POST /api/ai/render-template endpoint live, sessionStorage handoff confirmed
Brand voice / audience / prior-output context auto-injected into every prompt
๐ Model Switching & Fallback
KV-backed circuit breaker per provider (3 failures/5min opens, 2-min cooldown), configurable fallback chain
Fallback tested with a simulated provider outage โ not just configured
Silent model substitution bug fixed โ GenerateResult carries a substitution field, orange warning banner shown in the UI whenever it fires
Root cause fixed at source โ resolveKey() no longer silently returns null and falls through to Groq
AI Usage Tracking & Cost Engine (Build)
2.2.5 โ know exactly what every AI call costs, per org, per workflow, per model, before it becomes a budget surprise. This is the Golden Rule enforcement point. Build Phase 2.
Per-request cost ceilings by plan tier, org-level override
Heuristic complexity estimation, budget-aware model selection inside generate()
Applies automatically to Console, workflows, and external API callers โ verified, not assumed
Key learning: per-request ceilings beat period pools for budget control โ more predictable, easier to reason about per-call cost exposure. Money safety must be enforced at multiple independent layers โ never rely on a single gate. The Agency plan previously had no real monthly dollar cap, only a credit-count proxy; this has since been fixed.
AI Studio v2 โ Purpose-First
Consumer-facing AI writing/generation surface โ the product a customer actually opens, built on top of the AI Router, Tiering, Prompt Engine, and Cost Engine.
Replaces a blank-prompt-box flow with a guided three-step experience: pick a Purpose โ get model/feature recommendations โ generate. Files:
purpose-registry.ts, PurposeSelector.tsx, classifyPrompt().Uses These Platform Modules
๐ฏ Purpose-First Flow
Purpose Registry โ 11 intents mapped to model/feature recommendations
Three-step PurposeSelector.tsx UI โ pick purpose, see recommendation, generate
Smart Prompt Analysis โ classifyPrompt() auto-detects intent from free-text input
Multi-lens model recommendation engine wired to the Purpose Registry
Model substitution made visible to the user โ orange warning banner when a selected model is silently swapped
๐งฐ Supporting Surfaces
Scripting tools + library โ reusable prompt/script assets
History, stats, and templates views inside AI Studio
Settings โ BYOK keys, defaults, feedback + attachment support
Streaming responses (SSE) โ Anthropic live, extend to remaining 6 providers
Mobile layout verified โ three-step flow usable one-handed, no horizontal scroll
Key learning: silent failures are the most dangerous bug class here โ silent model substitution was found and fixed by making it loud (visible banner) rather than by trying to eliminate every future edge case that could cause it.
Workflow Engine Layer
2.3.1โ2.3.7 โ Trigger โ Step โ Step โ Validation โ Output. The reusable framework every workflow module is expressed in as data, not code. Build Phase 3 โ done.
Exposes:
WorkflowDefinition schema, executeWorkflow(workflowId, triggerPayload), getRunStatus(runId), scheduleWorkflow(), triggerWebhook(workflowId, payload), validateStepOutput(step, output), cloneTemplate(templateId, projectId), dispatchWorkflowRun().๐ Definition Schema & โ๏ธ Execution Engine
JSON-schema validated workflow definitions โ no proprietary DSL
workflow-engine.ts, routes/workflows.ts, routes/workflow-runs.ts mounted in index.ts
Trivial test workflow ("generate โ validate โ output") runs end-to-end
โฑ๏ธ Trigger System & ๐งฉ Step Type Library
Manual / webhook-per-workflow triggers working
Recurring Cron trigger โ workflow-scheduler.ts, next_run_at, runs pass through the same quota gate as manual runs
9 live step types: ai_task, validation, transform, delay, integration_action, branching, human_approval, browser_automation, local_file_access, image_generation
โ
Validation Layer & ๐ฌ Queue Processing
JSON schema validation (exists/min_length/max_length/contains) + transform step (trim/case/parse_json)
dispatchWorkflowRun() โ queue_attempts tracking with backoff between retries
Dead-letter flag once MAX_QUEUE_ATTEMPTS is exceeded โ run stops retrying forever
Dead-letter runs surfaced in Admin Console (Workflows page)
๐ Workflow Templates Phase 7
Template gallery UI
One-click clone into a project (copy-on-create)
Templates owned by a system org, is_template flag on workflows
Template versioning independent of user customizations
Open gap: dead-letter workflow runs are visible in Admin but there's no email/Slack push alert. A stuck cron workflow could sit dead-lettered for days before anyone looks.
Muqira Connect โ 25 Live Connectors
2.4.1โ2.4.6 โ one abstract contract every third-party integration implements. Done ahead of schedule (originally Phase 4โ6), now spans 6 categories on a single registry.
Exposes:
getConnector(id), listConnectors(), runConnectorAction(orgId, connectorId, action, params) โ the entire SDK contract. Adding a new connector is one file implementing the contract + one line in registry.ts. Zero engine changes required.๐ Connector SDK & ๐ Credential Management
Single Connector contract โ authenticate, list actions, execute, handle webhook
Encrypted credential storage, decrypted per-call only, revoke-on-disconnect
Per-(org, provider) rate limiting โ 20 actions/min, protects the org's standing with the third-party platform
๐ฌ Communication โ Live
Webhook โ generic inbound/outbound actions
Slack โ post message, channel actions
Discord โ post message, channel actions
Telegram โ send message via bot API
Email โ transactional send via Resend
WhatsApp โ send message via Business API
๐ฑ Social โ Live โ Phase 4 dependency
X/Twitter โ post, thread, engagement pull
Meta โ Facebook Pages + Instagram via Graph API
LinkedIn โ post, company page, engagement pull
YouTube โ upload, metadata, channel actions
Reddit, Threads remain future candidates โ Phase 7+.
๐ฐ Publishing & Commerce โ Live
WordPress โ posts, categories/tags, featured images
Ghost โ posts, tags, publishing
Shopify โ products, orders, storefront actions
๐๏ธ Productivity & Data โ Live
Notion โ page/database read-write
Airtable โ record read-write
Trello โ card/board actions
Google Sheets โ read-write rows
Google Docs โ create/update documents
๐งฐ Marketing & Dev-Tools โ Live
Mailchimp โ audience + campaign actions
Brevo โ email/SMS campaign actions
GitHub โ issues, PRs, repo actions
Jira โ issue create/update
Asana โ task create/update
๐ Analytics & SEO โ Live โ was Phase 6
Google Search Console โ search performance data
Google Analytics (GA4) โ traffic/conversion data
GA4 data wired into a dedicated Analytics dashboard
Search Console data wired into a dedicated Analytics dashboard
๐ฐ๏ธ Future Connector Candidates
Build opportunistically, none required for current products: Gmail, Google Calendar, Reddit, Threads, Web Search/browser automation, Semrush, Ahrefs, Zapier-style generic HTTP action builder.
Analytics Layer
2.5.1โ2.5.3 โ one place every workflow module's activity gets logged. Build Phase 6 โ not started. Note: the GA4 and Search Console connectors themselves already exist in Muqira Connect (Phase 4.5) โ this phase is the event pipeline and dashboard on top of them.
Exposes:
track(eventType, payload) โ callable from anywhere in the stack.Typed event schema, org/project scoping on every event
Write to Cloudflare Queue first, batch-insert into Postgres โ avoid write amplification
Content Performance Tracking โ per-post dashboard, trend-over-time, best-performing surfacing
Join published content to engagement metrics pulled via Analytics Connectors
Click & Engagement Tracking โ link shortening/tracking on outbound URLs
Engagement event capture wired to Event Pipeline
๐ฃ Social Media Automation Workflow #1 โ In Progress
3.1 โ take a topic and turn it into published, scheduled social content with zero manual drafting. Build Phase 4.
Trigger: Manual ("create a post about X") or scheduled (e.g. "3 posts/week"). Steps: Topic Research โ Content Generation โ Image Generation โ Validation โ Scheduling โ Publishing. Success metric: posts published per org/month, scheduled-vs-published ratio, engagement lift vs. manual posting baseline.
Uses These Platform Modules
Build Checklist
Topic Research step โ pulls context, optionally calls Research Automation sub-step
Content Generation step โ AI Generation node via prompt templates
Image Generation step
Validation step before anything publishes
Scheduling step โ Delay/Schedule node, calendar-aware
Publishing step โ Integration Action node to LinkedIn/Facebook/Instagram
Calendar view + post preview + approval queue UI
Exit criteria: a real post goes live with zero manual editing required
๐ Muqira Flow
The Workflow Engine, branded and packaged as a customer-facing automation product โ not just internal plumbing.
Uses These Platform Modules
Build Checklist
Branded as the workflow-automation product surface, not just an internal engine
Workflow list + detail/run views polished for a real customer-facing product
Workflow templates browsable and cloneable from the Flow UI
Run history, dead-letter, and retry visibility in the Flow UI
Cron/scheduled trigger configuration exposed in the Flow UI
Flow pricing/positioning finalized as a named plan feature, not implicit
๐ SEOventra
Real, live sub-product consuming Muqira Core. Keyword research, SERP analysis, site audit.
Uses These Platform Modules
Build Checklist
Keyword research tool โ calls AI Router internally, domain logic only
SERP analysis
Site audit โ Browser Automation node, crawl + checks
Search Console connector wired
Rank tracking over time
GA4 connector wired for traffic correlation
Production deployment confirmed on Cloudflare Pages
MuqiraBar footer (theme-aware) confirmed live
๐ AlShorty
Real, live sub-product. Link shortening โ also doubles as the platform-wide Click & Engagement Tracking layer (2.5.3).
Uses These Platform Modules
Build Checklist
Link creation โ custom slug, expiry, max-clicks (Pro)
Redirect engine โ KV lookup, sub-10ms response
Click analytics โ track clicks, countries, devices, referrers
Bio pages โ link-in-bio with multiple links
QR code generation โ per-link QR codes
๐ Documateo
Real, live sub-product. PDF toolkit consuming AI Router + Asset Storage.
Uses These Platform Modules
Build Checklist
PDF merge/split/rotate core operations
jsPDF text-primitive export confirmed โ no html2canvas, no 16,384px failure mode
AI-assisted PDF summarization / Q&A via AI Router
R2-backed storage for uploaded/generated PDFs, signed URLs
Production deployment confirmed
๐ ๏ธ Admin Console
Platform operator control plane. Lives at /dashboard/admin, hidden except for is_platform_admin = true accounts, with a secondary ADMIN_SECRET unlock prompt.
Admin account:
chatmatterji@gmail.com. Two independent gates protect this surface โ a compromised session alone is not enough to reach org-suspension, payment, or model-registry controls.๐ ๏ธ 12 Admin Pages
Sub-nav sidebar โ all admin pages reachable, none orphaned
Organizations โ view/search/suspend any org with reason shown to the org
Users โ view/search users across orgs
Subscriptions โ view/manage plan assignments
Payments โ razorpay transaction visibility
AI Requests โ inspect logged AI calls, cost, model used
Model Registry โ live model list, pricing tiers, constraints, manual audit trigger
Usage โ cross-org usage dashboard
Discounts โ GST-aware discount management
Integrations โ connector health/status overview
Workflows โ cross-org workflow run visibility, dead-letter surfacing
Assets โ R2 storage overview
Key learning: nine admin pages sat unreachable until a proper sub-nav sidebar was built โ dead code and drift accumulate silently; regular navigation audits catch what a feature list alone won't.
๐ Marketing Site
Public-facing pages beyond the app shell โ where SEO, trust, and top-of-funnel discovery actually happen.
๐ Public Pages
Blog โ list + dynamic post pages, SEO-structured
Changelog โ public-facing shipped-features log
Docs โ guide index + dynamic guide pages
Tools โ free top-of-funnel tools directory page
Labs โ experimental/early-access features page
Status page โ public service status + incident history/timeline
About, Careers, Press, Contact โ company/trust pages
Legal โ Terms, Privacy, and related policy pages
Products โ marketing pages per sub-product (SEOventra, AlShorty, Documateo, AI Studio)
llms.txt served for AI-crawler discoverability
SEO note: Status, Changelog, and Docs are underused SEO surfaces most SaaS competitors skip โ each incident write-up, changelog entry, and doc page is a long-tail indexable page that also builds trust. Keep publishing to these even when there's no "content marketing" campaign running.
Future Workflow Modules
3.2โ3.6 โ none of these get built until the platform layer underneath is solid. That's the whole point of building the platform first. Build Phase 7+.
๐ Phase 7 Build Checklist
Workflow Templates system โ gallery, one-click clone into project
SEO Automation workflow module (Analyze โ Issues โ Recommend โ Tasks)
Content Marketing Automation workflow module
Research Automation workflow module (shared sub-step for others)
Product Launch Automation workflow module
Directory Submission Automation workflow module
๐ MuqiraBar โ Cross-App Shared UI
MuqiraBar universal footer โ theme-aware via useTheme(), hardcoded prop removed
SiteFooter.tsx โ conditional full Footer vs MuqiraBar by route
Propagated to all sub-product repos with their own ThemeProvider
Repos without their own ThemeProvider โ prop pinned or ThemeProvider.tsx copied
๐ Security Checklist
Categorized, severity-tagged. Close every CRITICAL item before any production launch with real customer data. This is the section that makes the tracker dummy-proof on security.
The platform's #1 named risk: multi-tenant data isolation. Every Core table must be scoped by org_id with zero exceptions โ a single missing filter is a cross-customer data leak.
โ
No-Bug / QA Policy
The discipline that keeps production clean. Adopt these as standing practice, not a one-time checklist.
The bar: a feature is not "done" until it works in production, not just locally. Every fixed critical/high bug gets a regression test so it can't silently come back.
โณ Growth Timeline โ 1 Week โ 5 Years
Every horizon has its own focus and checklist. Switch tabs to zoom in or out on the plan.
Phase Roadmap (0โ7)
From the blueprint, section 6. Check each phase's steps off as you ship. Click a phase to expand its deliverables and exit criteria.
Phase 0 โ Repo & Environment Setup โ Done
1
Monorepo structure
apps/api (Hono/Workers/D1), apps/web (Next.js 15/Pages) โ muqira-web / muqira-live, GitHub ataurCODEX/muqira-web
2
CI/CD pipeline
Lint, test, build, deploy on every merge to main
3
Staging + production environments
Separate Cloudflare environments, separate secrets
4
Secrets management baseline
Wrangler secrets, .dev.vars locally, never committed
Exit criteria: a blank "hello world" Worker deploys automatically on merge to main.
Phase 1 โ Muqira Core โ Done
1
Identity & Authentication
Email OTP (Resend), Google OAuth, GitHub OAuth, JWT sessions, RBAC middleware
2
Organizations & Teams
Create/invite/remove members, org switcher, personal org auto-created on signup, admin-driven suspension with customer-visible reason
3
Projects
CRUD + project-level settings_json + brand context
4
Permissions (RBAC)
Owner/Admin/Member/Viewer โ four fixed roles
5
Billing Foundation
razorpay Checkout + webhooks, plan limits enforced at the API layer, credit system, GST-aware discounts
6
Asset Storage
R2 direct upload, signed URLs, per-org quota
7
Settings
jsonb columns on organizations/projects โ no new infra
Exit criteria: auth + org + billing all work end-to-end with zero workflow logic yet built.
Phase 2 โ Muqira AI โ Done
1
AI Router v2
7 providers (Groq, OpenAI, Anthropic, Gemini, Mistral, DeepSeek, OpenRouter), single OpenAI-compatible caller, shared generate-pipeline module
2
Model Registry & Tiering
27-model registry, audited weekly with snapshot diffing + live provider checks, BYOK org-level encrypted keys, mk_live_ external API tokens
3
Prompt Template Engine
DB-backed, versioned prompt templates with category field, POST /api/ai/render-template
4
Project Context Management
Brand voice / audience / prior-output injection into every prompt
5
AI Usage Tracking & Cost Engine
Per-request cost ceilings by plan tier, heuristic complexity estimation, budget-aware model selection โ the Golden Rule enforcement layer
6
Model Fallback (hardened)
KV-backed circuit breaker per provider (3 failures/5min opens, 2-min cooldown), configurable fallback chain
7
AI Studio v2 โ Purpose-First
Purpose Registry (11 intents), three-step PurposeSelector UI, Smart Prompt Analysis, multi-lens recommendation engine, visible model-substitution warning banner
Exit criteria: a test call through the Router correctly routes a free-tier user to a free-tier model and a premium-tier user to the best available model, with cost logged.
Phase 3 โ Workflow Engine โ Done
1
Workflow Definition Schema
JSON-schema validated definitions, no proprietary DSL
2
Workflow Execution Engine
workflow-engine.ts, routes/workflows.ts, routes/workflow-runs.ts โ sequencing, state, retry
3
Trigger System
Manual / recurring Cron (workflow-scheduler.ts, quota-gated like manual runs) / webhook-per-workflow
4
Step Type Library
9 live step types: ai_task, validation, transform, delay (pause/resume via scheduled_jobs), integration_action, branching, human_approval, browser_automation, local_file_access, image_generation
5
Validation Layer
JSON schema (exists/min_length/max_length/contains) + transform (trim/case/parse_json)
6
Task/Queue Processing
dispatchWorkflowRun() โ retry with backoff + dead-letter after MAX_QUEUE_ATTEMPTS, surfaced to Admin instead of retrying forever
Exit criteria: a trivial test workflow ("generate text โ validate โ output") runs end-to-end through Trigger โ Step โ Validation โ Output with zero workflow-module-specific code in the engine.
Phase 4 โ Workflow #1: Social Media Automation In Progress
1
LinkedIn, Meta (Facebook + Instagram), X, YouTube connectors
Auth, post, fetch engagement metrics โ all four live in the connector registry
2
Social Media Automation workflow
Topic Research โ Content Generation โ Image Generation โ Validation โ Scheduling โ Publishing
3
Workflow-specific UI
Calendar view, post preview, approval queue
Exit criteria: a real post, generated end-to-end by the workflow, goes live on a connected LinkedIn/Facebook/Instagram account with no manual editing required.
Phase 4.5 โ Muqira Connect: Full Connector Build-Out โ Done
1
Communication
Webhook, Slack, Discord, Telegram, Email, WhatsApp
2
Social
X/Twitter, Meta, LinkedIn, YouTube
3
Publishing & Commerce
WordPress, Ghost, Shopify
4
Productivity & Data
Notion, Airtable, Trello, Google Sheets, Google Docs
5
Marketing
Mailchimp, Brevo
6
Dev & Project Management
GitHub, Jira, Asana
7
Analytics & SEO
Google Search Console, Google Analytics (GA4)
8
Per-connector rate limiting
20 actions/min per (org, provider) โ protects the org's standing with the third-party platform, separate from the AI burst limiter
Exit criteria: adding a new connector requires only implementing the Connector contract and one registry line โ proven by shipping 25 connectors across 6 categories on the same registry.
Phase 4.6 โ Admin Console & Marketing Site โ Done
1
Admin Console
12 pages behind is_platform_admin + ADMIN_SECRET: Organizations, Users, Subscriptions, Payments, AI Requests, Model Registry, Usage, Discounts, Integrations, Workflows, Assets โ reachable via a proper sub-nav sidebar
2
Marketing site
Blog, Changelog, Docs, Tools, Labs, Status (with incident history), About/Careers/Press/Contact, Legal, per-product marketing pages, llms.txt
Exit criteria: a platform operator can see and act on every org, subscription, payment, AI request, and workflow run from one console.
Phase 5 โ Publishing Infrastructure Hardening In Progress
1
OAuth/credential hardening at scale
Encryption at rest, strict access scoping, refresh rotation, revoke-on-disconnect verified for every live connector
2
Scheduler + queue hardening
Higher volume, dead-letter alerting (email/Slack) โ currently surfaced in Admin only, no push alert yet
Exit criteria: connector build-out already proves the SDK works (Phase 4.5) โ this phase hardens what exists under real volume.
Phase 6 โ Analytics Layer Not Started
1
Event Pipeline
Cloudflare Queue โ batch-insert Postgres, typed event schema
2
GA4 + Search Console connectors
Already live in Muqira Connect (Phase 4.5) โ this phase is wiring them into a dedicated Analytics dashboard, not building the connectors themselves
3
Content Performance Tracking
Per-post dashboard, trend-over-time, best-performing surfacing
4
Click & Engagement Tracking
Link shortening/tracking layer โ AlShorty doubles here
Exit criteria: a user can see real engagement numbers (not just "published" status) on content the Social Media workflow generated.
Phase 7 โ Workflow Marketplace & New Modules Multi-Workflow
1
Workflow Templates system
Gallery, one-click clone, system-org-owned templates
2
SEO Automation
Analyze Website โ Find Issues โ Recommendations โ Tasks
3
Content Marketing Automation
Brief Intake โ Research โ Draft โ Validate/Edit โ Publish
4
Research Automation
Define Question โ Web Research โ Synthesize โ Structured Output
5
Product Launch Automation
Analyze Product โ Generate Assets โ Launch Plan โ Publish
6
Directory Submission Automation
Gather Info โ Match Directories โ Generate Copy โ Submit โ Track
Exit criteria: a second workflow module ships in materially less time than Workflow #1 did, because the platform layers already exist.
๐ฃ Marketing Channels
How to play reachability โ owned content, product-led growth, community, partnerships, and paid (only after PMF).
โ
Marketing Action Checklist
๐ SEO Playbook
Technical foundation, keyword strategy, link building, and measurement โ how Muqira itself plays SEO.
โ
SEO Action Checklist
๐ผ Business & Revenue
Pricing, unit economics, retention, and capital strategy.
โ
Business Action Checklist
Ownership Matrix
The most important document. Before building any feature โ check this first.
The core question: Can another workflow module use this in the next 12 months? YES โ Build in a Layer (packages/ or platform API). NO โ Build in the workflow module's folder.
Feature Ownership
| Feature | Owner | Location | Notes |
|---|---|---|---|
| Authentication | Core Layer | apps/api/auth/ | All workflow modules import this |
| AI Routing | AI Layer | packages/ai/router.ts | Only entry point for AI calls |
| Workflow Execution | Workflow Engine | packages/workflow-engine/ | Every module's steps run through this |
| Cost Tracking | AI Layer | packages/ai/cost-engine.ts | Auto-logged per request |
| Billing / razorpay | Core Layer | apps/api/billing/ | One razorpay account |
| File Storage | Core Layer | apps/api/storage/ | R2 via platform service |
| Connector SDK | Muqira Connect | lib/connectors/registry.ts | Single Connector contract, 25 connectors registered |
| Topic Research / Content Gen | Social Automation | workflow definition | Calls AI Router internally |
| Keyword Research / SERP Analysis | SEOventra | apps/seoventra/ | Domain logic only |
| PDF Processing | Documateo | apps/documateo/ | Storage via platform R2 |
| Link Shortening / Click Tracking | AlShorty | apps/alshorty/ | Also serves as platform click layer |
Cross-Module Matrix
Which workflow modules consume which platform modules โ and how built-out each pairing already is.
๐ซ Kill List
Do NOT build any of these before product-market fit. Re-read this before every sprint.
If you find yourself about to build one of these: stop, re-read the Guiding Principles, and ask if there's a simpler path. Every item on this list has killed bootstrapped companies.
Kubernetes or container orchestration โ Cloudflare Workers scale globally for free.
Microservices split of apps/api โ modular monolith on Workers until proven independent scaling needs.
Event mesh / message broker (Kafka, RabbitMQ) โ Cloudflare Queues is enough until serious scale.
Multi-region deployment logic โ Workers are already globally distributed by default.
Custom AI model training or fine-tuning โ route across 7 existing providers instead.
Real-time collaborative editing (Google-Docs style) โ massive complexity, uncertain return at this stage.
Enterprise SSO โ not before real revenue and an actual enterprise customer asking.
Granular custom-permission engine โ Owner/Admin/Member/Viewer is enough for years.
Plugin marketplace โ not before 3+ workflow modules are live with real usage.
Native mobile apps โ responsive web is sufficient; native adds huge maintenance overhead.
On-premise / self-hosted offering โ cloud SaaS only until an enterprise customer pays for it.
Custom analytics infrastructure โ lightweight pipeline first, not a Snowflake-style stack.
White-label reseller system โ after PMF only.
Affiliate / referral program infrastructure โ after PMF only.
Rebuilding billing/auth/storage per sub-product โ everything reusable goes in Muqira Core, no exceptions.
Tech Stack
Deliberate, confirmed choices. Boring until scale demands otherwise.
Frontend
Next.js 15ReactTailwindCSSshadcn/uiCloudflare Pages
Backend
Cloudflare WorkersHonoTypeScript
Database
D1 (Cloudflare SQLite)Drizzle ORM23 migrations applied
Queue & Storage
Cloudflare QueuesCloudflare R2Cloudflare KV
Auth
Resend (Email OTP)Google OAuthGitHub OAuthJWT Sessions
AI Providers (7)
GroqOpenAIAnthropicGeminiMistralDeepSeekOpenRouter
Payments
razorpayCheckoutBilling PortalWebhooks
PDF Generation
jsPDF text primitives
Never html2canvas โ non-selectable output, 16,384px page-height failure mode.
Monitoring & VCS
SentryPostHog / CF AnalyticsGitHub
โ ๏ธ Risk Register
From the blueprint, section 9. Named risks with their mitigation โ revisit quarterly.
| Risk | Mitigation |
|---|---|
| AI Router as a single point of failure | Every workflow module depends on it โ build Model Fallback early, not as an afterthought. |
| OAuth token security | A leaked LinkedIn/Facebook token is a real liability โ encryption at rest + strict access scoping on the token store from day one. |
| Multi-tenant data isolation | Every Core table scoped by org_id with zero exceptions โ one missing filter is a cross-customer data leak. |
| Cost overruns from AI usage | The Cost Engine must exist before Workflow #1 has real paying users, not after the first surprising bill. |
| Scope creep across workflow modules | "Build once, reuse forever" is the safeguard โ if a Phase 7 module needs a feature that doesn't fit an existing Layer, redesign the module, don't bolt on a one-off. |
| Connector maintenance burden | Every third-party API changes over time โ budget ongoing maintenance capacity per connector, not just initial build time. |
AI Cost Dashboard
Track AI spend across all 7 providers before it surprises you. Plug in real numbers as the AI Router ships and logs usage.
Platform Health
A weighted self-assessment across the dimensions that actually predict production pain. Adjust sliders as things change.
Release Readiness
A workflow module is marked "Ready" only when its overall score is โฅ85%, testing โฅ70%, and docs โฅ50%. No exceptions โ that's the bar that prevents shipping broken things.
Technical Debt
The shortcuts you took on purpose. Log them here so they get paid down deliberately instead of forgotten.
Title
Severity
Est. hours
Decisions Log
Lightweight Architecture Decision Records. Capture the why, not just the what โ future you will thank present you.
Decision
Reason
Alternatives considered
My Notes
Free-form workspace. What you're building today, blockers, ideas.
Current Focus
Blockers
Next 3 Actions
Decisions Made (free-form)
Open Questions
Abandoned / Deprioritized
Ideas Backlog