Back to Selected Works
Listed on FlippaFreemium + $49/mo

VectAI

AI Marketing Command Center

StackReact 19TypeScriptFirebaseGemini AIViteLemonSqueezyMake.com

The Product & Mission

VectAI is a mission-critical AI marketing command center encompassing 10+ growth tools. Built strictly from a founder's perspective, I designed it with zero infrastructure cost until revenue generation, leveraging highly structured Serverless architecture, atomic billing, and extremely resilient AI agent pipelines.

Target Audience

Marketing Agencies, SaaS Founders, and Solopreneurs who need enterprise-level content generation without hiring an entire marketing team.

The Core Problem

Traditional AI tools lack context and memory between generation tasks. VectAI solves this by utilizing a 'Brand Kernel'—it grounds the business profile securely and passes that exact state context into every AI agent, ensuring 100% brand consistency across SEO, social, and email outputs.

Architectural Deep Dive

The AI Engine (1,017 Lines of Core Logic)

26 Centralized AI Functions

Engineered a robust wrapper around Gemini 2.5 Flash designed for production-level stability. It completely handles multi-phase campaign generation and autonomous routing.

  • Resilience Layer: Built full exponential backoff + jitter covering 5xx retry logic, perfectly distinguishing retriable errors from 4xx failures.
  • Brand Intelligence: Utilized real-time Google Search grounding to verify brand claims dynamically, executing robust JSON extraction with defensive parsing mechanisms.
  • Custom Error Pipeline: Engineered the SynapseAIError class wrapping all API failures into user-friendly constants. True enterprise-grade error handling.

Database & Monetization Layer

600+ Lines Firestore Logic

Engineered a secure, highly scalable transaction pipeline guaranteeing zero billing exploits without requiring an expensive backend server.

  • Atomic Operations: Implemented Firebase runTransaction for credit deduction, mathematically preventing double-spending exploits.
  • Usage Guards: Scalable transaction-based daily limits that auto-reset based on Unix timestamps.
  • Row-Level Security (RLS): All queries and mutations are forcefully locked behind strict request.auth.uid validation logic.
  • Automated Fulfillment: Mapped LemonSqueezy webhooks to Make.com JSON workflows for autonomous tier upgrades, completely circumventing Node.js crypto complexities.

Intent-Preserving Auth Middleware

Zero-Drop-Off Funneling

Engineered a sophisticated routing guard (App.tsx) that eliminates conversion friction by preserving user intent across authentication boundaries.

  • Smart Redirect Persistence: Built a custom 'PublicRoute' guard that captures incoming 'continue' parameters from deep links, storing the user's intended destination throughout the login/signup flow.
  • Post-Auth Intent Fulfillment: Mapped successful authentication triggers to a global handleAuthSuccess function that restores the decoded destination state, auto-funneling users directly to the specific AI tool they discovered.
  • Intent-Aware Onboarding: Integrated the email capture from external funnels directly into the signup state, reducing time-to-value to seconds.

Mastery & Skills Acquired

Advanced LLM Prompt Engineering & Schema EnforcementGenerative Engine Optimization (GEO) & Future SEOIntent-Preserving Authentication & Route GuardingNoSQL Atomic Transactions (Firestore runTransaction)Make.com Serverless Automation & WebhooksReact Performance Auditing (Solving God-Component Anti-patterns)Enterprise Error Handling (Exponential Backoff & Jitter Algorithms)

Post-Mortem: What I Learned

This project served as a masterclass in AI application resilience. Relying solely on deterministic logic is easy; forcing a non-deterministic LLM to always return valid, schema-perfect JSON while routing dynamic marketing tasks required intense focus on fail-safes and fallback parsing.

Notes for Technical Recruiters

I didn't just build a wrapper; I built an autonomous system handling state, billing, concurrency, and real-time streams. The architecture proves I understand atomic database states, production edge-cases, and how to ship platforms that actually generate revenue.

Let's Make It Happen

always open to new opportunities, collaborations, and creative challenges. Let's work together to bring your ideas to life

Get In Touch
© 2026 M M Afraz. All rights reserved.

M M AFRAZ