Skip to content

kelsey-developers/ai-chatbot-backend

Repository files navigation

AI Chatbot Backend

AI chat powered by Groq (Llama). Requires login (JWT from auth-service). Fetches units from auth-service for "find units near my location" queries.

Setup

  1. Copy .env.example to .env and set:

  2. Install and run:

    npm install
    npm run dev

Docker

docker compose up --build

Runs on port 3003. Set AUTH_SERVICE_URL=http://host.docker.internal:3001 when auth-service runs on host.

API

  • GET /health - Health check
  • POST /api/chat - Send message (Bearer token required)

Request body:

{
  "message": "Find units near my location",
  "history": [{"role": "user", "content": "..."}, {"role": "model", "content": "..."}],
  "latitude": 14.5995,
  "longitude": 120.9842
}

Pass latitude and longitude for "near me" queries - units are sorted by distance.

Main Frontend

Add to .env.local:

AI_CHATBOT_URL=http://localhost:3003

Chat is available via the floating widget (when logged in) or /chat page.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors