Spec/Agent is an AI-powered product management platform that transforms a simple product idea into a complete technical product specification within seconds.
-Detailed product requirements
-User stories and feature lists
-Database schema design
-REST API specifications
-System architecture diagrams
-Sprint planning and development roadmap
-Technical documentation for developers
DEMO - https://youtu.be/Ao-HROczTbU
- Requirements document
- Database schema (Mongoose)
- REST API design
- User stories with acceptance criteria
- Sprint plan
- Architecture diagram (Mermaid.js)
Every generation is saved to MongoDB so you can revisit past specs.
ai-pm-agent/
├── backend/ Express API + MongoDB (Mongoose) + Groq integration
└── frontend/ React (Vite) UI
- Node.js 18+ (native
fetchis used in the backend) - MongoDB running locally, or a free MongoDB Atlas cluster
- A free Groq API key → https://console.groq.com/keys
cd backend
npm install
cp .env.example .envEdit backend/.env:
GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxx
GROQ_MODEL=llama-3.3-70b-versatile
MONGO_URI=mongodb://127.0.0.1:27017/ai_pm_agent
PORT=5000
CLIENT_ORIGIN=http://localhost:5173
Run it:
npm run dev # with nodemon, auto-restarts
# or
npm startYou should see:
MongoDB connected → 127.0.0.1/ai_pm_agent
AI PM Agent API running on http://localhost:5000
Sanity check: GET http://localhost:5000/api/health → {"status":"ok","groqConfigured":true}
In a second terminal:
cd frontend
npm install
cp .env.example .env # defaults already point at http://localhost:5000/api
npm run devOpen http://localhost:5173.
- Type a product idea (or click one of the example chips) and press Draft the spec.
- The backend calls Groq once with a structured-JSON system prompt, gets back all six sections in one response, and stores the result in MongoDB.
- Switch between the six tabs (Requirements, DB Schema, API Design, User Stories, Sprint Plan, Architecture) — the architecture tab renders a live Mermaid diagram.
- Past generations appear as chips above the output — click one to reload it instantly (no new Groq call, just a MongoDB read).
| Method | Route | Description |
|---|---|---|
| POST | /api/projects/generate |
{ prompt } → generates + saves a full spec |
| GET | /api/projects |
List saved specs (id, title, prompt, status) |
| GET | /api/projects/:id |
Full saved spec, including all six output sections |
| DELETE | /api/projects/:id |
Delete a saved spec |
| GET | /api/health |
Health check + whether GROQ_API_KEY is set |
backend/services/groqService.js sends one chat-completion request to
https://api.groq.com/openai/v1/chat/completions with:
response_format: { type: "json_object" }so Groq returns strict JSON- A system prompt that pins down exactly six keys:
title,requirements,schema,apiDesign,userStories,sprintPlan,architectureDiagram architectureDiagramis raw Mermaid flowchart syntax, rendered client-side by themermaidnpm package — no image generation involved.
Swap GROQ_MODEL in .env to any current Groq-hosted model (check
https://console.groq.com/docs/models for what's live) — no other code changes needed.
- If Mongo isn't running, the backend will exit on boot with a clear error — start
mongod(or pointMONGO_URIat an Atlas connection string) first. - If
GROQ_API_KEYis missing,/api/healthwill reportgroqConfigured: falseand generation requests return a 502 with the underlying error message. - CORS is restricted to
CLIENT_ORIGIN— update it if you deploy the frontend elsewhere.