A full-stack ChatGPT clone built with React + Node.js, powered by OpenAI GPT-4.1. Feature-rich AI chatbot with chat history, markdown rendering, dark mode themes, and a clean mint-themed UI.
A modern AI chat assistant built with React + Vite (frontend) and Node.js + Express (backend), powered by the OpenAI GPT-4.1 API.
- Clean, mint-themed chat UI with dark mode themes
- Chat history stored in localStorage (create, switch, delete chats)
- Rich text responses (markdown: bold, bullets, headings, code)
- 5 background color themes
- Rate-limited backend with security headers
- Fully responsive layout
| Layer | Tech |
|---|---|
| Frontend | React 19.2, Vite (rolldown-vite 7.3), Tailwind CSS v4 |
| Backend | Node.js, Express 5 |
| AI | OpenAI GPT-4.1 (/v1/responses) |
| Security | helmet, express-rate-limit |
MintAI/
├── backend/
│ ├── server.js # Express API server
│ ├── .env # Your secrets (not committed)
│ ├── .env.example # Template for .env
│ └── package.json
└── frontend/
├── src/
│ ├── App.jsx # Main React app
│ ├── App.css
│ ├── index.css # Tailwind imports, animations & global styles
│ └── main.jsx
├── public/
│ └── mint.svg # Favicon
├── index.html
├── vite.config.js
├── postcss.config.js
├── eslint.config.js
├── .env # Frontend env vars (not committed)
├── .env.example # Template for .env
└── package.json
- Node.js v18 or higher
- An OpenAI API key (see below)
- Go to platform.openai.com and sign up or log in
- Click your profile icon (top-right) → Your profile → API keys
- Click + Create new secret key, give it a name, and click Create secret key
- Copy the key — it starts with
sk-and is only shown once - Paste it as
OPENAI_KEYinbackend/.env
Note: The GPT-4.1 model requires a paid OpenAI account with available credits.
git clone <your-repo-url>
cd MintAIcd backend
cp .env.example .envOpen backend/.env and fill in your values:
OPENAI_KEY=sk-your-openai-key-here
PORT=5001
CLIENT_ORIGIN=http://localhost:5174Install dependencies and start the backend:
npm install
npm run dev # development (auto-restarts on change)
# or
npm start # productionThe backend runs at http://localhost:5001
cd ../frontend
cp .env.example .envThe default .env points to the local backend — no changes needed for local development:
VITE_API_URL=http://localhost:5001Install dependencies and start the frontend:
npm install
npm run devThe app opens at http://localhost:5174
# Frontend
cd frontend
npm run build # outputs to dist/
# Backend
cd backend
npm start # runs with node (no nodemon)For deployment, set CLIENT_ORIGIN in the backend .env to your frontend's production URL, and set VITE_API_URL in the frontend .env to your backend's production URL before building.
| Variable | Description | Default |
|---|---|---|
OPENAI_KEY |
Your OpenAI API key | — |
PORT |
Port the backend listens on | 5001 |
CLIENT_ORIGIN |
Allowed frontend origin for CORS | http://localhost:5174 |
| Variable | Description | Default |
|---|---|---|
VITE_API_URL |
Backend API base URL | http://localhost:5001 |
