doc: update:31 doc: update:32 doc: update:33 doc: update:34 doc: update:35 doc: update:36 doc: update:37 doc: update:38 doc: update:39 doc: update:40
Velora is a full-stack AI chatbot web app built with a React + Vite client and a Node.js + Express API. It includes JWT authentication, MongoDB chat persistence, OpenAI integration, responsive dark-mode UI, Markdown rendering, syntax-highlighted code blocks, and recent conversation history.
- Frontend: React, Vite, React Router, Axios
- Backend: Node.js, Express, Mongoose
- Database: MongoDB
- Authentication: JWT + bcrypt
- AI provider: OpenAI API
chatGpt/
|-- client/
| |-- .env.example
| |-- index.html
| |-- package.json
| |-- vite.config.js
| `-- src/
| |-- api/
| |-- components/
| |-- context/
| |-- hooks/
| |-- pages/
| |-- utils/
| |-- App.jsx
| |-- index.css
| `-- main.jsx
|-- server/
| |-- .env.example
| |-- package.json
| `-- src/
| |-- config/
| |-- controllers/
| |-- middleware/
| |-- models/
| |-- routes/
| |-- services/
| |-- utils/
| |-- app.js
| `-- server.js
`-- README.md
- Create environment files:
Copy-Item server\.env.example server\.env
Copy-Item client\.env.example client\.env- Update the values in
server/.env:
MONGODB_URI: your local MongoDB or MongoDB Atlas connection stringJWT_SECRET: any long random secretOPENAI_API_KEY: your OpenAI API keyOPENAI_MODEL: defaults togpt-5-miniCLIENT_URL: defaults tohttp://localhost:5173
- Install dependencies:
cd server
npm.cmd install
cd ..\client
npm.cmd installStart the API server:
cd server
npm.cmd run devStart the Vite client in a second terminal:
cd client
npm.cmd run devClient URL: http://localhost:5173
API URL: http://localhost:5000
cd client
npm.cmd run buildThe production files are written to client/dist.
POST /api/auth/signupPOST /api/auth/loginPOST /api/auth/logoutGET /api/auth/me
GET /api/chatsPOST /api/chatsGET /api/chats/:chatIdPOST /api/chats/:chatId/messagesDELETE /api/chats/:chatId
- Signup, login, logout
- Protected API routes with JWT middleware
- Create, open, continue, and delete chats
- Chat history stored in MongoDB
- OpenAI-generated assistant replies saved with each conversation
- Markdown rendering with code block copy buttons
- Loading states, error banners, mobile sidebar, and auto-scroll behavior
- Logout is implemented as client-side token removal with a server acknowledgement endpoint, which is typical for stateless JWT flows.
- The client uses
VITE_API_BASE_URLand also includes a Vite/apiproxy for local development. - The backend uses the OpenAI Responses API and stores conversation history in MongoDB.
- When
OPENAI_API_KEYis missing or the provider is temporarily unavailable, the server falls back to its built-in demo assistant responses.