A lightweight CRM for the East Harlem / El Barrio Community Land Turst to manage properties, residents, leases, subsidies, and income certifications, built during hackNY's 2026 Public Interest Lab (PIL).
Built with React + Vite (frontend) and PocketBase (backend), a single binary, SQLite, file-backed, easy to run locally or self-host.
- CiviCRM: Open-source and mission-aligned, but its rigid data models, dated interface, and poor mobile responsiveness demanded more custom development than our ten-week fellowship allowed
- Yardi: Powerful for property management, but per-unit pricing and monthly minimums made it an expensive, overly complex choice
- Twenty: Highly flexible with low-cost self-hosting, but its enterprise-first architecture didn't map cleanly to EHEBCLT's specific needs
Exploring and prototyping these tools was an important part of this project: public interest tech is not about the most impressive tech stack, it's about building something that is actually intuitive, usable, and maintainable.
- Single Go binary + SQLite — no separate DB to operate.
- Built-in auth (
userscollection), admin UI at/_/, file storage, and REST API. - Migrations version-controlled in
backend/pb_migrations/— schema changes apply automatically on restart. pb_public/serves the built frontend — one service hosts both API + UI, no CORS/proxy needed.- Hooks in
backend/pb_hooks/for audit trail and retention.
PocketBase hooks are server-side event listeners — small JS functions that run inside the PocketBase process itself. We built these:
audit_log.pb.js— intercepts everyonRecordCreate/Update/Delete(viaonRecord*Request+onRecordAfter*Success) and writes a row to_auditswithaction,collection_name,record_id,changes, and actor (actor_email/actor_id).cron.pb.js— dailyaudit_logs_cleanup(0 0 * * *) deletes_auditsrows older thanSettings → Logs → Max days.auth.pb.js— addsPOST /api/_app_auth(requires a logged-inusersrecord) that returns a static superuser token fromPB_SUPERUSER_EMAIL/PB_SUPERUSER_PASSWORDfor server-side tasks.
frontend/package.json:12-17— React 19 + Vite for fast HMR/build,pocketbaseJS SDK +chart.jsfor dashboard.- Direct SDK calls (
frontend/src/pb.js) keep fetching simple:pb.collection("unit").getFullList().
backend/Dockerfile:2-15builds from official PocketBase release with SHA-256 verification, runs as non-rootpocketbaseuser.backend/docker-compose.yml:9-28— read-only rootfs,cap_drop: ALL,no-new-privileges, isolatedpocketbase_internalnetwork.pb_datais the only writable volume.- Caddy fronting port 80/443 for TLS/reverse-proxy in production; PocketBase bound to
127.0.0.1:8090locally.
Seven collections + _audits (auto-generated) and users (PocketBase auth). See docs/data-model.md for the full schema, fields, and diagram.
building— properties (address, name)unit— apartments within a building (building_id)tenant— head-of-household (building_idshortcut for tenants without an active lease)lease— linksunit+tenant(rents, dates, status)household_member— other residents (head_tenant_id → tenant)subsidy/income_certification— per-lease programs and compliance
ehebclt-crm/
├── frontend/ # React + Vite app
│ ├── src/
│ │ ├── pb.js # PocketBase client
│ │ ├── App.jsx # Sidebar nav
│ │ ├── tabs/ # DashboardTab, PropertiesTab, ResidentsTab, ResidentDetail
│ │ ├── components/
│ │ └── theme.css
│ ├── vite.config.js
│ └── package.json
├── backend/ # PocketBase
│ ├── pb_migrations/ # Versioned schema (JS migrations)
│ ├── pb_hooks/ # audit_log.pb.js, cron.pb.js, auth.pb.js
│ ├── pb_data_sample/ # Sample DB for local dev
│ ├── pb_data/ # Local SQLite data
│ ├── pb_public/ # Static hosting for frontend/dist
│ ├── docker-compose.yml
│ ├── Dockerfile
│ ├── Caddyfile
│ └── entrypoint.sh
├── docs/
│ └── data-model.md
└── README.md
- Docker Desktop, Node 18+, npm
# 1. Copy sample DB (first time only)
cp -r backend/pb_data_sample backend/pb_data
# 2. Configure env (see backend/.env.example if present — set PB_SUPERUSER_* if needed)
# 3. Start
cd backend
docker compose up -d
# API: http://localhost:8090
# Admin UI: http://localhost:8090/_/ (create local superuser on first visit)Migrations in pb_migrations/ apply automatically on container restart.
cd frontend
npm install
npm run dev
# http://localhost:5173The frontend connects via src/pb.js → http://localhost:8090.
cd frontend && npm run build
cp -r dist/* ../backend/pb_public/
cd ../backend && docker compose restart
# App now served at http://localhost:8090We run our prototype on a free Oracle Cloud VM (Ubuntu) with Docker + Caddy, deployed via GitHub Actions. Fork the repo to host your own instance.
- Fork this repo.
- Provision a VM — Oracle Free Tier
VM.Standard.E2.1.Micro(or any Docker host). Open ports80/443. Install Docker + Docker Compose. - Point a domain at it — we use
ehebclt.duckdns.org(backend/Caddyfile:1). Updatebackend/Caddyfilein your fork to your domain:Caddy will auto-provision TLS via Let's Encrypt.your-domain { reverse_proxy pocketbase:8090 } - Seed data (first deploy only) —
scpyourbackend/pb_datato~/pocketbase/pb_dataon the VM, or let PocketBase create a fresh DB and create the superuser athttps://your-domain/_/.
Add these in Settings → Secrets and variables → Actions on your fork:
| Secret | Used in | Purpose |
|---|---|---|
REMOTE_HOST |
deploy.yml:42,53 |
VM public IP / hostname |
REMOTE_USER |
deploy.yml:43,54,58 |
SSH user (e.g. ubuntu) |
SSH_PRIVATE_KEY |
deploy.yml:44,55 |
Private key matching ~/.ssh/authorized_keys on the VM |
VITE_PB_URL |
deploy.yml:32 |
Frontend → PocketBase URL (e.g. https://your-domain) |
This repo uses a single workflow at .github/workflows/deploy.yml. On every push to main (or manual run), it builds the frontend and deploys to the Oracle VM, no manual SSH or docker compose needed.
- Resident portal: a platform where residents can log in and keep track of their own rent payments and lease information. Pocketbase supports scoped permissions for authentication, making this possible without architecture overhaul in the future.
- PDF uploads: much of EHEBCLT's is currently a collection of files with data that requires manual entry into the platform. It would be useful if staff could (securely) upload documents and have the relevant fields auto-populate when adding data.
Made with ❤️ in NYC