About the Project

Inspiration Brazil has over 820,000 active civil society organizations (OSCs) — NGOs, associations, and foundations — that manage public funding through complex agreements governed by strict legislation like the MROSC (Law 13,019/2014). Every year, these organizations lose funding, face penalties, or have their projects suspended simply because they missed a deadline buried in an 80-page public notice or failed to deliver a mandatory report on time. The inspiration came directly from a real user: a project coordinator who told us she constantly missed task deadlines and had no way to read every document in full to identify what needed to be done. That conversation made us realize this wasn't a personal problem — it was a systemic one affecting hundreds of thousands of organizations across the country.

What We Built GestãoOSC is the first AI-powered administrative management platform built specifically for the Brazilian third sector. Our core differentiator: users upload a PDF of a public notice, grant agreement, or work plan — and our AI (powered by Google Gemini 2.5 Flash) reads the entire document and automatically extracts:

Tasks with deadlines — "Submit quarterly financial report within 30 days of disbursement" Mandatory documents — what needs to be delivered, when, and in what format Prohibited uses of funds — clauses that restrict how money can be spent Critical alerts — clauses that, if missed, could result in the full return of public funds

The AI is trained on the specific legal context of the Brazilian third sector, including MROSC, TRANSFEREGOV, and the Licitações Law (14,133/2021) — something no generic project management tool offers.

Beyond AI, GestãoOSC includes: Multi-project workspace — each grant agreement has its own isolated space with tasks, documents, financials, and team Integrated financial tracking — revenue and expense entries linked to receipts and organized by project Granular role system — admin, manager, and member roles both at the organization and project level; a person can be a manager in one project and a member in another Automatic deadline notifications — alerts sent 7, 3, and 1 day before each task is due Impact Report — exportable executive report for donors and funders (Institutional plan) 7-day free trial — no credit card required

How We Built It LayerTechnologyFrontendNext.js 16 (App Router), CSS inlineBackendSupabase (PostgreSQL + Auth + Storage + Edge Functions)AIGoogle Gemini 2.5 Flash via REST APIPaymentsStripe Payment LinksDeploymentVercelAnalyticsGoogle Analytics 4 The AI analysis runs inside a Supabase Edge Function (Deno runtime). The PDF is downloaded from Supabase Storage, converted to base64, and sent to the Gemini API along with a specialized prompt trained on Brazilian third-sector legal frameworks. The response is a structured JSON containing tasks, alerts, required documents, prohibited uses, and deadline rules — all automatically saved to the database and displayed to the user.

Challenges We Faced

  1. Getting AI to understand Brazilian bureaucracy Generic prompts returned generic results. We had to write a detailed system prompt covering specific legal references, deadline calculation logic (e.g., "30 business days after disbursement"), and the vocabulary used in Brazilian public notices. Several iterations were needed before the output became actionable.
  2. PDF size vs. token limits Large PDFs (80+ pages) caused the Gemini response to be truncated, resulting in broken JSON. We solved this by increasing maxOutputTokens to 65,536 and implementing a JSON repair function that closes unclosed brackets when the response is cut off.
  3. Authentication link flows Supabase sends authentication errors in the URL fragment (#error=...) which server-side route handlers cannot read — only client-side JavaScript can. We built a dedicated /auth/confirm client page to intercept fragment parameters and route users correctly (password reset → /redefinir-senha, invite → /definir-senha).
  4. Role-based access at the project level Most platforms implement roles at the organization level only. OSCs have a different reality: the same person is an accountant for one project and a field coordinator for another. We built a dual-role system combining usuarios.papel (organization role) with projeto_membros.papel (project role) and a usePermissoes hook that computes effective permissions dynamically.

Built With

Share this project:

Updates