Lumen is a full-stack AI chat application built with the MERN stack. It features per-user authentication, persistent chat history, and a clean aesthetic UI — all containerized with Docker and backed by a CI pipeline.
- JWT Authentication — secure register, login and logout
- Per-user chat history — your conversations are saved and isolated per account
- AI responses — powered by OpenAI GPT-4o-mini
- Persistent threads — chat history survives across sessions and devices
- Dockerized — run the entire app with one command
- CI Pipeline — every push to main triggers an automated build via GitHub Actions
| Layer | Technology |
|---|---|
| Frontend | React, Vite |
| Backend | Node.js, Express |
| Database | MongoDB Atlas |
| Auth | JWT (JSON Web Tokens) |
| AI | OpenAI API (GPT-4o-mini) |
| Containerization | Docker, docker-compose |
| CI/CD | GitHub Actions |
- Docker and Docker Compose installed
- OpenAI API key
- MongoDB Atlas connection string
- Clone the repo
git clone https://github.com/Nithu2912/Lumen.git
cd Lumen- Create a
.envfile inside theBackendfolder:
OPENAI_API_KEY=your_openai_api_key
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret- Run with Docker Compose
docker-compose up --build- Open your browser
Frontend: http://localhost:5173
Backend: http://localhost:8080
Lumen/
├── Backend/
│ ├── middleware/ # JWT auth middleware
│ ├── models/ # MongoDB schemas (User, Thread)
│ ├── routes/ # API routes (auth, chat)
│ ├── utils/ # OpenAI API integration
│ ├── Dockerfile
│ └── server.js
├── Frontend/
│ ├── src/
│ │ ├── context/ # Auth context
│ │ ├── pages/ # Login, Register
│ │ └── components/ # Sidebar, ChatWindow, Chat
│ └── Dockerfile
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Actions CI pipeline
└── docker-compose.yml
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register a new user |
| POST | /api/auth/login |
Login and get JWT token |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/chat |
Send a message (protected) |
| GET | /api/thread |
Get all threads for current user (protected) |
| GET | /api/thread/:id |
Get messages for a thread (protected) |
| DELETE | /api/thread/:id |
Delete a thread (protected) |
Every push to main triggers a GitHub Actions workflow that:
- Installs backend dependencies
- Builds the frontend
- Confirms the app compiles successfully
| Variable | Description |
|---|---|
OPENAI_API_KEY |
Your OpenAI API key |
MONGODB_URI |
MongoDB Atlas connection string |
JWT_SECRET |
Secret key for signing JWT tokens |
Built by Nithu — from curiosity about OpenAI to a full production-ready stack.
"One thing led to another and I ended up building a full stack AI chat app. No plan. No roadmap. Just curiosity."
⭐ Star this repo if you found it helpful!