Skip to content

MomenElsayedDev/LUMA-AI-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 Luma AI Assistant

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.

logo


✨ Features

  • 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

🗂 Project Structure

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

🚀 Getting Started

1. Clone & install

git clone <your-repo-url>
cd luma
npm install

2. Configure environment

cp .env.example .env

Open .env and add your Groq API key:

GROQ_API_KEY=your_groq_api_key_here
PORT=5000

Get a free API key at console.groq.com/keys

3. Run the server

node server.js

Open your browser at → http://localhost:5000


📦 Dependencies

{
  "express": "^4.x",
  "cors": "^2.x",
  "dotenv": "^16.x"
}

Install with:

npm install express cors dotenv

Make sure your package.json includes "type": "module" for ES module support:

{
  "type": "module"
}

🔌 API Endpoints

Method Endpoint Description
GET / Serves the frontend
GET /health Health check
POST /ask Submit a question to AI

POST /ask

Request body:

{ "question": "What is recursion?" }

Response:

{
  "success": true,
  "answer": "Recursion is when a function calls itself..."
}

🎨 Theming

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.


🔒 Security Notes

  • Never commit your .env file — 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

📄 License

MIT — use freely, build something great.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors