Back to projects

Project case study

  • Demonstration project
  • Synthetic data
  • Web implementation

Public Revenue Intelligence Platform

A demonstration web analytics product for exploring synthetic revenue, targets, time-based changes, and revenue composition through an executive interface.

My roleBI Analysis and Analytics Product Development
Technologies used
  • Next.js
  • React
  • TypeScript
  • Tailwind CSS
  • Recharts
  • Zod
  • Vercel Analytics
Private source codeVerifiable technical evidence is documented in this case study.
Landing-page mockup for the Public Revenue Intelligence Platform with illustrative values.
Visual concept for the Public Revenue Intelligence Platform with illustrative indicators and values.

Overview

Summary

A demonstration analytics product for exploring revenue, targets, time-based changes, and revenue composition through an executive interface.

Problem

Fiscal datasets can be extensive and fragmented, making it difficult to identify trends, deviations, and relevant revenue sources.

My role

Indicator structuring, analytical scenario modeling, visualization development, and executive narrative design.

Target attainment
97.2%
Published demo / /api/revenue?year=2026, synthetic data / 13 Oct 2026
Fiscal health score
99/100
Published demo / /api/revenue?year=2026, concentration heuristic / 13 Oct 2026
Monthly records in 2026
120
Published demo / count from /api/revenue?year=2026 / 13 Oct 2026

Data and assumptions

The data is entirely synthetic and reproducible. A deterministic TypeScript generator creates monthly records with seasonality, trend, and controlled anomalies; the current source has no database, CSV ingestion, official API, or personal information.

An independent demonstration project with no institutional affiliation, developed to show how revenue indicators can support fiscal analysis and decision-making.

The project was inspired by knowledge gained from professional public-data analysis workflows without using internal systems, confidential data, or institutional materials.

Volume
600 synthetic records
Period
January 2022 to December 2026
Granularity
One month per tax and fictional municipality
Data structure

Modeled entities

  • Revenue fact: period, tax, category, estimated amount, collected amount, comparisons, and target status.
  • Taxes: ISS, IPTU, ITBI, TLP, TLF, CIP, Active Debt, Fines and Interest, Property Revenue, and Other Revenue.
  • Populated categories: Own-source Revenue, Property Revenue, and Other Revenue.
  • Calendar: year, month, month name, and monthly key from 2022 through 2026.
  • Municipality: one entirely fictional entity identified as mun-001.

Solution architecture

The flow separates data generation, access contract, calculations, APIs, and visualization to keep rules reproducible and allow a future real source without rewriting the interface.

  1. Deterministic synthetic generator

    Calendar, tax, seasonality, and seeded-noise inputs produce 600 TypeScript records identified as simulated-model-v1.

  2. Data contract and provider

    Domain types and RevenueDataProvider accept filters and return records and aggregates; the current implementation is exclusively an in-memory mock.

  3. Calculations and analytical rules

    Pure functions calculate totals, gap, attainment, changes, shares, accumulated values, forecast, score, and explainable insights.

  4. Route Handlers and validation

    Next.js APIs apply Zod-validated filters and return JSON in a consistent envelope.

  5. Executive web dashboard

    Server Components load the dataset, while client islands implement filters, the simulator, and Recharts visualizations in the responsive interface.

Indicators and business rules

The definitions below map to the application's TypeScript functions and methodology. Every result is calculated from synthetic data.

DefinitionUnitCalculation ruleUseLimitation
Estimated revenueSum of the reference values in the selected slice.BRLSum of estimatedAmount.Establish the comparison base for targets and projections.The estimate is generated by the synthetic model, not by an actual budget law.
Collected revenueSum of the values simulated as collected in the selected slice.BRLSum of collectedAmount.Compare performance, composition, and time-based development.The values do not represent official revenue or a real fiscal outcome.
Financial gapDifference between collected and estimated revenue.BRLCollected revenue − estimated revenue.Identify positive or negative deviations from the reference.The sign depends on two synthetic measures and does not express real budget impact.
Target attainmentPercentage collected relative to the estimated amount.%Collected revenue ÷ estimated revenue × 100.Monitor adherence to the target in the filtered period.It returns zero when the estimated base is zero and uses demonstration targets only.
Monthly changePercentage change in collected revenue between consecutive months.%(Current month − previous month) ÷ previous month × 100.Observe acceleration, decline, and short-term seasonality.The first point has no prior comparison and receives a zero change value.
Annual changePercentage change in aggregate collected revenue between consecutive years.%(Current year − previous year) ÷ previous year × 100.Compare the growth trend across the five-year horizon.The series includes the artificial trend defined by the generator.
Tax shareEach tax's share of total collected revenue in the selected slice.%Tax revenue ÷ total collected revenue × 100.Analyze concentration and dependency in the simulated fiscal composition.The weight of each tax was defined for the demonstration scenario.
Annual forecastClosing estimate based on the collection pace through the cutoff month.BRL and %Observed monthly average × 12, compared with the annual target.Signal healthy, attention, or risk closing scenarios.Heuristic forecast with a default cutoff at month 9 and no statistical model.
Revenue Health ScoreComposite score summarizing the health of the demonstration revenue slice.0 to 100Combines attainment, trend, concentration, below-target months, and anomalies with fixed weights.Provide a consolidated executive reading of the selected slice.Weights and bands are heuristic and were not calibrated with real fiscal data.

Estimated revenue

Sum of the reference values in the selected slice.

Unit
BRL
Calculation rule
Sum of estimatedAmount.
Use
Establish the comparison base for targets and projections.
Limitation
The estimate is generated by the synthetic model, not by an actual budget law.

Collected revenue

Sum of the values simulated as collected in the selected slice.

Unit
BRL
Calculation rule
Sum of collectedAmount.
Use
Compare performance, composition, and time-based development.
Limitation
The values do not represent official revenue or a real fiscal outcome.

Financial gap

Difference between collected and estimated revenue.

Unit
BRL
Calculation rule
Collected revenue − estimated revenue.
Use
Identify positive or negative deviations from the reference.
Limitation
The sign depends on two synthetic measures and does not express real budget impact.

Target attainment

Percentage collected relative to the estimated amount.

Unit
%
Calculation rule
Collected revenue ÷ estimated revenue × 100.
Use
Monitor adherence to the target in the filtered period.
Limitation
It returns zero when the estimated base is zero and uses demonstration targets only.

Monthly change

Percentage change in collected revenue between consecutive months.

Unit
%
Calculation rule
(Current month − previous month) ÷ previous month × 100.
Use
Observe acceleration, decline, and short-term seasonality.
Limitation
The first point has no prior comparison and receives a zero change value.

Annual change

Percentage change in aggregate collected revenue between consecutive years.

Unit
%
Calculation rule
(Current year − previous year) ÷ previous year × 100.
Use
Compare the growth trend across the five-year horizon.
Limitation
The series includes the artificial trend defined by the generator.

Tax share

Each tax's share of total collected revenue in the selected slice.

Unit
%
Calculation rule
Tax revenue ÷ total collected revenue × 100.
Use
Analyze concentration and dependency in the simulated fiscal composition.
Limitation
The weight of each tax was defined for the demonstration scenario.

Annual forecast

Closing estimate based on the collection pace through the cutoff month.

Unit
BRL and %
Calculation rule
Observed monthly average × 12, compared with the annual target.
Use
Signal healthy, attention, or risk closing scenarios.
Limitation
Heuristic forecast with a default cutoff at month 9 and no statistical model.

Revenue Health Score

Composite score summarizing the health of the demonstration revenue slice.

Unit
0 to 100
Calculation rule
Combines attainment, trend, concentration, below-target months, and anomalies with fixed weights.
Use
Provide a consolidated executive reading of the selected slice.
Limitation
Weights and bands are heuristic and were not calibrated with real fiscal data.

Technical decisions

Deterministic synthetic fiscal modeling

Reason
Create a reproducible series with trend, seasonality, and anomalies without exposing institutional data.
Consequence / trade-off
Realism depends on artificial parameters and cannot support conclusions about a real municipality.

Separation of data, calculations, and visualization

Reason
Reuse the same rules across pages, APIs, charts, tables, insights, and the simulator.
Consequence / trade-off
The architecture introduces contracts that must remain synchronized.

Responsive executive reading

Reason
Keep KPIs, filters, charts, and the table usable on desktop and smaller devices.
Consequence / trade-off
Analytical density must be distributed across blocks and viewport-specific representations.
Additional technical decisions

Server-first with client islands

Reason
Load data on the server and limit interactive JavaScript to filters, charts, insights, and the simulator.
Consequence / trade-off
Server and client boundaries require serializable contracts.

Replaceable provider

Reason
Avoid coupling the interface directly to the mock generator and prepare for a future authorized source.
Consequence / trade-off
The abstraction does not add persistence: the current implementation remains in memory.

Explainable insights and forecast

Reason
Centralize alerts, evidence, and recommendations in testable TypeScript rules.
Consequence / trade-off
Fixed rules and weights simplify auditing but do not replace statistical or fiscal validation.

Technical evidence

The application, endpoints, methodology, and local references are presented according to their actual access level.

Public application

Published application

Public landing page with a demonstration-project statement, synthetic KPIs, and access to the dashboard.

Open evidence

Public application

Executive dashboard

Public interface with filters, KPIs, score, forecast, charts, table, insights, and CSV export.

Open evidence

Public endpoint

Revenue API

Public endpoint with synthetic records, totals, ranking, categories, score, and forecast for the 2026 slice.

Open evidence

Public endpoint

Forecast API

Public endpoint with projected closing, gap, attainment, annual target, and scenario status.

Open evidence

Public documentation

Published methodology

Public page documenting fictional data, formulas, score, insights, and simulation.

Open evidence
Implementation references

Code reference

Synthetic data generator

Deterministic series from 2022 through 2026 with ten taxes, seasonality, and controlled anomalies.

Code referencesrc/data/mock-revenue.ts · src/data/dictionary.ts

Code reference

Indicator rules

Pure functions for totals, changes, shares, accumulation, forecast, and Revenue Health Score.

Code referencesrc/lib/calculations.ts · src/lib/forecast.ts

Private source code

Private repository

The source code is private; the published application and its APIs are the verifiable evidence.

Demonstration scenario indicators

Simulated data
BRL 248,587,119
Collected revenue
Sum of collectedAmount in the synthetic 2026 dataset.
Simulated data
97.2%
Target attainment
Ratio between synthetic collected and estimated revenue in 2026.
Simulated data
99/100
Revenue Health Score
Heuristic score calculated from the same demonstration slice.

Indicators calculated for the default 2026 slice from 120 synthetic records. They do not represent official revenue, a real fiscal outcome, or institutional performance.

Values reproduced by the published application and the /api/revenue?year=2026 and /api/forecast?year=2026 endpoints.

Demonstrated capabilities

  • Fiscal indicator modeling.
  • Time-based and comparative analysis.
  • Executive narrative design.
  • Visualization of synthetic public-sector data.
  • Web analytics product development.
  • Assumption and limitation documentation.

Limitations and next steps

Limitations

  • Entirely synthetic data, municipality, targets, and outcomes.
  • Independent project with no institutional affiliation or integration with government systems.
  • No database, official refresh, or connected public source in the current implementation.
  • Forecast, score, and insights based on demonstration heuristics.
  • The repository is private, and the mockups do not reproduce the current API values.

Next evolutions

  • Authorized integration with an official open-data source.
  • Data-quality, provenance, and incremental-refresh validation.
  • Expanded history and configurable deviation alerts.
  • Authentication and access control for institutional scenarios.
  • A real Power BI version documented separately from the web application.
  • Observability and expanded automated testing.

The images are product concepts and visual mockups. They do not represent a government platform or reproduce the values currently calculated by the published application.

Landing-page mockup for the Public Revenue Intelligence Platform with illustrative values.
Landing-page mockup with illustrative indicators and the visual direction of the analytics product.

Optional technical details

How to run
  1. Open the application published on Vercel.
  2. Open the dashboard to explore filters, KPIs, charts, rankings, and insights.
  3. Review the public methodology for formulas, score, and simulation rules.
  4. Use the public APIs to verify records and aggregates from the synthetic dataset.

Next project

Touchless Web Gesture Interface

Workspace controlled by hand gestures on the camera, with an adaptive frame pipeline and a custom gesture engine.

View full case