BlockBuddy
- Give residents a friendly way to flag neighborhood issues, talk to each other, and see community impact on a map.
- Publish complaints via text or camera (AI‑assisted summaries, severity, weather).
- Show complaint markers on a map centered on the user’s neighborhood/city.
- Chat privately, by neighborhood (city+neighborhood), or city forum threads.
- Frontend: React + Vite + TypeScript
- Backend: Node.js + Express
- DB: MongoDB
- Services: OpenWeather for weather and Gemini AI for camera analysis.
- Location UX: reliable Canada‑only autocomplete
- Chat threading + privacy
- Mongo schema modeling (messages/threads)
- Analysis using text/camera to display on live map with severity + weather.
- Neighborhood, city, and private chats
- How to deploy frontend on AWS
- How to use a MERN tech stack
- Moderation tools, spam detection, and report verification workflows.
- Add ability for adding media to chats and support for videos in compaints
Prerequisites
- Node.js 18+ and npm
- MongoDB (local or cloud). Default URI:
mongodb://127.0.0.1:27017/blockbuddy
Download & Install
- Clone or download this repository, then:
- From repo root:
npm run setup:web(installs dependencies inserver/andweb/)
- From repo root:
Run (Development)
-
Start the server
cd server- Ensure MongoDB is running. To use a custom URI:
export MONGODB_URI=mongodb://127.0.0.1:27017/blockbuddy npm run dev(listens onhttp://localhost:4000)
-
Start the web app
cd webVITE_SERVER_URL=http://localhost:4000 npm run dev- Open the printed local URL in your browser
Chat
- Log in or sign up (now includes City).
- Navigate to Chat:
- Private: search a user by name, select, and message.
- Chat sessions are recorded per login/logout; logging out calls the server to close your session.
Build (Web)
cd web && npm run build- Preview:
npm run preview
Configuration
- Server (via environment variables; .env file not required):
PORTdefault:4000HOSTdefault:127.0.0.1(bind address for the Express dev server)OVERPASS_URLdefault:https://overpass-api.de/api/interpreterMONGODB_URIdefault:mongodb://127.0.0.1:27017/blockbuddyMONGODB_IN_MEMORYdefault:false. Set totrueto skip MongoDB entirely and use the built-in volatile data store (automatically used as a fallback when MongoDB is unreachable).MONGODB_DISABLE_MEMORY_FALLBACKdefault:false. Whentrue, the server crashes instead of silently falling back to the in-memory store.GEMINI_API_KEY(required for AI camera analysis and the Calgary 311 assistant; if missing, camera falls back to manual descriptions)GEMINI_VISION_MODELdefault:gemini-2.5-flash-lite(override only if Google lists a compatible model for v1betagenerateContent)OPENWEATHER_API_KEY(optional; if omitted the server automatically falls back to Open-Meteo for basic temperature/wind data)GEMINI_MODELoptional override for the Calgary 311 summarizer (defaults togemini-1.5-pro)CALGARY311_SERVICE_URLoptional override for the Motorola service-definition feed
- Web app:
- Dev mode automatically proxies
/api/*calls from Vite (port 5173) tohttp://127.0.0.1:4000, so you can just run both dev servers locally without settingVITE_SERVER_URL. - When deploying or using a remote API, set
VITE_SERVER_URLto the server origin before building (e.g.,https://api.example.com), or editweb/src/config/constants.ts.
- Dev mode automatically proxies