I spent a weekend building NexusOS — an AI workspace with research, document Q&A, AI agents and tasks — almost entirely by directing Cursor rather than writing code myself.
It works. It's live. But the gap between "the AI wrote the code" and "it runs in production" was where all the real work happened. Here's what actually broke.
First deploy failed instantly:
throw new Error("DATABASE_URL environment variable is required");
Error: Failed to collect page data for /api/auth/account
Next.js evaluates API routes at build time. Prisma wanted a live database during the build, not just at runtime. Locally there was a Docker Postgres running, so it never surfaced.
Fix: provision the database before the first deploy, not after.
Second deploy built fine, then every request 500'd:
PrismaClientKnownRequestError:
The table `public.users` does not exist in the current database.
Code: P2021
The database was connected. Migrations had simply never run against it. A green build meant nothing.
Fix — put migrations in the build script:
"build": "prisma generate && prisma migrate deploy && next build"
Also needed prisma/migrations/migration_lock.toml
, which doesn't exist until you run migrate dev
at least once. Without it migrate deploy
silently does nothing.
I didn't want to pay for OpenAI during development. Groq is OpenAI-API-compatible, so the SDK works unchanged — you only redirect the base URL:
const client = new OpenAI({
apiKey: process.env.GROQ_API_KEY,
baseURL: "https://api.groq.com/openai/v1",
});
One caveat: Groq has no embeddings endpoint. Anything doing RAG or vector memory needs a separate embeddings provider.
The research feature returned confident, well-structured reports. They looked great.
Then I read the sources section:
Sources: [n/a, AI knowledge only]
No web search key was configured, so the model was answering from training data and formatting it like researched output. It never lied — it said so plainly — but nobody reads the sources section when the answer looks authoritative.
After connecting a search API, the same query returned real citations with URLs.
This is the failure mode I'd watch for in any AI product. Plausible output is not verified output, and users assume anything formatted like a citation is one.
Vector search needs the extension enabled inside a migration, not manually:
CREATE EXTENSION IF NOT EXISTS vector;
Neon and Supabase both support it. Run it manually and your next fresh deploy breaks.
For Stripe, never update subscription state from a frontend redirect. Verify the signature server-side:
const event = stripe.webhooks.constructEvent(
rawBody, signature, process.env.STRIPE_WEBHOOK_SECRET
);
Quick way to confirm it's working — POST an unsigned payload at your endpoint. You want a 400:
{"error":"Missing signature"}
A 200 means anyone can forge a "payment succeeded" event.
AI writes the code fast. It doesn't provision your database, run migrations, configure environment variables per environment, or notice that your research feature is quietly hallucinating. That's still yours.
Budget your time for infrastructure and verification, not for writing code.
The app is live and needs no signup — it creates a guest workspace when you open it:
👉 https://all-in-one-data-analises-workspace.vercel.app
Pre-registration for launch updates (first 500 get Pro free for a month):
👉 https://nexusos-landing-page.vercel.app/
Happy to answer questions about any of the above.