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 FunctionsEngineered 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 LogicEngineered 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 FunnelingEngineered 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
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.
