Intelligent document processing powered by LLM APIs — extract structured data from any document using OCR and AI, built with Next.js, TypeScript, and Firebase.
- 🔍 AI-powered OCR — Extract text and structured data from images and PDFs using LLM vision APIs
- ⚡ Real-time processing — Live document processing status with Firebase Realtime updates
- 🗂️ Document storage — Upload, organize, and retrieve processed documents via Firestore
- 🧠 Structured extraction — Parse invoices, forms, and contracts into clean structured JSON output
- 🔐 Auth & permissions — Firebase Authentication with role-based access to documents
- 📱 Responsive UI — Works on desktop and mobile with a clean, intuitive interface
📄 Upload document
↓
🔥 Firebase Storage
↓
🧠 LLM API (vision model)
↓
📊 Structured JSON output
↓
🗄️ Firestore (save & retrieve)
| Technology | Role |
|---|---|
| Next.js 14 (App Router) | React framework with server components and API routes |
| TypeScript | End-to-end type safety across the entire codebase |
| Firebase | Auth, Firestore, Storage, and Cloud Functions |
| LLM API (OpenAI / Anthropic / Gemini) | Vision-capable language models for intelligent OCR extraction |
- Node.js 18+
- Firebase project configured
- LLM API key (OpenAI, Anthropic, or Gemini)
# Clone the repository
git clone https://github.com/your-user/smart-docs.git
cd smart-docs
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env.local
# Start development server
npm run devOpen http://localhost:3000 in your browser.
Create a .env.local file at the root of the project with the following variables:
# Firebase (client)
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
# Firebase Admin SDK (server-side)
FIREBASE_ADMIN_PRIVATE_KEY=your_private_key
FIREBASE_ADMIN_CLIENT_EMAIL=your_client_email
# LLM API
LLM_API_KEY=your_llm_api_key
LLM_MODEL=gpt-4o # or claude-3-5-sonnet, gemini-1.5-pro, etc.smart-docs/
├── app/ # Next.js App Router
│ ├── api/ # API routes (OCR processing)
│ ├── dashboard/ # Document management UI
│ └── layout.tsx
├── components/ # Reusable React components
├── lib/
│ ├── firebase/ # Firebase client & admin config
│ └── llm/ # LLM API integration
├── types/ # TypeScript type definitions
└── .env.example
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run typecheck # Run TypeScript type checkContributions are welcome! Please open an issue first to discuss what you would like to change.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT — free to use, modify, and distribute. See LICENSE for details.
Made with ❤️ using Next.js, Firebase & LLM APIs