Deepak-GPT is a full-stack chatbot application built with Django as the backend and React (Vite) as the frontend. The chatbot uses OpenAI's GPT-4o-mini model to generate intelligent responses.
The project allows users to interact with an AI assistant similar to ChatGPT, directly from the web interface.
- Real-time chat interface
- AI-powered responses using OpenAI API
- Responsive frontend with Tailwind CSS
- Concurrent development setup for React and Django
- Environment variable support for API keys
ChatBot/
├── backend/ # Django project
│ ├── manage.py
│ ├── ...
├── frontend/ # React project (Vite)
│ ├── src/
│ ├── package.json
│ ├── vite.config.js
├── .env # Environment variables (OpenAI API key)
├── package.json # Root package.json for concurrently
- Python 3.10+
- Node.js 20+
- npm
cd backend
python -m venv .venv
source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # Windows
pip install -r requirements.txtcd frontend
npm installnpm install concurrently --save-devCreate a .env file in the backend folder:
OPENAI_API_KEY=your_openai_api_key_here
Create a .env file in the frontend folder:
VITE_API_URL=/api/chat/
From the root folder, run:
npm run devThis will start:
- React frontend: http://localhost:5173
- Django backend: http://127.0.0.1:8000
- Build React:
cd frontend
npm run build- Copy
dist/to Django static files - Configure Django
urls.pyandviews.pyto serveindex.html - Run
collectstaticand deploy backend
- Deploy Django API on a server (Render, Railway, Heroku)
- Deploy React frontend on Netlify/Vercel
- Update frontend
VITE_API_URLwith deployed backend URL - Add CORS headers in Django
- Open the frontend in a browser
- Type a message in the chat input
- Press Enter or click Send
- The bot will respond using GPT-4o-mini
- Django
- Django REST Framework
- OpenAI Python SDK
- python-dotenv
- React 19
- Vite
- Axios
- Tailwind CSS
MIT