Skip to content

NestJS-based backend for a simple ChatGPT clone, handling AI chat functionality and OpenAI integration.

ZiadGamalDev/chatgpt-clone-backend

Repository files navigation

ChatGPT Clone – Backend 🧠

This repository contains the backend code for the ChatGPT Clone Frontend, built using NestJS and integrated with OpenAI API.

🚀 Features

  • 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.

🧱 Technologies Used

  • NestJS (TypeScript)
  • OpenAI SDK
  • Axios / HTTP Client
  • Node.js

📁 Project Structure

src/
├── chat/
│   ├── chat.controller.ts
│   ├── chat.service.ts
│   └── chat.schema.ts
├── openai/
│   ├── openai.controller.ts
│   ├── openai.service.ts
├── main.ts

🛠️ Setup

  1. Clone the repo:

    git clone https://github.com/ZiadGamalDev/chatgpt-clone-backend.git
    cd chatgpt-clone-backend
  2. Install dependencies:

    npm install
  3. Create .env file:

    OPENAI_API_KEY=your_openai_key
  4. Run the server:

    npm run start

Server will run at http://localhost:3001 (or your configured port).

🌐 Production Deployment

The backend is deployed and running at: https://chatgpt-clone-backend.dinamo-app.com/

🌐 Frontend Repo

👉 ChatGPT Clone Frontend

📜 License

MIT License

About

NestJS-based backend for a simple ChatGPT clone, handling AI chat functionality and OpenAI integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published