⚙️ Lightweight Express.js backend to securely proxy requests to the Groq API for blazing-fast LLM-powered responses — used by Edgex Frontend (MoodMirror + CareerCrack).
This server powers Edgex, an AI-powered mentorship suite for Gen Z, by securely routing LLM queries through the backend — protecting your API keys and managing CORS.
Edgex’s AI features like career guidance and relationship insights rely on this backend to talk to Groq's LLaMA 3 models at lightning speed ⚡
- 🔗 Hosted URL: https://edgex-backend.onrender.com
- 🔁 Endpoint:
POST /api/groq
Tech | Purpose |
---|---|
Node.js | Runtime |
Express.js | Backend framework |
Axios | Requests to Groq API |
dotenv | Environment variable management |
CORS | Cross-origin support |
Render | Serverless deployment |
Create a .env
file in the root:
GROQ_API_KEY=your_groq_key_here
PORT=5000
RATE_LIMIT=20 # max requests per minute per IP (default: 20)
# Clone the repo
git clone https://github.com/ayush585/edgex-backend
cd edgex-backend
# Install dependencies
npm install
# Start server
npm run dev # or: node groq-proxy.js
POST /api/groq
{
"model": "llama3-8b-8192",
"messages": [
{ "role": "system", "content": "You are..." },
{ "role": "user", "content": "Hello AI!" }
],
"temperature": 0.75
}
Authorization: Bearer <your GROQ_API_KEY>
Content-Type: application/json
Example Response
{
"choices": [
{
"message": {
"content": "Hey! Here's my AI reply..."
}
}
]
}
Without this proxy backend:
- ❌ The Groq API key would be exposed in frontend
- 🌐 Cross-origin (CORS) errors would break requests
- 🔐 No centralized control over rate limits or auth
This backend is your secure bridge between frontend UI and powerful LLMs!
groq-proxy.js # Main backend app
.env # API keys (ignored in git)
package.json # Dependencies and scripts
-
Use UptimeRobot to ping your backend every 5 mins to keep it awake 🚀
-
Monitor logs on Render Dashboard
We welcome contributors via GirlScript Summer of Code 2025 🙌
You don’t need to be a backend pro — we’ll guide you through!
- Add rate limiting
- Add health check route
- Setup tests for the endpoint
- Convert to TypeScript (optional)
- Fork the repo
- Create a new branch:
feature/my-feature
- Make your changes 🚀
- Open a PR with a clear description
Name | Role | GitHub |
---|---|---|
Ayushman Mukherjee | Project Admin | @ayush585 |
Aishika Biswas | Contributor | @aishikabiswas |
You? ⭐ | Contributor | Fork, star & submit a PR! |
📧 Email: ayushmanmukherjee12@gmail.com
💼 LinkedIn: Ayushman Mukherjee
🎯 Discord: Sabucha | PA on GSSoC server
MIT — Open to all learners, dreamers, and devs 💖