[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114023":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":16,"rankGlobal":10,"rankLanguage":10,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":18,"hasPages":18,"topics":20,"createdAt":10,"pushedAt":38,"updatedAt":39,"readmeContent":40,"aiSummary":41,"trendingCount":13,"starSnapshotCount":13,"syncStatus":15,"lastSyncTime":42,"discoverSource":43},114023,"chiban-oss","chiban-org\u002Fchiban-oss","chiban-org","Open-source land-use software for small US towns: permits, inspections, Planning Board and ZBA cases, and code enforcement, organized around the parcel.","https:\u002F\u002Fchiban.us",null,"TypeScript",126,0,1,2,40.2,"GNU Affero General Public License v3.0",false,"main",[21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"agpl","building-permits","civic-tech","code-enforcement","gis","govtech","inspections","land-use","local-government","municipal","nextjs","permitting","planning-board","postgis","self-hosted","typescript","zoning","2026-11-23 12:28:04","2026-11-21 13:30:05","\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fbrand\u002Fchiban-logo-reference.png\" alt=\"Chiban\" width=\"180\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Open-source land-use software for small US towns.\u003C\u002Fstrong>\u003Cbr>\n  Building and trade permits, inspections, Planning Board and ZBA applications, and code enforcement, all kept on the parcel.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fdemo.chiban.us\u002Fdemo\">Live demo\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fdocs.chiban.us\">Documentation\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fdocs.chiban.us\u002Foperations\u002Fself-hosting\u002F\">Self-hosting\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fchiban.us\">chiban.us\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-AGPL--3.0-blue\" alt=\"License: AGPL-3.0\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstate%20pack-New%20Hampshire-2a65a3\" alt=\"State pack: New Hampshire\">\n\u003C\u002Fp>\n\n![A building permit in Chiban, showing its status, the next step for staff and the decision deadline](docs-site\u002Fstatic\u002Fimg\u002Fshots\u002Fland-use-staff\u002Fapplication-record.png)\n\n## Why Chiban\n\nA small town's land-use office is often one clerk, a part-time building inspector and two volunteer boards. Their work lives in paper files, a permit spreadsheet and deadlines that someone keeps in their head. Chiban puts the whole record of each parcel in one place: every application, notice, hearing, decision, permit, inspection and complaint, from the first form to the final certificate.\n\n- **Organized around the parcel.** Open a lot and see everything that has happened to it. Residents can read the public part of that history without an account.\n- **State rules built in.** Deadlines, notice wording, appeal routes and records-request rules come from a state pack. Each deadline shows the statute it runs on, the day it started and how it counts, so staff can defend it at the counter or in a hearing.\n- **Staff configure it themselves.** Application forms, fees, permit conditions, document templates and notice wording are edited in the app, with no code and no support ticket.\n- **The records stay the town's.** One export holds every record as plain text and every document as its original file, plus spreadsheet tables, an Excel workbook and a PDF\u002FA copy of every PDF. A [written format guide](https:\u002F\u002Fdocs.chiban.us\u002Freports-and-export\u002Fexport-format\u002F) lets a clerk or consultant read it without Chiban.\n- **Free to run.** A town can host Chiban on its own server with Docker Compose, or pay someone to host it.\n\n## What's in it\n\n| Area | What staff and residents get |\n|---|---|\n| **Applications and permits** | Online and counter applications, departmental reviews, conditions, issuance, certificates and placards |\n| **Inspections** | Booking slots, an inspector's day that works on a phone, checklists with photos, failed results and reinspections, calendar invites for each booking |\n| **Boards** | Planning Board and ZBA cases, abutter notices, hearings, agendas, member packets, decisions and appeals |\n| **Code enforcement** | Complaints (including anonymous ones that record nothing about the sender), cases, violations, orders and appeals |\n| **Resident portal** | Parcel search, applying and paying online, following inspections, a contractor dashboard, records requests |\n| **Payments** | Card payments online and at the counter through Stripe or Clover, plus cash and check |\n| **Records** | Right-to-Know requests with exemptions and redaction, holds, the retention schedule, and an audit trail on every change |\n| **Reports** | Permit volume, processing time, revenue, census reporting, scheduled reports and Excel downloads |\n| **Moving in** | Imports from a CAMA export, GIS parcel layers, old permit spreadsheets and scanned property files (with OCR) |\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"68%\">\u003Cimg src=\"docs-site\u002Fstatic\u002Fimg\u002Fshots\u002Fresidents\u002Fparcel-page.png\" alt=\"The public parcel page a resident sees\">\u003C\u002Ftd>\n    \u003Ctd width=\"32%\">\u003Cimg src=\"docs-site\u002Fstatic\u002Fimg\u002Fshots\u002Finspectors\u002Fmy-day-phone.png\" alt=\"The inspector's day on a phone\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd>The public parcel page\u003C\u002Ftd>\n    \u003Ctd>An inspector's day on a phone\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## Try it\n\nThe [live demo](https:\u002F\u002Fdemo.chiban.us\u002Fdemo) runs the fictional Town of Alder Pond, NH. Sign in as the clerk, the building inspector, a board member, an applicant, a contractor or the administrator, among others. The data resets every night and no mail goes out.\n\n## Run it in your town\n\nThe [self-hosting guide](https:\u002F\u002Fdocs.chiban.us\u002Foperations\u002Fself-hosting\u002F) sets Chiban up on a single Linux host with Docker Compose: Caddy, the app, a background worker, PostgreSQL with PostGIS, and Garage for object storage, with every image pinned by digest. Backups, restore checks, upgrades, outbound mail and card payments each have their own page in the same section.\n\nThe rest of the [documentation](https:\u002F\u002Fdocs.chiban.us) is written for the people who use Chiban every day: land use staff, inspectors, board members, the finance office, the records custodian and the administrator.\n\n### State support\n\nChiban ships one state pack, **New Hampshire** (`packs\u002Fnh`). It holds the state's deadlines and holidays, notice and decision wording, appeal routes, building code editions, license types, parcel ID formats, Right-to-Know exemptions and records retention series. Adding a second state takes real work today. The [state pack guide](https:\u002F\u002Fdocs.chiban.us\u002Fstate-packs\u002Fwriting-a-pack\u002F) explains how the New Hampshire pack is built and what another state would need.\n\n## Built with\n\nNext.js 16 and React 19, tRPC, Drizzle ORM on PostgreSQL 16 with PostGIS, MapLibre with vector tiles served from PostGIS, S3-compatible object storage, and pg-boss for background jobs. Tests run on Vitest, with an integration lane against a real PostGIS container, and Playwright.\n\n## Development\n\n### Prerequisites\n\n- Node.js 24 or newer\n- pnpm 9\n- Docker with Compose (Postgres with PostGIS, Garage for S3-compatible object storage, and Mailpit run in containers)\n- Ghostscript 10 on the PATH for PDF\u002FA preservation (`brew install ghostscript` or `apt-get install ghostscript`)\n- OCRmyPDF with the English Tesseract data on the PATH, only to migrate scanned legacy files (`brew install ocrmypdf` or `apt-get install ocrmypdf tesseract-ocr-eng`)\n\n### Getting started\n\n```bash\npnpm install\ncp .env.example .env\n```\n\nGenerate a secret key and put it in `.env` as the value for key `k1` in `CHIBAN_SECRET_KEYS`:\n\n```bash\nnode -e \"console.log(require('crypto').randomBytes(32).toString('base64'))\"\n```\n\nStart the backing services, apply migrations, seed the fictional Town of Alder Pond, and run the app:\n\n```bash\ndocker compose -f docker-compose.dev.yml up -d --wait\npnpm db:migrate\npnpm storage:init\npnpm db:seed:demo\npnpm dev\n```\n\nIn a second terminal, start the background worker. `pnpm dev` runs only the web app. Without the worker, emails stay queued, exports never start and scheduled jobs never run:\n\n```bash\npnpm worker\n```\n\n`pnpm db:seed:demo` can be run again on a seeded database. It adds only what is missing, and on a day with no demo counter payments or inspector stops it adds them for that day, so the Today views are never empty. Some demo data is only created on an empty database. To start over, `pnpm db:reset:demo` drops every table in the database that `DATABASE_URL` names, then migrates and seeds again. It refuses to run unless `ENABLE_DEV_SIGN_IN=true`.\n\nThe app serves on http:\u002F\u002Flocalhost:3000. Mailpit shows outgoing mail on http:\u002F\u002Flocalhost:8025. If another process holds host port 1025 or 8025, set `MAILPIT_SMTP_PORT` or `MAILPIT_UI_PORT` before `docker compose up` and match `SMTP_URL` in `.env`. Browsers upload files straight to object storage, and `pnpm storage:init` sets each bucket to accept uploads only from the origins in `S3_CORS_ORIGINS` (comma-separated), or from the origin of `BASE_URL` when that is unset. `.env.example` lists port 3000. The e2e run derives its own origin from `E2E_PORT` (default 4730), so it needs no entry. To serve the app from another origin, add it to `S3_CORS_ORIGINS` and run `pnpm storage:init` again.\n\n### Dev sign-in\n\nWith `ENABLE_DEV_SIGN_IN=true` in `.env` and `NODE_ENV` other than `production`, http:\u002F\u002Flocalhost:3000\u002Fdev\u002Fsign-in lists the demo users (one per role, all at `alderpond.example`) and signs in as the one you pick.\n\nTo create a real staff account with a password and optional authenticator app:\n\n```bash\npnpm staff:create --email you@example.test --name \"Your Name\" --role admin --password \"a-long-password\"\n```\n\nThen sign in at `\u002Fstaff\u002Fsign-in` and enroll the authenticator at `\u002Fstaff\u002Faccount\u002Ftotp`. Applicants and contractors sign in with an emailed link at `\u002Fsign-in`.\n\n### Payment processors in development\n\nNo live processor key is configured anywhere in the repository. Stripe runs against `stripe-mock`, which the Compose file starts on port 12111. Set `STRIPE_API_BASE=http:\u002F\u002Flocalhost:12111` in `.env` (it is rejected when `NODE_ENV` is `production`) and save a Stripe account with the key `sk_test_123` at `\u002Fstaff\u002Fsettings\u002Fpayments`. `stripe-mock` is stateless and sends no webhooks, so it checks request shapes and response parsing only.\n\nSet `ENABLE_SIMULATED_PAYMENTS=true` to use the simulated processor, which backs the in-app checkout page and the counter card reader panel. Both say on screen that no live processor is connected. The Clover adapter runs against a local fake server (`pnpm clover:fake`) and has not been verified against a live merchant account.\n\n### Address checks\n\nMailing address fields check what was typed against the USPS Addresses API v3 and show the standardized address under the field, with a \"Use this\" button that fills it in. The check runs on the server, and the browser never sees the credentials.\n\n| Setting | Meaning |\n|---|---|\n| `USPS_CLIENT_ID` | Consumer Key of an app registered at developers.usps.com. Set it together with `USPS_CLIENT_SECRET`. |\n| `USPS_CLIENT_SECRET` | Consumer Secret of the same app. |\n| `USPS_API_BASE` | Defaults to `https:\u002F\u002Fapis.usps.com`. Use `https:\u002F\u002Fapis-tem.usps.com` for the USPS testing environment. |\n| `USPS_STUB` | `true` answers from a local stand-in that capitalizes, shortens street words and adds a ZIP+4, so the suggestion can be tried without credentials. A street named Nowhere finds no match and a street named Slow runs past the timeout. Rejected when `NODE_ENV` is `production`. |\n\nWith neither credential set, the fields work as plain text fields and nothing is sent anywhere. When USPS is slow (over 2 seconds), fails, or finds no match, no suggestion is shown. Each signed-in person can make 30 lookups a minute, and repeated addresses are answered from a cache for a day.\n\n### Checks\n\n```bash\npnpm gate\n```\n\nRuns lint, typecheck, the unit lane (also under a west-of-UTC time zone), the integration lane against a real PostGIS container, and the term gate. Set `CHIBAN_TERMS_FILE` to the path of a banned-terms file to enable the term gate. It reports file and line only.\n\n## Contributing\n\nIssues and pull requests are welcome. Run `pnpm gate` before opening a pull request. Fixtures, seeds and examples use the fictional Town of Alder Pond, NH, so never commit a real town's names, parcel IDs, owners or addresses.\n\nTo report a security problem, email hello@chiban.us rather than opening a public issue.\n\n## License\n\nChiban is licensed under the [GNU Affero General Public License v3.0](LICENSE).\n","Chiban 是一款面向美国小型城镇的开源土地用途管理软件，聚焦于以地块（parcel）为中心整合各类行政事务。核心功能包括建筑与贸易许可审批、现场检查调度、规划委员会及区划上诉委员会（ZBA）案件管理、以及违章代码执法，所有记录按地块归档并支持居民公开查阅。技术上基于 TypeScript 和 Next.js 构建，集成 PostGIS 实现地理空间能力，支持自托管部署，内置州级法规规则包（如新罕布什尔州），允许工作人员无代码配置表单、费用、通知模板和审批流程。适用于人员精简、预算有限的基层地方政府，解决纸质档案分散、时限管理模糊、跨部门协同低效等问题。","2026-11-24 04:47:42","CREATED_QUERY"]