Skip to content

Repository files navigation

JusticeConnectAI

Local Groq Proxy & Environment variables

  1. Copy .env.example to .env and fill in your keys (do not commit .env).

    cp .env.example .env
    # edit .env
  2. Install dependencies and run the local proxy server (this requires Node 18+ for ESM support):

    npm install
    npm run proxy
  3. In the mobile app, set PROXY_URL to the running proxy address (e.g., http://192.168.x.x:3000/groq if using a physical device). Android emulator may use 10.0.2.2 as the host.

  4. Production (Vercel): If you deploy to Vercel, add a Serverless api/groq.js endpoint (it's already included under api/groq.js).

    • Add GROQ_API_KEY to Vercel's project Environment Variables (Production).
    • Set PROXY_URL to https://<your-vercel-app>.vercel.app/api/groq in production if you want the mobile/web app to call the Vercel proxy.
  5. Start the app as usual with:

    npm run start

This app supports both direct calls to Groq (not recommended for production) and a local proxy that secures the API key.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages