Decoding Salário Simples: Behind the CLT vs. PJ Calculator Link to heading
Choosing between a permanent (CLT) role and a contractor (PJ) proposal is one of the biggest dilemmas for Brazilian professionals. To solve this with data, we created Salário Simples, a modern application that automates these complex calculations. In this article, we explore the technology and logic that power this tool.
The Tech Stack Link to heading
The project was built using the latest tools in the Web ecosystem:
- Next.js 16 (App Router): Leveraging optimized server and client components.
- React 19: Taking advantage of performance improvements and the library’s new features.
- TypeScript: Ensuring type safety across all financial calculations and avoiding common precision errors.
- Tailwind CSS 4.0: For a responsive, clean interface with native Dark
- Mode support.
Business Logic: The Heart of the App Link to heading
The complexity of Salário Simples lies in the accuracy of Brazilian tax rules, divided into two main modules:
1. The CLT World Link to heading
The calculation engine (salaryCalculator.ts) processes the progressive INSS (social security) brackets and IRRF (income tax) rates, including deductions for dependents. Beyond monthly net pay, the app projects annual income by including the 13th salary and vacation bonuses, providing a realistic view of total earnings.
2. The PJ Ecosystem (Simples Nacional) Link to heading
In the PJ module (pjCalculator.ts), we focus on the Simples Nacional (Annex V). The logic includes:
- Factor R: Defaulted to 28% via Pro-labore for tax optimization.
- Corporate Taxes: Automatic calculation of the effective tax rate based on annual revenue.
- Double Taxation Handling: The app deducts both personal taxes (INSS/IRRF on pro-labore) and corporate taxes to show the true net profit.
3. The “Magic” of PJ Equivalency Link to heading
A standout feature is the equivalency search. Using a binary search algorithm (running 30 iterations in milliseconds), the system finds exactly how much you need to invoice as a PJ contractor to match the annual net income of a specific CLT salary.
Deployment and CI/CD: Automating the Workflow Link to heading
To ensure every improvement reaches the user safely, we use a robust CI/CD pipeline:
-
GitHub Actions: Every Pull Request or Push to the main branch triggers an automated workflow that runs lint (ESLint) and the Next.js build. This ensures the code is healthy before it even leaves the repository.
-
Vercel Deployment: Once the code passes the GitHub Actions checks, Vercel handles the deployment. Native integration allows for “Deploy Previews” for every branch, making it easy to review new features.
Conclusion Link to heading
Salário Simples proves that financial tools don’t have to be complex or uninviting. With a solid stack and efficient algorithms, we provide clarity for career decision-making.
Like the project? Check out project at: https://salario-simples.lucasnramos.com