Someone two streets over needs a ride on Thursday. You have a car on Thursday. Patchwork is where neighbors ask for help like that and offer it. It also keeps a map and directory of food banks, clinics, shelters and other local services.
Patchwork is a pre-alpha demonstration. Please don't arrange real help through it yet. It is not an emergency service and cannot promise that anyone will answer a request.
Live demo: patchwork.subcult.tv
- Requests and offers. Sign in with an AT Protocol account (a Bluesky account works) to ask for help, offer help on someone's request, or post an offer of your own. Neighbors ask for an offer and the poster picks one.
- Map, feed and resource directory. Browse requests, offers and resource listings without an account. Requests show an approximate area; approved public resources can show their address.
- Inbox and outcomes. Accepted offers and asks continue in an inbox where both sides can record how it went.
- Scheduling, groups and chat. People with an accepted connection can agree on a time and message each other. Groups take join requests and share rooms. Chat is readable by the server.
- Organizations and verification. Organizations keep profiles and resource records. Listings can be reported, corrected and verified.
- Volunteer profiles with an approximate service area.
- Notifications in the app, by email and by web push.
- Moderation. Reports go to a moderation queue with a separate worker service.
- Account settings with data export and deactivation.
- Optional donations. General-fund giving with Stripe Checkout and gifts to verified organizations through Stripe Connect. Payments are off unless configured.
- English and Spanish interface.
Patchwork uses AT Protocol for accounts and public records. Resource listings are attributed to their source and do not imply that an organization takes part, endorses Patchwork or is currently available.
You need Node.js 22.15 or later, npm and Docker (for local PostgreSQL).
npm ci
cp .env.example .env
# in .env: set ATPROTO_SESSION_ENCRYPTION_KEY (openssl rand -base64 32),
# API_DATA_SOURCE=postgres and
# API_DATABASE_URL=postgresql://patchwork:patchwork@localhost:5432/patchwork
npm run db:up
export DATABASE_URL=postgresql://patchwork:patchwork@localhost:5432/patchwork
npm run db:migrate # API tables
npm run db:migrate -w @patchwork/indexer # projection tables
npm run db:migrate -w @patchwork/moderation-worker # moderation tables
npm run db:seed # optional sample data
npm run dev:api # API on http://localhost:4000
npm run dev:web # web app on http://localhost:5173The API refuses to start until the indexer tables exist. The indexer and
moderation worker run with npm run dev:indexer and npm run dev:moderation.
See DEVELOPMENT.md for the full local setup, datasource modes
and API routes.
Tests and checks:
npm run lint
npm run typecheck
npm run test # unit tests
npm run test:integration:postgres # PostgreSQL + HTTP tests
npm run test:e2e -w @patchwork/web # Playwright browser tests
npm run check # lint, typecheck, testsThe Makefile wraps the same commands (make install, make dev, make check).
Copy .env.example to .env. The main groups of settings are:
- AT Protocol:
ATPROTO_OAUTH_CLIENT_ID,ATPROTO_OAUTH_REDIRECT_URI,ATPROTO_SESSION_ENCRYPTION_KEY,ATPROTO_PDS_URL,ATPROTO_ACCOUNT_PDS_URL,ATPROTO_SERVICE_DID. - API:
API_DATA_SOURCE(postgres),API_DATABASE_URL,API_PORT,API_PUBLIC_ORIGIN,API_TRUSTED_PROXIES. - Indexer:
INDEXER_FIREHOSE_URL,INDEXER_JETSTREAM_VERSION,INDEXER_PROJECTION_MODE. - Moderation worker:
MODERATION_PORT,MODERATION_WORKER_CONCURRENCY. - Attachments: S3-compatible object storage (
ATTACHMENT_OBJECT_*), a signing key and a ClamAV scanner (ATTACHMENT_CLAMD_HOST,ATTACHMENT_CLAMD_PORT). - Notifications: email provider (
NOTIFICATION_EMAIL_*) and web push keys (NOTIFICATION_VAPID_*). - Payments:
PATCHWORK_PAYMENTS_MODE(defaultoff),STRIPE_*andPATCHWORK_GENERAL_FUND_*. - Web app:
VITE_API_BASE_URL,VITE_MAP_TILE_URL.
docker-compose.yml runs the production stack: the web app (nginx serving the
Vite build), the API, the indexer, the moderation worker and PostgreSQL. It
expects an external Docker network named web with a reverse proxy in front of
it. The Makefile has targets for it:
make compose-config # validate the Compose file
make deploy-up # build and start
make deploy-db-migrate
make deploy-logsMap tiles are served from a PMTiles file (PATCHWORK_PM_TILES_*). The API,
indexer and moderation worker expose /metrics, and Prometheus rules are in
monitoring/prometheus/.
apps/web: React, Vite and Tailwind web appapps/mobile: mobile client library (API client, navigation, push); there is no mobile app yetservices/api: HTTP API, AT Protocol OAuth, chat and schedulingservices/indexer: ingestion and indexing of AT Protocol recordsservices/moderation-worker: moderation queue workerpackages/shared: shared contracts, config schemas and utilitiespackages/at-lexicons: lexicon schemas, fixtures and validatorspackages/at-client: AT Protocol OAuth and repository clientdocs/: architecture, protocol and product notes
Report bugs and request features in GitHub issues. Ask questions and share ideas in GitHub Discussions.
Send code as a pull request on GitHub against main. CI runs lint, type checks, unit
and PostgreSQL integration tests, Playwright browser tests, a dependency audit
and a production build on every pull request. Geoprivacy and moderation
regressions block a merge.
GPL-3.0-or-later. See LICENSE.
Built by SUBCULT.
