This repository contains the backend code for the ChatGPT Clone Frontend, built using NestJS and integrated with OpenAI API.
- RESTful API to handle user chat input.
- Connects to OpenAI to get AI-generated responses.
- Modular NestJS structure.
- Smooth integration with the frontend via HTTP.
- NestJS (TypeScript)
- OpenAI SDK
- Axios / HTTP Client
- Node.js
src/
├── chat/
│ ├── chat.controller.ts
│ ├── chat.service.ts
│ └── chat.schema.ts
├── openai/
│ ├── openai.controller.ts
│ ├── openai.service.ts
├── main.ts
-
Clone the repo:
git clone https://github.com/ZiadGamalDev/chatgpt-clone-backend.git cd chatgpt-clone-backend -
Install dependencies:
npm install
-
Create
.envfile:OPENAI_API_KEY=your_openai_key
-
Run the server:
npm run start
Server will run at http://localhost:3001 (or your configured port).
The backend is deployed and running at: https://chatgpt-clone-backend.dinamo-app.com/
MIT License