PostFuel is a content machine created as a Next.js 14 App Router project for generating and reviewing AI-assisted content across four formats:
- Blog drafts
- Code walkthroughs
- Article or PDF summaries
- Social posts
The app is designed around one shared idea: every draft should keep evidence attached so an editor can review claims before sharing or publishing.
/is the main studio page.- Users choose a format, enter a topic, add notes or a URL, and optionally upload a PDF for summaries.
- Submitting the form calls one of the agent API routes and creates a saved draft.
/drafts/[id]is the draft review page.- The draft can be edited inline.
- Evidence items can be toggled as verified.
- Drafts can be copied as Markdown.
- Share helpers are included for email, X, and LinkedIn.
The app currently exposes these route handlers:
POST /api/agents/blogPOST /api/agents/codePOST /api/agents/summaryPOST /api/agents/socialGET /api/draftsGET /api/drafts/[id]PATCH /api/drafts/[id]POST /api/uploadsGET /api/uploads/[filename]
- Next.js 14
- TypeScript
- Tailwind CSS
- Minimal shadcn-style UI primitives in
src/components/ui - OpenAI SDK for model-backed generation when configured
react-markdown+rehype-highlightfor draft previewjsdom+@mozilla/readabilityfor URL/article extraction- Optional Supabase persistence
- Optional Vercel Blob uploads
- Vitest for core generation tests
src/
app/
page.tsx # Main studio UI
drafts/[id]/page.tsx # Review/edit/share screen
api/
agents/*/route.ts # Four content agent endpoints
drafts/route.ts # List drafts
drafts/[id]/route.ts # Read/update a draft
uploads/route.ts # Upload PDFs
uploads/[filename]/route.ts
components/
studio-form.tsx
review-client.tsx
recent-drafts.tsx
markdown-renderer.tsx
ui/
lib/
agents.ts # Agent orchestration and fallbacks
draft-store.ts # Supabase or local JSON persistence
summary.ts # URL extraction and chunking helpers
uploads.ts # Vercel Blob or local file storage
research.ts # Suggested web sources
types.ts
data/
drafts.json # Local fallback persistence
The app uses two storage modes:
- Supabase if both of these are set:
NEXT_PUBLIC_SUPABASE_URLSUPABASE_SERVICE_ROLE_KEY
- Local JSON fallback if Supabase is not configured:
- Drafts are stored in
data/drafts.json
- Drafts are stored in
PDF uploads also support two modes:
- Vercel Blob if
BLOB_READ_WRITE_TOKENis set - Local file fallback in
data/uploads/if Blob is not configured
If OPENAI_API_KEY is set, the app uses OpenAI for draft generation.
If it is not set, the app falls back to deterministic template-based output so the UI and workflow still function locally.
Summary generation supports:
- URL summarization through article extraction
- Text-based fallback summarization from notes
- Optional delegation to an external Python service for PDF-heavy workflows
If the Python service is not configured, the app still works, but uploaded PDFs do not go through a full PyMuPDF pipeline.
Install dependencies:
npm installStart the app:
npm run devOpen:
http://localhost:3000
These all pass in the current implementation:
npm run test
npm run lint
npm run build