// architecture, setup, API
git clone https://github.com/YOUR_USERNAME/tenantunion.gitmysql -u root tenantunion < sql/schema.sql.env.example to .env and fill in DB + Google OAuth credentials.mod_rewrite, mod_php. Point DocumentRoot at the repo dir.0 4 * * 1 /usr/bin/php /var/www/tenantunion/api/scrapers/refresh-orgs.php| Endpoint | Method | Purpose |
|---|---|---|
/api/auth/google.php | GET | Start Google OAuth flow |
/api/auth/callback.php | GET | OAuth callback — create session |
/api/auth/me.php | GET | Current authenticated user |
/api/auth/logout.php | POST | Destroy session |
/api/nearby.php | GET | Spatial search — tenant unions near lat/lng |
/api/union.php | GET | Union detail (members, contact, supported reports) |
/api/unions.php | GET/POST | List by city / create new union |
/api/landlord.php | GET | Landlord detail with slumlord score |
/api/landlords.php | GET/POST | Ranked landlords / create new |
/api/building.php | GET | Building detail |
/api/buildings.php | GET/POST | Buildings by landlord / create |
/api/reports.php | POST | Submit a report (with optional inline landlord/building creation) |
/api/report.php | GET | Single report detail |
/api/confirm.php | POST | Confirm a report |
/api/flag.php | POST | Flag a report |
/api/join.php | POST/DELETE | Join / leave a tenant union |
/api/profile.php | GET/POST | Profile + stats / update |
/api/leaderboard.php | GET | Top organizers |
/api/alerts.php | GET/POST/DELETE | Subscribe to landlord/union updates |
/api/push.php | POST/DELETE | Web Push subscription |
/api/networks.php | GET | List tenant union networks |
/api/scan-area.php | POST | Trigger OSM scan for new unions in an area |
/api/og-share.php | GET | OG meta for shared union/landlord links |
/api/investor.php | POST | Funder contact form (3/day/IP) |
/api/admin/*.php | GET/POST | Moderation dashboard (auth-gated) |
Each landlord gets a 0–100 composite score recomputed on every page load:
reports × 2 + severity_sum × 3 + reporters × 5 + has_eviction ? 20 : 0 + has_retaliation ? 15 : 0 + has_habitability ? 10 : 0 + has_deposit_theft ? 8 : 0 → capped at 100
Try it on the score calculator.