A sharp, elegant AI assistant powered by Groq and llama-3.1-8b-instant. Built with a pure Express + Vanilla JS stack — no frameworks, no bloat.
- Fast answers via Groq's ultra-low-latency inference
- Light / Dark mode with OS preference detection + localStorage persistence
- Q&A History — saved across sessions via localStorage
- Copy to clipboard — one click to grab any response
- Character counter with live warnings
- Toast notifications for feedback on every action
- Fully accessible — ARIA roles, keyboard navigation, focus management
- Mobile responsive — works great on all screen sizes
luma/
├── public/
│ ├── index.html # Frontend UI
│ ├── style.css # All styles (light + dark themes)
│ └── script.js # Frontend logic
├── server.js # Express backend → Groq API
├── .env # Environment variables (do not commit)
├── package.json
└── README.md
git clone <your-repo-url>
cd luma
npm installcp .env.example .envOpen .env and add your Groq API key:
GROQ_API_KEY=your_groq_api_key_here
PORT=5000Get a free API key at console.groq.com/keys
node server.jsOpen your browser at → http://localhost:5000
{
"express": "^4.x",
"cors": "^2.x",
"dotenv": "^16.x"
}Install with:
npm install express cors dotenvMake sure your package.json includes "type": "module" for ES module support:
{
"type": "module"
}| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Serves the frontend |
| GET | /health |
Health check |
| POST | /ask |
Submit a question to AI |
Request body:
{ "question": "What is recursion?" }Response:
{
"success": true,
"answer": "Recursion is when a function calls itself..."
}The UI uses CSS custom properties for full light/dark theming. The toggle is in the top-right corner. Preference is saved to localStorage under the key luma_theme.
- Never commit your
.envfile — add it to.gitignore - Input is validated server-side (max 2000 chars, required field)
- All user content is HTML-escaped before being rendered in the DOM
MIT — use freely, build something great.
