A full-stack AI-powered chat application with real-time conversations, persistent chat history, and modern UI.
Live Demo: gpt-app-backend.vercel.app
QuickGPT is a full-stack AI chat application that enables users to have intelligent conversations with GPT-powered AI. Built with React and Node.js, it features user authentication, persistent chat history, and a clean, responsive interface.
- π€ AI-Powered Chat - Real-time conversations with OpenAI GPT
- π User Authentication - Secure signup and login with JWT
- πΎ Chat History - Persistent conversation storage in MongoDB
- πΌοΈ Image Support - Image generation and handling capabilities
- π¨ Modern UI - Clean interface built with TailwindCSS
- π± Responsive Design - Works seamlessly across all devices
- β‘ Fast & Lightweight - Built with Vite for optimal performance
- π Secure - JWT-based authentication and protected routes
- Framework: React 18 with Vite
- Routing: React Router DOM
- State Management: Context API
- Styling: TailwindCSS
- HTTP Client: Axios
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose
- Authentication: JWT (JSON Web Tokens)
- AI Integration: OpenAI API
- Image Service: ImageKit
gpt-app/
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # React components
β β βββ context/ # Context providers
β β βββ pages/ # Page components
β β βββ App.jsx # Main app component
β βββ public/ # Static assets
β βββ package.json
β
βββ backend/ # Node.js backend server
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ controllers/ # Request handlers
β βββ middleware/ # Custom middleware
β βββ server.js # Entry point
β
βββ .gitignore
βββ package.json
βββ README.md
- Node.js (v16 or higher)
- MongoDB (local or Atlas)
- OpenAI API Key
- ImageKit Account (optional)
-
Clone the repository
git clone https://github.com/Prateet-Github/gpt-app.git cd gpt-app -
Install dependencies
# Install root dependencies npm install # Install frontend dependencies cd frontend npm install # Install backend dependencies cd ../backend npm install
-
Set up environment variables
Backend
.envfile:PORT=5000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key OPENAI_API_KEY=your_openai_api_key IMAGEKIT_PUBLIC_KEY=your_imagekit_public_key IMAGEKIT_PRIVATE_KEY=your_imagekit_private_key IMAGEKIT_URL_ENDPOINT=your_imagekit_url CLIENT_URL=http://localhost:5173
Frontend
.envfile:VITE_API_URL=http://localhost:5000/api VITE_IMAGEKIT_PUBLIC_KEY=your_imagekit_public_key VITE_IMAGEKIT_URL_ENDPOINT=your_imagekit_url
-
Start the development servers
Terminal 1 - Backend:
cd backend npm run devTerminal 2 - Frontend:
cd frontend npm run dev -
Open your browser
- Frontend:
http://localhost:5173 - Backend:
http://localhost:5000
- Frontend:
POST /api/auth/register - Register new user
POST /api/auth/login - User login
GET /api/auth/verify - Verify JWT token
GET /api/chats - Get all user chats
POST /api/chats - Create new chat
GET /api/chats/:id - Get specific chat
POST /api/chats/:id - Add message to chat
DELETE /api/chats/:id - Delete chat
POST /api/messages - Send message to AI
- Secure registration and login
- JWT token-based authentication
- Protected routes and API endpoints
- Password hashing with bcrypt
- Create multiple chat sessions
- View chat history
- Delete conversations
- Real-time message updates
- OpenAI GPT API integration
- Streaming responses (if implemented)
- Context-aware conversations
- Custom system prompts
- Upload images to chat
- Image generation with AI
- ImageKit CDN integration
- Optimized image delivery
- Get API key from OpenAI Platform
- Add to backend
.envasOPENAI_API_KEY - Configure model in backend code (default:
gpt-3.5-turbo)
- Create account at ImageKit.io
- Get Public Key, Private Key, and URL Endpoint
- Add credentials to both frontend and backend
.env
Local MongoDB:
# Start MongoDB service
mongodMongoDB Atlas:
- Create cluster at MongoDB Atlas
- Get connection string
- Add to
.envasMONGODB_URI
-
Prepare for deployment
cd backend -
Create
vercel.json{ "version": 2, "builds": [ { "src": "server.js", "use": "@vercel/node" } ], "routes": [ { "src": "/(.*)", "dest": "server.js" } ] } -
Deploy
vercel --prod
-
Set environment variables in Vercel dashboard
-
Build the frontend
cd frontend npm run build -
Deploy
vercel --prod
-
Update API URL in frontend
.envto your deployed backend URL
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production buildnpm start # Start production server
npm run dev # Start with nodemon (hot reload)- JWT token authentication
- Password hashing with bcrypt
- Protected API routes
- CORS configuration
- Environment variable protection
- Input validation and sanitization
- Voice input/output support
- Markdown rendering in chat
- Code syntax highlighting
- Export chat history
- Multiple AI model selection
- Dark/Light theme toggle
- Chat sharing functionality
- Real-time collaboration
- Mobile app version
- Image generation requires ImageKit configuration
- Large responses may take time to load
- Mobile optimization ongoing
Contributions are welcome! Here's how:
- Fork the repository
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
Prateet Tiwari
- GitHub: @Prateet-Github
- LinkedIn: prateet-tiwari
- Email: prateettiwari29@gmail.com
β If you like this project, please give it a star on GitHub! β
Made with β€οΈ by Prateet Tiwari