An AI-powered chatbot that understands user requirements and helps execute tasks through personalized, efficient, and automated conversations.
Velora AI is a full-stack chatbot application built with React, Vite, Node.js, Express, MongoDB, and the OpenAI API. Users can create an account, manage conversations, continue previous chats, and receive AI-generated responses through a responsive web interface.
- 🔐 User signup, login, logout, and session handling
- 🛡️ JWT-protected API routes with password hashing via bcrypt
- 💬 Create, open, continue, and delete conversations
- 🗃️ Persistent chat history stored in MongoDB
- 🤖 OpenAI-powered assistant responses
- 🧪 Built-in demo assistant fallback when the OpenAI API is unavailable
- 📝 Markdown rendering with GitHub Flavored Markdown support
- 💻 Syntax-highlighted code blocks with copy support
- 📱 Responsive layout with mobile sidebar navigation
- ⚡ Loading states, error banners, auto-scroll, and protected routes
- 🔧 Vite development proxy and configurable API base URL
- React 19
- Vite
- React Router
- Axios
- React Markdown
- Remark GFM
- Rehype Highlight
- Highlight.js
- Lucide React
- Node.js
- Express 5
- Mongoose
- MongoDB
- JSON Web Tokens
- bcryptjs
- OpenAI Node SDK
- dotenv
- Morgan
Velora-AI/
├── 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
Make sure the following are installed before starting:
- Node.js 18 or newer
- npm
- MongoDB locally or a MongoDB Atlas cluster
- An OpenAI API key, if you want to use live AI responses
git clone https://github.com/dk5847001-stack/Velora-AI.git
cd Velora-AICreate environment files from the provided examples.
Copy-Item server\.env.example server\.env
Copy-Item client\.env.example client\.envcp server/.env.example server/.env
cp client/.env.example client/.envUpdate server/.env with your local configuration:
PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://127.0.0.1:27017/velora-chat
JWT_SECRET=replace-with-a-long-random-secret
OPENAI_API_KEY=your-openai-api-key
OPENAI_MODEL=gpt-5-mini
OPENAI_MAX_OUTPUT_TOKENS=1200
FORCE_DEMO_MODE=false
CLIENT_URL=http://localhost:5173Update client/.env if your API is running on a different URL:
VITE_API_BASE_URL=http://localhost:5000/apiKeep
.envfiles private. Never commit API keys, database credentials, or JWT secrets to the repository.
Install the backend dependencies:
cd server
npm installInstall the frontend dependencies:
cd ../client
npm installStart the backend development server in one terminal:
cd server
npm run devStart the frontend development server in a second terminal:
cd client
npm run devOpen the application at:
- Frontend:
http://localhost:5173 - API:
http://localhost:5000
Build the frontend for production:
cd client
npm run buildThe generated files are placed in client/dist.
To preview the production build locally:
npm run previewStart the backend in production mode with:
cd ../server
npm start| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/signup |
Create a new user account |
POST |
/api/auth/login |
Authenticate a user |
POST |
/api/auth/logout |
Acknowledge user logout |
GET |
/api/auth/me |
Return the authenticated user |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/chats |
List the authenticated user's chats |
POST |
/api/chats |
Create a new chat |
GET |
/api/chats/:chatId |
Get a specific chat |
POST |
/api/chats/:chatId/messages |
Send a message to a chat |
DELETE |
/api/chats/:chatId |
Delete a chat |
OPENAI_API_KEYenables live OpenAI responses.- Set
FORCE_DEMO_MODE=trueto use demo responses intentionally. - If the OpenAI key is missing or the provider is temporarily unavailable, the server uses built-in demo assistant responses.
VITE_API_BASE_URLcontrols the API URL used by the client.- The Vite
/apiproxy is available for local development. - Logout uses client-side token removal with a server acknowledgement endpoint, which is suitable for the stateless JWT flow used by this project.
- Use a long, randomly generated
JWT_SECRET. - Do not expose
.envfiles or API keys publicly. - Use HTTPS in production.
- Restrict
CLIENT_URLto trusted frontend origins. - Use a dedicated production MongoDB database and credentials.
- Rotate exposed secrets immediately if they are accidentally committed.
Contributions, ideas, and bug reports are welcome.
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature. - Make your changes and test them locally.
- Commit your work:
git commit -m "Add your change". - Push the branch and open a pull request.
No license has been specified for this repository yet. If you plan to accept external contributions or distribute the project, add an appropriate license file.
Built by dk5847001-stack.