AI document intelligence workspace for turning PDFs into structured summaries, risk flags, key clauses, financial highlights, and comparison insights.
Briefd helps users understand long documents without reading every page first.
Upload a contract, pitch deck, financial report, or other text-based PDF to generate a structured brief containing:
- An executive summary
- Key clauses
- Risk flags and an overall risk score
- Financial highlights
- Recommended actions
- Estimated reading time
Analyses can be saved, searched, compared, grouped into collections, exported, shared through public links, and explored through document Q&A.
The product supports a guest-first workflow, so users can start without creating an account and sign in later to sync their saved workspace.
- Structured document analysis — turn PDFs into clear summaries, clauses, risks, financial highlights, and recommended actions
- Risk intelligence — surface critical, moderate, and low-risk findings with an overall score
- Document comparison — compare two saved briefs across risks, clauses, and financial information
- Ask this document — explore a completed analysis through natural-language questions
- Dashboard — search, filter, sort, reopen, rename, and manage saved analyses
- Collections — organize related documents by deal, client, project, or research topic
- Guest mode — analyze and save work without creating an account
- Account sync — sign in to access saved analyses and collections across devices
- Export and sharing — export briefs and create token-based public share links
- Preferences and privacy controls — manage appearance, AI model preference, saved data, and account settings
-
Upload a PDF
Briefd extracts text from the document on the server. -
Generate a structured brief
The extracted text is sent to an LLM through OpenRouter and returned as structured analysis data. -
Review and organize
Save the result, compare it with another document, add it to a collection, export it, or share it.
| Route | Purpose |
|---|---|
/ |
Product landing page |
/app |
Upload and analyze a PDF |
/analysis/[id] |
Review a saved analysis |
/dashboard |
Browse and manage saved analyses |
/collections |
Organize analyses into collections |
/compare |
Compare two saved documents |
/settings |
Manage account, sync, data, and preferences |
/guide |
Product documentation and usage guide |
/share/[token] |
Read-only public analysis view |
- Next.js 16 with the App Router
- React 19
- TypeScript
- Tailwind CSS 4
- Framer Motion
- Lucide React
- next-themes
- Supabase
- PostgreSQL
- Supabase Authentication
- Row Level Security
- Guest and authenticated ownership scopes
- OpenRouter
- Streaming LLM responses
- Multi-model fallback handling
pdf-parse- Structured JSON analysis
- jsPDF
Briefd uses the Next.js App Router for pages, layouts, and server-side API routes.
- The client validates and uploads a PDF to
POST /api/analyze. - The server extracts text using
pdf-parse. - Extracted text is sent to OpenRouter with a strict structured-output prompt.
- The route streams generated JSON back to the client.
- The completed result can be saved to Supabase.
The analyzer attempts the user's preferred model first when configured, then falls back through the application's available model list when a provider is rate-limited or unavailable.
Briefd supports two ownership modes:
- Guest users are scoped through a device identifier.
- Authenticated users are scoped through their Supabase user ID.
Saved analyses and collections remain isolated by ownership scope. Authenticated database records also use Row Level Security policies.
The browser uses the Supabase anonymous key for authentication. The application stores the authenticated session in secure HTTP-only cookies for server-side access.
Saved analyses can receive a unique share token. Public share routes return only the fields needed to display the read-only shared brief.
The included Supabase schema creates:
analysescollectionscollection_analysesprofiles
The schema also includes indexes, update triggers, ownership fields, and Row Level Security policies.
The original uploaded PDF is not stored by the included database schema. Briefd stores document metadata, structured analysis results, sharing data, and chat history.
- Node.js 20.9 or newer
- npm
- A Supabase project
- An OpenRouter API key
git clone https://github.com/abdelazizBi/briefd.git
cd briefdnpm installCopy the example environment file:
cp .env.example .env.localAdd your values to .env.local:
# OpenRouter — server only
OPENROUTER_API_KEY=
# Supabase
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
# Supabase service role — server only
SUPABASE_SERVICE_ROLE_KEY=| Variable | Scope | Purpose |
|---|---|---|
OPENROUTER_API_KEY |
Server only | Sends extracted document text to the configured AI models |
NEXT_PUBLIC_SUPABASE_URL |
Browser and server | Identifies the Supabase project |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Browser and server | Supports browser authentication and authorized client access |
SUPABASE_SERVICE_ROLE_KEY |
Server only | Performs trusted server-side database operations |
SUPABASE_SERVICE_ROLE_KEYbypasses Row Level Security. Never expose it to browser code, commit it to Git, or prefix it withNEXT_PUBLIC_.
Open the Supabase SQL Editor and run:
supabase/schema.sql
This creates the required tables, indexes, triggers, and policies.
Enable the authentication provider you want to use in the Supabase dashboard and add the correct local and production redirect URLs.
The application can still be used in guest mode without signing in.
npm run devOpen:
http://localhost:3000
| Command | Description |
|---|---|
npm run dev |
Start the development server with Webpack |
npm run build |
Create a production build |
npm run start |
Start the production server |
npm run lint |
Run ESLint |
npm run typecheck |
Run TypeScript validation |
Link your Supabase project once:
npx supabase link --project-ref YOUR_PROJECT_REFThen regenerate the types:
npm run db:typesBefore deploying changes:
npm run lint
npm run typecheck
npm run buildBriefd is designed for deployment on Vercel with Supabase as the database and authentication provider.
Add these environment variables to the production project:
OPENROUTER_API_KEY=
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=Then:
- Run
supabase/schema.sqlagainst the production Supabase project. - Configure the production authentication redirect URLs in Supabase.
- Add the environment variables in Vercel.
- Deploy the application.
- OpenRouter receives extracted document text so the configured AI model can analyze it.
- The original PDF file is not stored by the included database schema.
- The service-role key is used only in server-side code.
- Authenticated records are protected by ownership checks and Row Level Security policies.
- Guest records are scoped to a device identifier.
- Public analysis pages require a unique share token.
- AI-generated analysis should be reviewed before it is used for legal, financial, or business decisions.
Do not upload confidential or regulated documents unless you understand and accept the data-handling policies of your hosting, database, and AI providers.
- Only PDF files are accepted.
- Image-only, scanned, or encrypted PDFs may fail because OCR is not included.
- The application validates files up to 10 MB, but serverless platform request limits may reduce the practical upload size.
- Very long extracted documents are truncated before analysis.
- AI providers can be rate-limited or temporarily unavailable.
- Generated summaries, scores, and recommendations may be incomplete or inaccurate.
- The risk score is a triage aid, not a legal, financial, or compliance assessment.
- Public share links should be revoked when they are no longer needed.
src/
├── app/
│ ├── analysis/[id]/ # Saved analysis workspace
│ ├── api/ # Server-side API routes
│ ├── app/ # Upload and analysis flow
│ ├── auth/callback/ # Authentication callback
│ ├── collections/ # Collection management
│ ├── compare/ # Document comparison
│ ├── dashboard/ # Saved analysis library
│ ├── guide/ # User guide
│ ├── settings/ # Account, data, and preferences
│ └── share/[token]/ # Public shared analysis
├── components/
│ ├── analysis/ # Upload, results, chat, and comparison UI
│ ├── collections/ # Collection interfaces
│ ├── dashboard/ # Dashboard cards and controls
│ ├── guide/ # Guide visuals and navigation
│ ├── landing/ # Marketing page sections
│ ├── layout/ # Shared application shell
│ └── ui/ # Reusable interface components
├── lib/
│ ├── auth/ # Authentication and viewer scope
│ ├── analysis-store.ts # Analysis persistence
│ ├── collections-store.ts
│ ├── ownership.ts # Guest and user ownership filters
│ ├── profile-store.ts # Account preferences
│ └── supabase.ts # Server-side Supabase client
└── types/ # Generated and shared TypeScript types
supabase/
└── schema.sql # Database schema, indexes, and RLS policies
public/
└── briefd-preview.png # README preview image
Built by Abdelaziz Biad, Senior Full-Stack Engineer.
