Independent backend builder
Homeowner Permit Compliance Checker
Built Python ingestion with Apify, a shared PostgreSQL rule schema, FastAPI project-attribute lookups, and an OpenAI conversational agent that calls database tools and explains retrieved requirements.
Problem + constraints
Homeowners need to connect project details with changing jurisdiction-specific requirements and understand the sources behind the answer.
- Municipal raw documents and chunks are stored in Supabase. Its database-size quota currently blocks verification of the résumé’s 50+ source-site count.
- Canonical implementation: Preclear/Preclear-Astra. API and UI preview checks passed; live database and model configuration remain pending.
- Initial project: January–March 2026. Further development in October 2026 added FastAPI lookups, Apify ingestion and the conversational agent.
Contribution boundary
- Added Python and Apify collection with source evidence, normalized rule candidates and reviewed PostgreSQL ingestion.
- Built FastAPI endpoints that map project attributes to jurisdiction-specific permit rules.
- Built a conversational OpenAI agent that calls a validated database lookup tool and explains retrieved requirements in plain language.
- Production adoption, uptime, accuracy or latency guarantees.
- Retrospective proof that newly added features existed during the project dates.
System design, explained
The 30-second explanation
Think of this as a research assistant with a checked rulebook. First, municipal documents are collected and a person reviews the extracted rules. Then a homeowner asks a question. The assistant looks up the rules for the selected location and explains the result with sources.
Implementation statusCanonical app: Preclear/Preclear-Astra. UI and API code are deployed; auth, database and model configuration still prevent a verified live answer. The 50+ source-site figure is not verified.
Follow the data
A map of the moving parts.
Select any stage to inspect its input, work, output and failure behavior.
Example, not a live resultIllustrative question: “Do I need a permit for a 120-square-foot shed?” The homeowner selects a jurisdiction; no permit determination below is a real municipal answer.
01 / Prepare the rulebook
Ingestion is separate from the homeowner’s request. Existing Supabase documents can be reused.
Alternative source inputs
Reviewed rules → PostgreSQL → available to the lookup in lane 02
02 / Answer a question
The model translates the question; application code evaluates the rules.
Tool result → back to OpenAI for explanation → response routes in lane 03
03 / Return an honest result
The model receives the tool result and explains it; it cannot approve a permit.
Lookup outcome · two possible routes
Plain-language response and retrieved source links → homeowner interface
Technology, with a purpose
What each tool is responsible for.
Languages, frameworks and services play different roles. Here is why each belongs in this system.
| Technology | Responsibility | Why this choice |
|---|---|---|
| React + TypeScriptBrowser interface | Question entry, jurisdiction selection, conversation and source display. | Components organize the interface; types describe data exchanged with the API. |
| ViteFrontend build tool | Develops and bundles the React/JavaScript application. | Produces the static frontend served with the API deployment. |
| Python + FastAPIApplication service | Validates requests, verifies sessions and exposes chat and deterministic lookup endpoints. | Keeps business rules and ingestion in Python with explicit API contracts. |
| ApifyCollection service | Collects specified municipal pages for ingestion. | Separates page acquisition from rule extraction and review. |
| OpenAILanguage model API | Drafts ingestion candidates and interprets homeowner questions using read-only tools. | Handles varied wording while decisions remain in the rule evaluator. |
| PostgreSQL / SupabaseData + authentication | Stores raw documents, chunks and reviewed rules; verifies homeowner sessions. | A relational schema preserves jurisdiction, conditions and source provenance. |
| VercelHosting | Serves the React app and same-origin FastAPI Python function. | Keeps browser and API under one origin; hosting alone does not configure model or data access. |
Interview walkthrough
How I explain the design.
Start with the problem, follow one input, then explain the tradeoff.
- 01
I separate building the rulebook from answering a homeowner. Crawled or existing documents become candidates, then a human reviews them.
- 02
For a question, the UI sends a jurisdiction and authenticated request. OpenAI turns everyday wording into a constrained lookup tool call.
- 03
Python evaluates reviewed PostgreSQL rules. The model explains that result and cites its sources; it cannot change the jurisdiction or write to the database.
- 04
The most important design choice is how we handle uncertainty: missing details or conflicting rules mean municipal verification, not a guessed answer.
Decisions + tradeoffs
Preserve conditions and source provenance
Normalized rules retain compound conditions, citations, source hashes, review dates and expiry.
Keep decisions in the lookup service
FastAPI evaluates all applicable reviewed rules; missing inputs and conflicts require jurisdiction verification.
Constrain agent tools
The agent can call one read-only lookup tool, with jurisdiction fixed by the server and bounded tool rounds.
Evidence ledger
Claims are labeled by what a reader can inspect now. Withheld items include the measurement needed before publication.
Implementation and local verification
LimitedCanonical React/Vite and FastAPI implementation added in October 2026: 24 Python tests, production build, and deployed API authentication checks passed. Live data/provider validation remains pending.
- Method
- Local domain, orchestration and API checks; provider responses are mocked.
- Source / path
- Repository implementation and test files
Deployment and measured outcomes
WithheldVercel preview serves the API and interface. No successful live model/database integration, production benchmark or coverage measurement is claimed.
- Method
- Verify deployed services and publish dated measurement artifacts before adding outcome claims.
- Source / path
- Explicit verification boundary
Not production-ready
- Municipal raw documents and chunks are stored in Supabase. Its database-size quota currently blocks verification of the résumé’s 50+ source-site count.
- Canonical implementation: Preclear/Preclear-Astra. API and UI preview checks passed; live database and model configuration remain pending.
- Initial project: January–March 2026. Further development in October 2026 added FastAPI lookups, Apify ingestion and the conversational agent.
- Run deployed integration checks with representative inputs and record dated results.
- Monitor failures, retries and operating costs with a defined ownership process.