A full-featured ChatGPT clone with chat, image generation, search, and file attachments.
- Chat: Real-time streaming responses with GPT-4o
- Image Generation: Create images with DALL-E 3
- Search Mode: Get information on topics
- File Attachments: Upload images and text files
- Chat History: Persistent chat storage
- Delete Chats: Remove unwanted conversations
-
Install dependencies:
npm run install-all
-
Configure API Key: Edit
.envfile and add your OpenAI API key:OPENAI_API_KEY=sk-your-api-key-here -
Start the app:
npm run dev
-
Open http://localhost:3000 in your browser
ChatGptClone/
├── server/
│ ├── index.js # Express backend
│ ├── data/ # Chat storage
│ └── uploads/ # Uploaded files
├── client/
│ ├── src/
│ │ ├── App.jsx
│ │ ├── components/
│ │ │ ├── Sidebar.jsx
│ │ │ ├── ChatArea.jsx
│ │ │ ├── InputArea.jsx
│ │ │ └── ImageModal.jsx
│ │ └── styles/
│ │ └── index.css
│ └── index.html
├── .env # Your API key (create this)
├── .env.example # Example env file
└── package.json
GET /api/chats- List all chatsPOST /api/chats- Create new chatGET /api/chats/:id- Get chat by IDDELETE /api/chats/:id- Delete chatPOST /api/chats/:id/messages- Send message (streaming)POST /api/upload- Upload filePOST /api/generate-image- Generate image with DALL-EPOST /api/search- Search query