A modern, intelligent AI chat application built with Next.js 15, React 19, and TypeScript. This client application provides a sleek interface for interacting with multiple AI models, document analysis, web search, and more.
- Access to cutting-edge AI models including GPT-4, Claude, Gemini, and more
- OpenRouter integration for seamless model switching
- Real-time AI conversations with context awareness
- Natural, context-aware conversations
- Chat history and conversation management
- Message persistence and synchronization
- Real-time typing indicators and responses
- PDF upload and analysis capability
- AI-powered document insights and summaries
- Text extraction and processing
- File management with Cloudinary integration
- Real-time web search capabilities
- Current events and up-to-date information
- Web content analysis and summarization
- Beautiful, responsive design with Tailwind CSS
- Dark/light theme support
- Mobile-first responsive layout
- Smooth animations and transitions
- Radix UI components for accessibility
- Secure user authentication
- JWT token management
- Protected routes and middleware
- User session management
- Stripe integration for payments
- Multiple subscription tiers (Free, Pro+, Ultra)
- Trial period management
- Usage tracking and limits
- Voice dictation for messages
- Speech-to-text integration
- Audio input support
- Next.js 15 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript - Type-safe development
- Tailwind CSS 4 - Utility-first CSS framework
- Radix UI - Accessible component primitives
- Lucide React - Beautiful icon library
- Class Variance Authority - Component variant management
- AI SDK - Vercel AI SDK for AI integration
- LangChain - AI application framework
- OpenRouter - Multi-model AI provider
- Google AI - Gemini model integration
- React PDF - PDF viewing and processing
- Cloudinary - Image and file management
- PDF.js - Client-side PDF handling
- Zustand (via chat store) - Lightweight state management
- React Context - Authentication and subscription state
- MongoDB - Database integration
- Mongoose - MongoDB object modeling
- Stripe - Payment processing
- Stripe.js - Client-side payment integration
- ESLint - Code linting
- PostCSS - CSS processing
- Turbopack - Fast development bundler
client/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── (root)/ # Protected routes
│ │ │ ├── chat/ # Chat interface
│ │ │ │ ├── [id]/ # Individual chat page
│ │ │ │ └── new/ # New chat page
│ │ │ ├── settings/ # User settings & subscriptions
│ │ │ └── page.tsx # Dashboard/home page
│ │ ├── api/ # API routes
│ │ │ ├── auth/ # Authentication endpoints
│ │ │ └── stripe/ # Payment endpoints
│ │ ├── landing/ # Landing page
│ │ ├── sign-in/ # Authentication pages
│ │ ├── sign-up/
│ │ ├── layout.tsx # Root layout
│ │ └── globals.css # Global styles
│ ├── components/ # React components
│ │ ├── auth/ # Authentication components
│ │ ├── chat/ # Chat-related components
│ │ ├── ui/ # Reusable UI components
│ │ └── weather/ # Weather widget
│ ├── contexts/ # React contexts
│ │ ├── AuthContext.tsx # Authentication state
│ │ └── SubscriptionContext.tsx # Subscription state
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility libraries
│ ├── services/ # API service layer
│ │ └── api/ # API client functions
│ ├── store/ # State management
│ ├── util/ # Utility functions
│ └── middleware.ts # Next.js middleware
├── public/ # Static assets
├── components.json # Shadcn/ui configuration
├── next.config.ts # Next.js configuration
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Dependencies and scripts
- Node.js 18.x or 20.x
- npm or yarn or pnpm
- Backend API running (see server README)
-
Clone the repository
git clone <repository-url> cd deepseek.ai.client
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables
cp .env.example .env.local # Edit .env.local with your configuration -
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
Create a .env.local file in the client directory:
# API Configuration
NEXT_PUBLIC_API_URL=https://deepseek-ai-server.vercel.app/api
NEXT_PUBLIC_CLIENT_URL=https://deepseek-ai-client.vercel.app
# Stripe Configuration
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Cloudinary Configuration (if needed)
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your-cloud-name
# OpenRouter Configuration (if direct access needed)
OPENROUTER_API_KEY=sk-or-...
# Google AI Configuration (if direct access needed)
GOOGLE_AI_API_KEY=your-google-ai-keynpm run dev- Start development server with Turbopacknpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run type-check- Run TypeScript type checking
The application uses a modern component architecture:
ChatContainer- Main chat interfaceChatInput- Message input with AI integrationAuthGuard- Route protectionLoginForm- Authentication form
- Button, Card, Input - Base UI components
- Sidebar, Header - Navigation components
- ThemeToggle - Dark/light mode switcher
- DictationButton - Voice input component
- Landing Page - Unauthenticated users see the landing page
- Sign In/Up - Authentication via Google OAuth or email
- Dashboard - Authenticated users are redirected to chat
- Protected Routes - All app routes require authentication
- Limited access to features
- 14-day free trial
- Demo mode capabilities
- Access to all features
- 1000 tokens per day
- Priority support
- OpenRouter API access
- Early access to features
- 20x higher limits
- All AI models included
- Early access to features
- Premium support
- Advanced analytics
-
Connect to Vercel
npm install -g vercel vercel
-
Set environment variables in Vercel dashboard
-
Deploy
vercel --prod
The application can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- AWS Amplify
- Google Cloud Platform
- ESLint for code linting
- TypeScript for type safety
- Prettier for code formatting (recommended)
# Add your test commands here
npm run testnpm run build
npm run startCustomize styling in tailwind.config.js
Configure Next.js in next.config.ts
TypeScript configuration in tsconfig.json
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use Tailwind CSS for styling
- Implement responsive design
- Write meaningful commit messages
- Test your changes thoroughly
The client communicates with the backend API through:
- Authentication: JWT token-based authentication
- Chat Management: Real-time chat operations
- File Upload: Cloudinary integration
- Payments: Stripe subscription management
- AI Models: OpenRouter and direct model access
-
Build Errors
- Check Node.js version compatibility
- Clear
.nextfolder and rebuild - Verify environment variables
-
Authentication Issues
- Check API connection
- Verify JWT token handling
- Check CORS configuration
-
Styling Issues
- Clear Tailwind cache
- Check for conflicting CSS
- Verify component imports
-
API Connection
- Check backend server status
- Verify API URLs in environment
- Check network connectivity
- Next.js Documentation
- React Documentation
- Tailwind CSS Documentation
- Radix UI Documentation
- Stripe Documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js team for the amazing framework
- Vercel for AI SDK and deployment platform
- OpenRouter for AI model access
- Stripe for payment processing
- All the open-source contributors
Built with ❤️ using Next.js, React, and TypeScript