STILL IN DEVELOPMENT!
LoanFlow is a full stack mini fintech MVP for loan simulation, hybrid approval, installment tracking, fake payments, and admin review. It started as a small Fastify API and evolved into a portfolio-ready project with a Vue.js frontend.
- Fastify + TypeScript
- PostgreSQL with postgres.js
- JWT authentication
- bcrypt password hashing
- Vue 3 + Vite + Vue Router
- Pinia
- Axios
- User registration with income, CPF, credit score, and role.
- Login with JWT and role-aware navigation.
- Loan simulation with fixed 5% demo interest.
- Hybrid approval rule:
- amount up to R$ 5,000;
- credit score of at least 650;
- installment value up to 30% of monthly income.
- Automatic approval or manual review queue.
- User dashboard, loan list, loan details, and installment table.
- Fake installment payment flow for demos.
- Admin dashboard with pending, approved, rejected, and high-risk metrics.
- Admin approve/reject flow with rejection reason.
.
├── src/ # Fastify API
├── web/ # Vue 3 frontend
├── docs/screenshots/ # Real UI previews
└── docs/superpowers/ # Product spec and implementation plan
Create an environment file:
cp .env.example .envInstall dependencies and prepare the database:
npm install
npm run db:create
npm run devThe API runs on http://localhost:3333 by default.
For hosted PostgreSQL providers that require SSL, set:
DATABASE_SSL=truecd web
npm install
npm run devThe frontend uses http://localhost:3333 as the default API URL. To override it:
VITE_API_URL=http://localhost:3333Windows note: if npm install reports EBADF or EPERM inside a cloud-synced folder, clone the repository into a normal local folder such as C:\Dev\LoanFlow and run the install there.
Backend:
npm run dev
npm run build
npm test
npm run db:createFrontend:
cd web
npm run dev
npm run build
npm run preview| Method | Route | Description |
|---|---|---|
GET |
/ |
Health check |
POST |
/users |
Register user/admin |
POST |
/auth/login |
Login and receive JWT |
GET |
/me |
Authenticated profile |
POST |
/loans/simulate |
Simulate loan terms and decision |
POST |
/loans |
Request a loan |
GET |
/loans/my |
List authenticated user loans |
GET |
/loans/:id |
Loan details and installments |
POST |
/installments/:id/pay |
Fake installment payment |
GET |
/admin/loans |
Admin loan queue |
GET |
/admin/loans/:id |
Admin loan details |
PATCH |
/admin/loans/:id/approve |
Approve pending loan |
PATCH |
/admin/loans/:id/reject |
Reject pending loan |
| Route | Description |
|---|---|
/login |
Login |
/register |
User/admin registration |
/app |
User dashboard |
/app/simulate |
Loan simulation |
/app/loans |
User loan list |
/app/loans/:id |
User loan details |
/admin |
Admin dashboard |
/admin/loans |
Admin review queue |
/admin/loans/:id |
Admin review screen |
- Start PostgreSQL and configure
.env. - Run
npm run db:createto reset the development schema. - Create a user from the frontend register screen.
- Simulate a loan below the automatic approval threshold.
- Create another loan that exceeds the policy limits.
- Create or use an admin account and review the pending proposal.
- Open the approved loan details and trigger fake installment payments.
MVP in development, built as a portfolio project to demonstrate backend architecture, authentication, business rules, and a Vue-based product interface.
