Skip to content

Repository files navigation

Ágio

B2B2C earned wage access fintech for formally employed (CLT) workers earning up to 3 minimum wages. Distributed through accounting firms as the go-to-market channel to reach SMEs with 10 to 100 employees — a segment ignored by well-capitalized players.

Developed as a solo project in the Entrepreneurship track at Inteli (Instituto de Tecnologia e Liderança). Class T08-G102.

Last technical update: June 2026 (codebase v2.0)

Notice: this repository contains a functional MVP demo with fictional data. No real financial transactions are processed. No real CPF numbers or personal data are stored.


Live demo

Deployed on Render's free tier:

Interface URL
Login (accounting office) https://agio-3.onrender.com/
Accounting firm panel https://agio-3.onrender.com/painel.html
Employee page https://agio-3.onrender.com/funcionario.html?empresa_id=1
Health check https://agio-3.onrender.com/api/health

Any email and password are accepted at login (demo authentication). For the employee page, use CPF 111.222.333-44 (Ana Silva, Padaria Flores, empresa_id=1).

Render's free tier has an ephemeral filesystem — the SQLite database is recreated and re-seeded on every redeploy.


The model in one line

Ágio delivers emergency credit to base-level CLT workers — no Serasa check, automatic deduction from the next payroll. It distributes the product through accounting firms that already serve SMEs and already process payroll monthly. The employer authorizes without paying or assuming risk. The accounting firm earns a recurring commission on every advance. The worker accesses via a CPF link and resolves it in three taps.

Business rules

Rule Value
Advance ceiling 40% of net salary (employees with >90 days tenure); 20% otherwise
Available balance Ceiling − advances already approved in the active payroll cycle
Service fee 9.99% of the advance amount
Minimum advance R$ 50.00
Accounting office commission 35% of the collected fee
Payroll deduction Advance amount + fee

The demo flow approves advances instantly on request — there is no pending/approval queue.

The three layers of the demo

Accounting firm panel (accountant) Accessed via login at localhost:3000. The accountant views all companies in their portfolio, uploads the payroll CSV, monitors employees with advance ceilings and available balances, accesses each employee's individual history, and downloads the cycle's deduction report as a CSV.

Employee page (CLT worker) Accessed via localhost:3000/funcionario.html?empresa_id=X. The worker enters their CPF, sees their available balance in real time — already deducting open advances — requests the desired amount within the limit, and views their advance history grouped by payroll cycle. No app, no registration, no password.

Deduction report Generated by the accountant at the end of the cycle. CSV with name, CPF, amount advanced, fee (9.99%), office commission, Ágio's net revenue, and total to be deducted per employee. The accountant downloads it and enters it as a deduction in the payroll system they already use (Domínio, Totvs, Senior). No existing process is replaced.


Tech stack

Layer Technology Version
Runtime Node.js 20.x
Backend framework Express 4.18.x
Database SQLite via better-sqlite3 9.4.x
File upload Multer 1.4.x
CSV parsing csv-parse 5.5.x
CORS cors 2.8.x
Frontend Plain HTML + CSS + JavaScript
Version control GitLab (canonical) / GitHub (Render mirror)
Development assistance Claude Pro Max (Anthropic)

No frontend framework. No ORM. Direct SQL via better-sqlite3 (synchronous by design). Fake login — accepts any credentials in the MVP.


Installation and setup (local)

Prerequisites

  • Node.js 20.x — nodejs.org (required for better-sqlite3 native bindings)
  • Git — git-scm.com
  • PowerShell (Windows) or bash (Linux/macOS)

Step by step

1. Clone the repository

git clone https://lucas.galvao:[TOKEN]@git.inteli.edu.br/lucas.galvao/agio.git
cd agio

2. Install dependencies

npm install

3. Start the server

node server.js

Expected output:

Ágio rodando em http://localhost:3000

On first run, server.js checks whether the database is empty and automatically runs seed.js if no data exists — no manual seeding step is required.

4. Open in browser

Interface URL
Accountant login http://localhost:3000
Accounting firm panel http://localhost:3000/painel.html (after login)
Employee page http://localhost:3000/funcionario.html?empresa_id=1
API health check http://localhost:3000/api/health

Any email and password are accepted at login.

Reset the database

Remove-Item agio.db -ErrorAction SilentlyContinue
node server.js

Production deployment

Render's build command runs npm install --build-from-source (compiles better-sqlite3 native bindings against Render's Linux environment) and starts with node server.js. Render cannot connect directly to Inteli's GitLab instance, so deployment uses a public GitHub mirror (github.com/LucasG99/agio); every push to the mirror triggers an automatic redeploy.


API routes

Method Route Description
POST /api/auth/login Accountant login (fake — credentials not validated)
GET /api/empresas?escritorio_id= List companies for an accounting firm
POST /api/empresas Register a new company
GET /api/funcionarios?empresa_id= List employees with ceiling and available balance
GET /api/funcionarios/:id Employee detail + advance history
GET /api/ciclos?empresa_id= List payroll cycles
POST /api/ciclos/upload Upload payroll CSV
POST /api/antecipacoes Create advance request (with validations)
GET /api/antecipacoes?funcionario_id= Advance history
GET /api/relatorio?empresa_id=&ciclo_id= Download deduction report CSV
POST /api/acesso Employee authentication by CPF
GET /api/acesso/:funcionario_id Employee data + current available balance
GET /api/health Health check ({ "ok": true })

CSV upload format

The file must include the columns below, with a header row:

cpf,nome,salario_liquido,data_admissao
111.222.333-44,Ana Silva,2200.00,2024-01-10
222.333.444-55,Carlos Mota,1800.00,10/03/2024
  • Delimiter is auto-detected (; or ,).
  • data_admissao accepts both YYYY-MM-DD and DD/MM/YYYY.
  • Rows missing a CPF or salary are skipped and counted in the upload summary.
  • Existing employees are matched by CPF + company and updated; new ones are inserted.
  • A previous cycle for the same competência is marked inativa when a new one is uploaded.

Security and data privacy (LGPD)

Current state — MVP demo

Concern Status
Accountant authentication Not implemented — login returns the first office regardless of credentials
API authorization Not implemented — any escritorio_id/empresa_id is accepted without verification
Employee authentication CPF lookup only — no password or OTP
CPF storage Plain text
HTTPS Provided by Render in production; not configured locally
CORS Open (no origin restriction)
Rate limiting Absent

The MVP operates exclusively with fictional data generated by seed.js. No real CPF numbers, real names, or personal data are collected or stored. These are known and intentional limitations of the demo — the product is not prepared to handle real data at this stage.

Requirements for live operation (production)

The transition to a production product requires, at minimum:

Requirement Description
Real authentication JWT or OAuth with httpOnly cookies, short-lived tokens
Sensitive data encryption CPF stored as hash (bcrypt or equivalent)
HTTPS TLS certificate mandatory in production
Managed database Migration from SQLite to PostgreSQL
Data retention policy Retention period per LGPD Art. 15
Informed consent Worker acceptance term on first access
Audit logging Access and change logs for compliance purposes
Data impact report (RIPD) Required for processing financial and income data

Ágio handles sensitive data — CPF numbers, salary figures, individual financial history — that fall under protected categories of Brazil's General Data Protection Law (Lei Geral de Proteção de Dados, Law 13.709/2018). Full LGPD compliance is a pre-operational requirement before any pilot with real data.


File structure

agio/
├── server.js              # Entry point — Express on port 3000
├── db.js                  # SQLite connection, schema DDL, pragmas
├── seed.js                # Fictional data for demonstration
├── package.json
├── agio.db                # SQLite database (generated by seed, not versioned)
├── uploads/                # Temporary CSV storage (created automatically)
├── public/
│   ├── index.html         # Accountant login
│   ├── painel.html        # Accounting firm panel
│   ├── funcionario.html   # Employee page
│   └── css/
│       └── style.css
└── routes/
    ├── auth.js
    ├── empresas.js
    ├── funcionarios.js
    ├── ciclos.js
    ├── antecipacoes.js
    ├── relatorio.js
    └── acesso.js

Technical documentation

Artifact Location
Full technical documentation docs/ (architecture, data model, API reference, deployment)
Use cases with test scenarios Modulo2/Sprints/Sprint2
User journey Modulo2/Sprints/Sprint2
Full business plan Modulo2/sprint2

Academic context

Item Detail
Institution Inteli — Instituto de Tecnologia e Liderança
Program Entrepreneurship
Format Solo project
Current module Module 2 — final delivery (Sprint 5)
Repository https://git.inteli.edu.br/lucas.galvao/agio
Author Lucas Galvão

Module 2 sprints

Sprint Status Main deliverable
Sprint 1 Completed Business plan foundation, revenue calculator, Gantt chart
Sprint 2 Completed Backend + frontend MVP, UML, wireframes, user journey, pricing
Sprint 3 Completed Full employee page, financial projections, market and competitive analysis
Sprint 4 Completed Percentage-based pricing model (9.99% fee / 35% office commission), refined thesis, pitch deck, banca presentation (June 12, 2026)
Sprint 5 In progress Final TCC document, retrospective

Known limitations (current implementation)

Intentional trade-offs of the demo scope, relevant for evaluators:

  1. No real payment integration — Pix disbursement is simulated; no BaaS provider (e.g., QI Tech) is connected.
  2. No server-side authorization — API endpoints are publicly callable with knowledge of entity IDs.
  3. Duplicated business logic — ceiling and balance calculations are repeated across three route files rather than centralized.
  4. Incomplete status lifecycle — advances are never transitioned to descontada upon report generation; cancellation has no endpoint.
  5. CSV upload does not deactivate removed employees — employees absent from a new payroll file retain status = 'ativo'.
  6. No automated tests — behavior is validated manually during development.
  7. Report CSV delimiter — output uses commas; Brazilian Excel (pt-BR locale) may display columns incorrectly without manual parsing.
  8. Single-tenant demo — seed creates one accounting office; login always returns the first record.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages