Klark is a micro SaaS platform that enables intelligent interaction with PDF documents using advanced AI capabilities. Built with modern technologies, it provides document summarization and an AI-powered chat interface for querying document content.
-
📑 PDF Document Processing
- Document uploading and storage
- Automatic text extraction and analysis
- Document summarization
-
💬 Interactive Chat Interface
- Real-time streaming responses
- Context-aware document querying
- Chat history analysis
- Intelligent question generation
-
🔒 Security & Authentication
- Secure user authentication via Lucia
- Document access control
- Session management
-
💳 Payment Integration
- Stripe payment processing
- Subscription management
- Usage tracking
- Next.js with TypeScript
- Tailwind CSS for styling
- ShadCN/UI component library
- tRPC for type-safe API calls
- LangChain.js for AI operations
- OpenAI API for language processing
- ChromaDB for vector embeddings
- PostgreSQL with Drizzle ORM
- MinIO for PDF storage
- tRPC SSE for real-time streaming
- Docker for containerization
- Traefik as reverse proxy and load balancer
- GitHub Actions for CI/CD
- Watchtower for automated deployments
- Node.js 18+
- Docker and Docker Compose
- PostgreSQL
- MinIO
- ChromaDB
- OpenAI API key
- Clone the repository:
git clone https://github.com/yourusername/klark.git
cd klark
- Install dependencies:
pnpm install
- Create a
.env
file with the following variables:
DATABASE_URL=
OPENAI_API_KEY=
MINIO_ROOT_USER=
MINIO_ROOT_PASSWORD=
MINIO_ENDPOINT=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
- Initialize the database:
pnpm db:push
- Start the development environment:
docker-compose -f docker-compose.local.yml up -d
pnpm dev
- Run the setup script:
./scripts/setup.sh
- Build the application:
pnpm build
- Deploy using Docker Compose:
docker-compose up -d
.
├── src/
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ ├── lib/ # Utility functions
│ ├── server/ # Server-side code
│ └── trpc/ # tRPC configurations
├── drizzle/ # Database migrations
├── public/ # Static assets
└── scripts/ # Utility scripts
- Automatic text extraction from PDFs
- Document chunking and embedding generation
- Vector storage in ChromaDB for efficient retrieval
- Real-time streaming responses using tRPC SSE
- Context-aware document querying
- Intelligent follow-up question generation
- Chat history analysis for better context understanding
- User authentication and session management with Lucia
- Secure document access control
- Role-based permissions
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
For support, please open an issue in the GitHub repository or contact the maintainers.
Built with ❤️ using Next.js.