Skip to content

FFlap/BlockBuddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlockBuddy

Inspiration

  • Give residents a friendly way to flag neighborhood issues, talk to each other, and see community impact on a map.

What It Does

  • 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.

How We Built It

  • Frontend: React + Vite + TypeScript
  • Backend: Node.js + Express
  • DB: MongoDB
  • Services: OpenWeather for weather and Gemini AI for camera analysis.

Challenges We Ran Into

  • Location UX: reliable Canada‑only autocomplete
  • Chat threading + privacy
  • Mongo schema modeling (messages/threads)

Accomplishments That We’re Proud Of

  • Analysis using text/camera to display on live map with severity + weather.
  • Neighborhood, city, and private chats

What We Learned

  • How to deploy frontend on AWS
  • How to use a MERN tech stack

What’s Next for BlockBuddy

  • 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 in server/ and web/)

Run (Development)

  1. 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 on http://localhost:4000)
  2. Start the web app

    • cd web
    • VITE_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):
    • PORT default: 4000
    • HOST default: 127.0.0.1 (bind address for the Express dev server)
    • OVERPASS_URL default: https://overpass-api.de/api/interpreter
    • MONGODB_URI default: mongodb://127.0.0.1:27017/blockbuddy
    • MONGODB_IN_MEMORY default: false. Set to true to skip MongoDB entirely and use the built-in volatile data store (automatically used as a fallback when MongoDB is unreachable).
    • MONGODB_DISABLE_MEMORY_FALLBACK default: false. When true, 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_MODEL default: gemini-2.5-flash-lite (override only if Google lists a compatible model for v1beta generateContent)
    • OPENWEATHER_API_KEY (optional; if omitted the server automatically falls back to Open-Meteo for basic temperature/wind data)
    • GEMINI_MODEL optional override for the Calgary 311 summarizer (defaults to gemini-1.5-pro)
    • CALGARY311_SERVICE_URL optional override for the Motorola service-definition feed
  • Web app:
    • Dev mode automatically proxies /api/* calls from Vite (port 5173) to http://127.0.0.1:4000, so you can just run both dev servers locally without setting VITE_SERVER_URL.
    • When deploying or using a remote API, set VITE_SERVER_URL to the server origin before building (e.g., https://api.example.com), or edit web/src/config/constants.ts.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •