The Node.js + Express API lives in the backend/ directory. It serves JSON under /api and stores temporary data in backend/data/ (ignored by git).
- Node.js 18+ (LTS recommended)
- npm (comes with Node)
From the repository root:
cd backend
npm installDevelopment (restarts the process when files change):
cd backend
npm run devProduction-style (no file watcher):
cd backend
npm startThe API listens on http://localhost:4001 by default. Check health with http://localhost:4001/api/health.
Optional environment variables:
PORT— override the listen port (default4001).DATA_FILE— absolute path to the JSON file used for temp storage (defaultbackend/data/data.json).
The library page calls Places API (New) on the backend. Copy backend/.env.example to backend/.env and set:
GOOGLE_PLACES_API_KEY— create a key in Google Cloud Console, enable Places API (New), and (recommended) restrict the key to that API.
Optional:
DEFAULT_MAP_LAT/DEFAULT_MAP_LNG— defaults for “nearby” when the user does not share location (preset: World Trade Center area).
Restart the backend after changing .env.
The Next.js app lives in the frontend/ directory.
- Node.js 18+ (LTS recommended)
- npm (comes with Node)
From the repository root:
cd frontend
npm installcd frontend
npm run devOpen http://localhost:3000 in your browser. The dev server reloads when you change files.
For the Libraries page, the frontend calls the Express API (by default http://localhost:4001). Copy frontend/.env.example to frontend/.env.local if you need a different base URL:
NEXT_PUBLIC_API_BASE_URL— e.g.http://localhost:4001(no trailing slash).
Run the backend and frontend together in development.
cd frontend
npm run build
npm startnpm start serves the optimized build (defaults to port 3000 unless PORT is set).