A restaurant finder powered by AI. Ask for restaurants in natural language and get results from Foursquare Places.
BiteScout/
├── src/ # Express backend (API server)
├── frontend/ # Next.js frontend (chat UI)
├── package.json # Root — backend deps + unified scripts
└── frontend/package.json
- Node.js (LTS) and npm
- Git
# Install backend dependencies
npm install
# Install frontend dependencies
cd frontend && npm installCreate a single .env in the project root:
PORT=3000
BACKEND_URL=http://localhost:3000
FOURSQUARE_API_KEY=your_foursquare_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
GROQ_API_KEY=your_groq_api_key_here
ACCESS_CODE=your_access_code_hereBoth the backend and frontend read from this single file. The frontend's
next.config.tsloads it via dotenv and exposesBACKEND_URLandACCESS_CODEto the Next.js server runtime. These are never exposed to the browser.
Getting a Foursquare API Key:
- Create an account at https://foursquare.com
- Create a project → Generate API key
- If approval is pending: Click "learn about keys" → Select Places API → Copy Header value as token
Getting an OpenAI API Key:
- Create an account at https://platform.openai.com
- Go to API keys section (https://platform.openai.com/api-keys)
- Click "Create new secret key" → Copy and save the key
Getting a Groq API Key:
- Create an account at https://console.groq.com
- Go to API Keys in the left sidebar
- Click "Create API Key" → Copy and save the key
Groq is used as an automatic fallback when OpenAI is unavailable (rate limits, outages, etc.). Both keys are required.
Start both backend and frontend with a single command:
npm run dev:allThis runs:
- Backend →
http://localhost:3000 - Frontend →
http://localhost:3001
Open http://localhost:3001 in your browser to use the chat interface.
# Backend only
npm run dev
# Frontend only
npm run dev:frontendOpen the frontend at http://localhost:3001 and type a natural language query like:
- "Find me cheap sushi in downtown Los Angeles"
- "I want pizza in Sydney"
- "Show me expensive Italian restaurants in BGC Taguig that are open now"
Results will appear in the chat with restaurant names, categories, and addresses.
| Endpoint | Method | Params | Description |
|---|---|---|---|
/api/execute |
GET | message (string), code (string) |
Parses natural language via OpenAI and queries Foursquare |
| Endpoint | Method | Body | Description |
|---|---|---|---|
/api/search |
POST | { "message": "..." } |
Proxies to backend with access code injected server-side |
- Missing variables → Verify all keys are present in the root
.env - Server won't start → Ensure the
devscript setsNODE_ENV=development(already configured inpackage.json) - Port conflict → Change
PORTin.env(backend) or edit the--portflag infrontend/package.json(frontend) - Frontend can't reach backend → Ensure
BACKEND_URLin.envmatches the backend's actual port - Access denied errors → Ensure
ACCESS_CODEis set in the root.env
This project deploys as a single Vercel project (monorepo). The backend runs as a serverless function under /restaurantfinder and the frontend is served at the root.
| Variable | Value |
|---|---|
BACKEND_URL |
https://bitescout-frontend.vercel.app/restaurantfinder |
FOURSQUARE_API_KEY |
Your Foursquare API key |
OPENAI_API_KEY |
Your OpenAI API key |
GROQ_API_KEY |
Your Groq API key |
ACCESS_CODE |
Your access code |
- Requests to
/restaurantfinder/*are routed to the Express backend (src/index.ts) - All other requests are served by the Next.js frontend (
frontend/) - The frontend's
/api/searchroute proxies to the backend usingBACKEND_URL