Survival LLM
A free AI assistant and survival library (1.5 million offline articles) that runs on your own computer, with no internet. Shows the source of every answer. Mac and Windows.
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗Every street in Chennai has a record. Theru puts one street's public works on a single page: who is digging it, what goes off in the next 48 hours, power cuts that start beside a trench, what the official records leave out, and who answers for it.
Live: https://theru.vercel.app
Built for the CivicTech hackathon theme Improving Transparency and Coordination in Public Works Projects.
Chennai's streets are dug, restored and dug again by different agencies: Greater Chennai Corporation (GCC), Chennai Metrowater (CMWSSB), the power utility TNPDCL, Chennai Metro Rail (CMRL) and telecom companies. Each publishes, if at all, in its own place and format:
A resident who wants to know "what is happening on my street, and who do I ask?" has to search five sources and still not know which office is responsible.
| Feature | What it gives a resident |
|---|---|
Street record (/street) | Everything within 500 m of a point: works, shutdowns, suspensions, resident reports and findings, as one timeline with a source tag on every item. |
| Next 48 hours | An hour-by-hour grid with power, water, road and rain rows, built from published shutdown and suspension notices plus the Open-Meteo rain forecast. Waterlogging risk rises where waterlogging has been reported before. |
| Possible cable strike | A power cut reported in the last 6 hours within 150 m of an active excavation that began before it is flagged Requires verification. It is a correlation, never presented as a cause. |
Evidence gaps (/records) | A rules engine over the records: completion record not found, a possible match that needs a person to confirm it, digging soon after resurfacing, two agencies digging close together, damage near works, a promised date that has passed. Labels stay neutral and every rule is explained on the Method page. |
| Who answers here | The location is matched to its GCC zone and region, the departments for the issue, and a Day 0, 3, 7 and 15 escalation ladder. A Right to Information request can be copied in one click. Each contact is tagged Official page or Verify before use. |
Resident reports (/map) | Report a pothole, waterlogging, a work site or a power cut, with a photo from the camera or the gallery. Reports of the same thing merge (25 m potholes, 75 m waterlogging, 50 m work sites, 300 m power cuts). Priority is a formula anyone can read (below). A fix closes only when two or more residents confirm it. |
Community requests (/requests) | Ask for a streetlight, garbage clearance, a drain, a fallen tree, stray-animal help or water, in public. Neighbours vouch ("I need this too") instead of filing the same complaint again; each vouch counts as one more resident and raises priority. A request shows Raised, Supported and Resolved, and closes only when two neighbours confirm it was done. No account and no phone number, unlike complaint apps that pass the complainant's number to field staff. |
| Parking hotspots | Mark a spot that keeps getting blocked (footpath, lane, junction or gate). Repeated reports build a hotspot routed to the traffic police. It marks places, not people: the form asks for no number plates or faces, and points to the GCTP Citizen Services app for a specific vehicle. |
| Map key | Live power cuts are shaded on the map, and a key explains every shape on it. |
Priority score (computed in the database): 20 × severity + 8 × distinct reporters (max 10) + 3 per day open (max 21) + 15 if within 60 m of an active work site.
Before building we checked existing work. Civic complaint trackers (for example interns.city, FixMyCity-style apps and Smart India Hackathon projects) cover reporting, clustering and routing. Outage trackers exist separately. We found none that links power cuts to nearby excavations, gives a combined street-level 48-hour outlook, or audits public works records for gaps. Those are the parts Theru adds.
Every record carries its provenance, shown as a tag wherever it appears:
| Tag | Meaning |
|---|---|
| Official record | Published by the agency, with a source link and import date. |
| News report | Taken from a published news report, with a link to the article. |
| OpenStreetMap | Mapped by OpenStreetMap contributors, with a link to the map way. |
| Resident reports | Submitted on Theru. |
| Demo data | Synthetic or illustrative, labelled wherever it appears and never presented as real. |
Real records loaded now (supabase/seed-real.sql, generated from scripts/real-records.json):
Construction mapped in OpenStreetMap (supabase/seed-osm-works.sql, generated by scripts/build-osm-works.py): 132 stretches of about 800 m along Chennai Metro Phase 2 Lines 3, 4 and 5, the Chennai Port to Maduravoyal expressway, the Teynampet to Saidapet flyover and other roads mapped as under construction, each linked to its OpenStreetMap way. They count as active works for the cable-strike and damage rules. A line named as a proposal is left out even where it is tagged as construction.
Limits we state openly:
supabase/seed-sample.sql, Wikimedia Commons photos) sit beside the real works to show the rules working. Each is labelled Demo data wherever it appears, and so is every finding that depends on one. The sample power cut is timed to the moment the script runs, so re-run it shortly before a demo.python -I scripts/build-real-seed.py
Add new notices to scripts/real-records.json (each with its source URL), run the script, then run supabase/seed-real.sql in the Supabase SQL editor. The script respects Nominatim's one request per second limit and caches results in scripts/.geocode-cache.json.
Browser ──► Next.js on Vercel (pages + /api route handlers)
│ reads: cached RPC calls (get_clusters, get_notices, get_findings, get_street)
│ writes: /api/reports, /api/photos (validated, origin-checked, size-capped)
▼
Supabase Postgres + PostGIS
RLS default-deny on every table
writes only through SECURITY DEFINER functions that check a server-held token
rules engine (get_findings) and clustering run in SQL
Photos ──► sharp re-encode (strips EXIF and GPS) ──► Vercel Blob
Map ─────► MapLibre GL with OpenFreeMap tiles
Search ──► /api/geocode merges Photon and Nominatim, ranked by distance to Chennai
Rain ────► Open-Meteo hourly forecast (no key)
Pages are statically generated and refreshed every 60 seconds; every write invalidates the cache so a reporter sees their pin immediately.
Security was a first-class requirement. What is in place:
DB_RPC_TOKEN, REPORTER_SALT and BLOB_READ_WRITE_TOKEN exist only as server environment variables.submit_report, confirm_cluster and note_upload, which reject any call without the server's token.X-Frame-Options: DENY, nosniff, a strict referrer policy and a permissions policy. X-Powered-By is removed.Re-test, 10 October 2026 (against the live site and database):
| Test | Result |
|---|---|
| Invalid kind, out-of-range coordinates, severity 99, 5,000-character note, non-JSON body | 400 |
| Photo URL from another host, or a lookalike host | 400 |
| Cross-site Origin | 403 |
| 20 KB body | 413 |
| Script disguised as a JPEG | 400 (unsupported image type) |
| SQL injection in the cluster id | 404 |
| HTML injection in the street name | Escaped |
| Insert, update or delete on any table with the public key | Blocked by RLS |
| Reading reporter hashes or the private schema | Blocked |
| Calling write functions without the token | unauthorized |
| Client JavaScript scanned for secrets | None found |
npm audit --omit=dev | 0 vulnerabilities |
Unbounded radius on get_street | Found and fixed: now clamped to 50 to 2,000 m |
Known, accepted: Supabase's advisor warns that the read functions are callable anonymously. That is intended, because the data is public.
You need: Node.js 20+, a free Supabase project, and a free Vercel account (for hosting and Blob storage).
Clone and install
git clone https://github.com/Barath-BDK/Bits-Bytes-Hackathon.git
cd Bits-Bytes-Hackathon
npm install
Database. In the Supabase SQL editor, run every file in supabase/migrations/ in name order. Then copy the generated token:
select value from private.app_secrets where name = 'rpc_token';
Environment. Copy .env.example to .env.local and fill in:
| Variable | Where it comes from |
|---|---|
NEXT_PUBLIC_SUPABASE_URL | Supabase project settings, API |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY | Supabase project settings, API keys (publishable) |
DB_RPC_TOKEN | The token from step 2 |
REPORTER_SALT | Any long random string, for example openssl rand -hex 32 |
BLOB_READ_WRITE_TOKEN | Vercel, Storage, Blob store (only needed for photo uploads) |
Never commit .env.local. It is in .gitignore.
Data (optional). Run supabase/seed-real.sql for the real notices, supabase/seed-osm-works.sql for mapped construction and supabase/seed-sample.sql for the labelled sample reports.
Run
npm run dev
Open http://localhost:3000. Production build: npm run build && npm start.
Deploy. Import the repository in Vercel, add the same environment variables (mark the three server values as Sensitive), and deploy. Pushes to main deploy automatically.
Watch the demo (4 min 55 s): plays in any browser, no login needed. It covers searching a street, reporting a problem, vouching for a request, where each record comes from, and how residents are kept private.
The video file is in this repository at public/demo/theru-demo.mp4 (direct download).
Every external service the site or its scripts call, and what for. None needs a key or costs anything.
| Service | Called from | Used for | Terms |
|---|---|---|---|
| Supabase (PostgreSQL, PostGIS) | Server routes | The database: reports, notices, findings, vouches | Free tier |
| OpenFreeMap | Browser (map) | Map tiles and styles | Free, attribution to OpenStreetMap |
| Photon (komoot) | /api/geocode | Place search as you type | OSM data, ODbL, fair use |
| Nominatim (OpenStreetMap) | /api/geocode, scripts/build-real-seed.py | Place search; placing notices on the map | ODbL, 1 request per second |
| Overpass API (OpenStreetMap) | scripts/build-osm-works.py | Roads and rail lines mapped as under construction | ODbL |
| Open-Meteo | Server (street pages) | Hourly rain forecast for the 48-hour outlook | CC BY 4.0 |
| Vercel Blob | /api/photos | Storing residents' photos | Free tier |
| DT Next, Urban Acres | Read by hand into scripts/real-records.json | Published shutdown, suspension and incident notices | Linked on every record, not copied |
| Wikimedia Commons |
All photos are from Wikimedia Commons and are credited on the site (Method page) and here.
| File | Title | Author | Licence |
|---|---|---|---|
pothole-1.webp | Broken Roads in India's Capital New Delhi | Rrthakur22 | CC BY-SA 4.0 |
pothole-2.webp | Driving through potholes | KEmel49 | CC BY-SA 4.0 |
pothole-4.webp | Potholes on road | KEmel49 | CC BY-SA 4.0 |
pothole-5.webp | Roads deformed T munnekollala Bengaluru | Gangaasoonu | CC BY-SA 4.0 |
pothole-6.webp | Roads deformed T munnekollala Bengaluru 2 | Gangaasoonu | CC BY-SA 4.0 |
waterlogging-1.webp | Chennai flood water logging near ofice nandanam4 | Vijayingarsal | CC0 |
| Name | Use | Licence or terms |
|---|---|---|
| Next.js | Framework, pages and API routes | MIT |
| React | UI | MIT |
| Supabase (Postgres, PostGIS) | Database, geospatial queries | Apache-2.0, GPL-2.0 |
| MapLibre GL JS | Map rendering | BSD-3-Clause |
| OpenFreeMap and OpenStreetMap | Map tiles and map data | ODbL |
| Photon and Nominatim | Place search and geocoding of notices | ODbL data, fair-use policies |
| Open-Meteo | Hourly rain forecast | CC BY 4.0 |
| Lenis | Smooth scrolling | MIT |
| Motion | Animation | MIT |
| Magic UI AnimatedBeam | Coordination diagram (vendored) | MIT |
| Tailwind CSS |
No paid APIs and no AI APIs are used. The project runs entirely on free tiers.
src/app/ pages (/, /street, /map, /records, /c/[id], /about) and /api routes
src/components/ UI: header, hero street plan, street picker, outlook grid, map view, report sheet
src/lib/ data access, rules and labels, jurisdiction and escalation, forecast, outlook
supabase/migrations database schema, RLS, functions and rules engine
supabase/*.sql seeds: illustrative reports, demo notices, real notices
scripts/ real-records.json and the generator for seed-real.sql
Downloaded once into public/seed |
| Photos for the sample reports (credits below) |
| Licences as listed |
waterlogging-2.webp | Chennai flood water logging near ofice nandanam5 | Vijayingarsal | CC0 |
waterlogging-3.webp | Chennai flood water logging near ofice nandanam6 | Vijayingarsal | CC0 |
waterlogging-4.webp | India - Chennai - Monsoon - 02 (3059047958) | McKay Savage from London, UK | CC BY 2.0 |
waterlogging-5.webp | India - Chennai - Monsoon - 03 (3058213357) | McKay Savage from London, UK | CC BY 2.0 |
waterlogging-6.webp | India - Chennai - Monsoon - 04 (3058215637) | McKay Savage from London, UK | CC BY 2.0 |
waterlogging-7.webp | India - Chennai - Monsoon - 05 (3058218683) | McKay Savage from London, UK | CC BY 2.0 |
waterlogging-8.webp | Inundation of Chennai in 2017-1 | Kaitha Poo Manam | CC BY-SA 4.0 |
waterlogging-10.webp | Inundation of Chennai in 2017-5 | Kaitha Poo Manam | CC BY 4.0 |
worksite-1.webp | Road construction India | Shyamal | CC0 |
worksite-3.webp | Road construction work | Siyaulhaque | CC BY-SA 4.0 |
worksite-4.webp | Road construction work 2 | Siyaulhaque | CC BY-SA 4.0 |
worksite-6.webp | Road Repairs Pump | Drmarathe | CC BY-SA 3.0 |
| Styling |
| MIT |
| Zod | Input validation | MIT |
| sharp | Photo re-encoding | Apache-2.0 |
| Vercel Blob | Photo storage | Hosted service |
| Archivo, Instrument Sans, Instrument Serif, Fragment Mono (Google Fonts) | Typography | SIL OFL 1.1 |
| Wikimedia Commons | Demo photos (credits on the Method page and in public/seed/credits.json) | CC licences as listed |
| DT Next, Urban Acres | News sources for real notices, linked on every record | Linked, not copied |