Blueprint
Product thesis and MVP scope
Enable Brazilian lawyers to manage clients, track cases and attendances, and access federal jurisprudence in a single browser app.
Target user
Solo lawyers and small Brazilian law firms (1-10 attorneys) currently managing clients in Excel and manually searching TRF5 for jurisprudence.
MVP scope
- Client management: create, edit, list, and search clients with contact info.
- Attendance diary: schedule and view attendances per client with notes and follow-ups.
- TRF5 jurisprudence search: search by keyword or date, view results, and access full text.
- Basic authentication via Supabase (email/password) for data isolation per firm.
- Responsive SPA UI with dark/light mode using Tailwind and shadcn/ui components.
System
Entities, flows, and modules
Entities
Client
id, name, email, phone, document, notes, created_at — Core entity representing a law firm's client. Linked to attendances and cases.
Attendance
id, client_id, date, description, type, follow_up_date, created_at — Diary entry for client meetings or calls. Tracks history per client.
Case
id, client_id, case_number, court, status, filing_date, description, created_at — Legal case/proceeding linked to a client. Used to associate scraped jurisprudence.
Jurisprudence
id, court, number, summary, full_text_url, date, scraped_at — Scraped legal decision from TRF5, stored for searching and cross-referencing.
Flows
Client List
/clients — View, search, and filter all clients. Navigate to detail view.
Client Detail
/clients/:id — Edit client info, view associated attendances and cases.
Attendance Diary
/diary — Calendar-like view of attendances. Add new diary entries.
Case Law Search
/jurisprudence — Search TRF5 jurisprudence by keyword, date, or case number. View results with links to full text.
Authentication
/login — Sign in with email/password via Supabase Auth.
Backend modules
Supabase Database & Auth
Persist user, client, attendance, case, and jurisprudence data. Provide row-level security per firm. Handle authentication and session management. — Managed backend instantly, no custom server needed, while ensuring data isolation for multi-tenancy.
Scraper Service (Express)
Execute TRF5 website scraping on-demand or scheduled, parse HTML/PDF, store results in Supabase. Expose API endpoint to trigger scraping and get results. — Direct integration with Brazilian federal court is the key differentiator and primary value-add over generic CRMs.
Phases
Implementation phases
Phase 1: Foundation & Auth
Set up project skeleton, implement Supabase authentication and basic client CRUD.
Deliverables
- Vite + React + TypeScript + Tailwind project scaffolded.
- Supabase project created with auth enabled and row-level security policies.
- Client list and detail pages with TanStack Query fetching from Supabase.
- Login/Logout UI.
Exit criteria
- Users can sign up, log in, and perform CRUD on clients isolated to their firm.
Phase 2: Diary & Cases
Add attendance tracking and basic case management.
Deliverables
- Attendance diary page with create/list/edit functionality.
- Case entity CRUD and association with clients.
- Dashboard with recent attendances and cases.
Exit criteria
- Lawyers can log meetings/calls against clients and track case numbers in the app.
Phase 3: Jurisprudence Integration
Activate the scraper service and build case law search UI.
Deliverables
- Deployable Express scraper service that extracts TRF5 jurisprudence into Supabase.
- Search page with keyword/date filters dispelaying results from Supabase.
- Background job queue (e.g., BullMQ) to handle scraping tasks asynchronously.
Exit criteria
- End users can search and retrieve real TRF5 decisions inside the app.
Phase 4: Polish & Pilot
Improve UI/UX, deploy to production, and run pilot with law firms.
Deliverables
- Responsive mobile view, dark mode, and accessibility tweaks.
- Hosted demo instance with CI/CD pipeline on Vercel/Netlify and Supabase.
- Feedback collection from 5 pilot firms, with logs of feature requests.
Exit criteria
- At least 3 firms using the product for daily client management, with positive NPS responses.
Build first
Build first, skip first, and watchouts
First things to build
- Initialize Vite project with React, TypeScript, Tailwind, and shadcn configuration.
- Create Supabase project, define initial schema (clients, attendances, cases) and set up RLS.
- Implement Supabase Auth UI (login/signup) with email/password.
- Build client list page with TanStack Query integration to Supabase.
- Write a basic Express scraper that logs into TRF5 and returns parsed decisions as JSON.
Not to build yet
- Advanced analytics dashboards for firm performance.
- AI-based legal recommendation or automated document drafting.
- Integration with other Brazilian courts (STJ, STF, TJs).
- Native mobile apps (Android/iOS).
- Client portal or self-service client access.
- Invoice and billing management for law firms.
Risks / blockers
- Zero market validation: no evidence that lawyers will pay for or adopt the product.
- No license file: blocks commercial redistribution and may deter users.
- Scraper legality and reliability: TRF5 may introduce anti-bot measures or change UI, breaking extraction.
- Solo maintainer bus-factor: single contributor means high risk of abandonment.
- LGPD compliance: storing Brazilian citizen data requires data protection measures not yet scoped.
Builder prompts
Derived builder prompts
Master
Master context prompt
Expand prompt
You are building a fresh implementation inspired by the magisph/rv-adv repository. Treat the repository as a reverse-engineering reference, not as the default destination codebase. Infer the product, architecture, entities, and flows from the reference repository, then rebuild the core system intentionally from scratch. Do not blindly clone the original repo. Do not default to patching or refactoring it in place. Build in small phases and keep the first version focused and maintainable. Product thesis: Enable Brazilian lawyers to manage clients, track cases and attendances, and access federal jurisprudence in a single browser app. Commercial/product framing: Brazilian small law firms lack affordable tools combining CRM, diary, and automated legal research. By wrapping a Supabase-backed SPA with a court scraper, we deliver a uniquely localized product that replaces manual workflows. Target user: Solo lawyers and small Brazilian law firms (1-10 attorneys) currently managing clients in Excel and manually searching TRF5 for jurisprudence. MVP scope: - Client management: create, edit, list, and search clients with contact info. - Attendance diary: schedule and view attendances per client with notes and follow-ups. - TRF5 jurisprudence search: search by keyword or date, view results, and access full text. - Basic authentication via Supabase (email/password) for data isolation per firm. - Responsive SPA UI with dark/light mode using Tailwind and shadcn/ui components. Stack assumptions: - React 18 + Vite for fast SPA bundling and dev server. - Tailwind CSS v4 and shadcn/ui (Radix UI) for accessible, composable UI. - TanStack Query v5 for client-server state synchronization and caching. - Supabase (PostgreSQL + Auth + API) as backend, with row-level security for multi-tenancy. - Express scraper service (tsx) for TRF5 web scraping, returning structured JSON. - TypeScript throughout for type safety. Key entities: - Client: id, name, email, phone, document - Attendance: id, client_id, date, description, type - Case: id, client_id, case_number, court, status - Jurisprudence: id, court, number, summary, full_text_url Core pages / routes / flows: - Client List (/clients): View, search, and filter all clients. Navigate to detail view. - Client Detail (/clients/:id): Edit client info, view associated attendances and cases. - Attendance Diary (/diary): Calendar-like view of attendances. Add new diary entries. - Case Law Search (/jurisprudence): Search TRF5 jurisprudence by keyword, date, or case number. View results with links to full text. - Authentication (/login): Sign in with email/password via Supabase Auth. Backend services / modules: - Supabase Database & Auth: Persist user, client, attendance, case, and jurisprudence data. Provide row-level security per firm. Handle authentication and session management. - Scraper Service (Express): Execute TRF5 website scraping on-demand or scheduled, parse HTML/PDF, store results in Supabase. Expose API endpoint to trigger scraping and get results. Do not build yet: - Advanced analytics dashboards for firm performance. - AI-based legal recommendation or automated document drafting. - Integration with other Brazilian courts (STJ, STF, TJs). - Native mobile apps (Android/iOS). - Client portal or self-service client access. - Invoice and billing management for law firms. Major risks / blockers: - Zero market validation: no evidence that lawyers will pay for or adopt the product. - No license file: blocks commercial redistribution and may deter users. - Scraper legality and reliability: TRF5 may introduce anti-bot measures or change UI, breaking extraction. - Solo maintainer bus-factor: single contributor means high risk of abandonment. - LGPD compliance: storing Brazilian citizen data requires data protection measures not yet scoped. Work in phases. After each phase, summarize what was built, what remains, and which assumptions from the reference repo you intentionally did or did not keep.
Phase 1
Phase 1 foundation prompt
Expand prompt
Phase 1 foundation Objective: Set up project skeleton, implement Supabase authentication and basic client CRUD. Deliverables: - Vite + React + TypeScript + Tailwind project scaffolded. - Supabase project created with auth enabled and row-level security policies. - Client list and detail pages with TanStack Query fetching from Supabase. - Login/Logout UI. - Exit: Users can sign up, log in, and perform CRUD on clients isolated to their firm. Rules: - Start by reverse engineering the product shape from the reference repo, then create a clean fresh project structure. - Set up the minimum schema, services, routes, and project structure required for the MVP. - Avoid polish work, avoid optional abstractions, and avoid copying implementation details you do not understand. Start by reverse engineering the reference repository, then implement the fresh build in the smallest clean sequence.
Phase 2
Phase 2 core flow prompt
Expand prompt
Phase 2 core flow Objective: Add attendance tracking and basic case management. Deliverables: - Attendance diary page with create/list/edit functionality. - Case entity CRUD and association with clients. - Dashboard with recent attendances and cases. - Exit: Lawyers can log meetings/calls against clients and track case numbers in the app. Rules: - Implement the core pages, routes, and backend modules needed for the happy path in the fresh build. - Use the reference repo for behavior and architecture cues, not as the code target. - Preserve maintainability and add only the minimum comments needed. Start by reverse engineering the reference repository, then implement the fresh build in the smallest clean sequence.
Phase 3
Phase 3 polish/refactor prompt
Expand prompt
Phase 3 polish and refactor Objective: Activate the scraper service and build case law search UI. Deliverables: - Deployable Express scraper service that extracts TRF5 jurisprudence into Supabase. - Search page with keyword/date filters dispelaying results from Supabase. - Background job queue (e.g., BullMQ) to handle scraping tasks asynchronously. - Exit: End users can search and retrieve real TRF5 decisions inside the app. Rules: - Refine the fresh implementation without introducing a large refactor. - Improve validation, edge cases, and developer ergonomics where the core flow already exists. - Prefer targeted cleanup over architecture churn or feature creep. Start by reverse engineering the reference repository, then implement the fresh build in the smallest clean sequence.
Deploy
Deploy/finalization prompt
Expand prompt
Deploy and finalization Objective: Prepare the implementation for release, verification, and handoff. Deliverables: - Verify the main flows work. - Check configuration, environment assumptions, and release blockers. - Summarize remaining risks and suggested follow-up work. Rules: - Do not add speculative infrastructure. - Focus on practical release readiness, tests, and explicit known gaps versus the reference repo. Start by reverse engineering the reference repository, then implement the fresh build in the smallest clean sequence.
Bugfix
Bugfix/refinement prompt
Expand prompt
Bugfix and refinement Objective: Fix the specific bug or implementation gap in the fresh build while preserving the established architecture. Deliverables: - Reproduce the issue in the rebuilt implementation. - Patch the smallest reliable fix. - Explain what caused it, how to verify the fix, and whether the reference repo suggests an architecture guardrail you missed. Rules: - Inspect the fresh implementation before editing. - Do not rewrite working systems just to fix a localized issue. Start by reverse engineering the reference repository, then implement the fresh build in the smallest clean sequence.
Shared with Git Pitcher
This webpage is a public artifact generated from a repository. Git Pitcher turns repos into Repo Reads, Audits, and Build Packs you can actually use with an AI coding agent.