DocuMind is a SaaS application that uses Google's Gemini 1.5 Flash to help users summarize, rewrite, and analyze documents in seconds. Built with Next.js 16, it features real-time AI streaming, PDF text extraction, and a robust rate-limiting system.
(Replace this link with your actual screenshot from the landing page)
- Framework: Next.js 16 (App Router, Server Actions)
- Language: TypeScript
- AI Model: Google Gemini 1.5 Flash (via Vercel AI SDK)
- Database: PostgreSQL (Neon)
- ORM: Drizzle ORM
- Authentication: Clerk
- Styling: Tailwind CSS & Shadcn UI
- Rate Limiting: Upstash Redis
- File Parsing:
pdf-parse(Server-side PDF extraction)
- 📄 PDF & Text Support: Upload PDF files or write generic text. The app automatically parses binary files into editable text.
- ⚡ Real-Time Streaming: AI responses stream instantly to the client, providing a "chat-like" experience without loading spinners.
- 🛡️ Rate Limiting: Built-in protection using Redis to limit free users to 3 generations per day.
- 📝 Live Editor: Edit original documents and AI outputs side-by-side. Changes are saved to the database automatically.
- 🔐 Secure Auth: Full authentication flow (Sign Up, Login, Protected Routes) using Clerk.
- 📱 Responsive: Fully responsive dashboard and landing page designed with a mobile-first approach.
- Node.js 18+
- A Clerk account
- A Neon (Postgres) account
- A Google AI Studio API Key
- An Upstash (Redis) account
git clone [https://github.com/yourusername/documind.git](https://github.com/yourusername/documind.git)
cd documindnpm install
# or
yarn install
# or
pnpm install
# or
bun installCreate a .env.local file in the root directory and add the following variables:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your-clerk-publishable-key
CLERK_SECRET_KEY=your-clerk-secret-key
CLERK_WEBHOOK_SECRET=your-clerk-webhook-secret
# Neon (PostgreSQL)
DATABASE_URL=postgresql://username:password@host:port/database
# Upstash Redis
UPSTASH_REDIS_REST_URL=your-upstash-redis-url
UPSTASH_REDIS_REST_TOKEN=your-upstash-redis-token
# Google AI Studio
GOOGLE_API_KEY=your-google-api-keynpm run db:pushnpm run devOpen http://localhost:3000 with your browser to see the result.
To hadle PDF parsing on the server without building errors, next.config.js must include pdf-parse in serverExternalPackages:
const nextConfig = {
experimental: {
serverActions: {
bodySizeLimit: "5mb",
},
},
serverExternalPackages: ["pdf-parse"],
};