A full-stack personal finance management application built to practice and demonstrate modern software engineering patterns, advanced backend techniques, and responsive frontend development.
This project serves as a learning playground to practice and implement:
- Clean Architecture principles in Go
- Advanced backend patterns (rate limiting, caching, workers, SSE)
- Modern React patterns with Next.js 14 App Router
- Real-time notifications with Server-Sent Events
- Responsive design and mobile-first development
- Testing strategies (unit, integration, e2e)
- Transaction Tracking: Income and expense management with categories
- Account Management: Multiple bank accounts with balance tracking
- Budget Planning: Category-based budgets with progress tracking
- Investment Portfolio: Track crypto and stock investments
- Analytics Dashboard: Visual insights with charts and summaries
- Server-Sent Events (SSE) for instant updates
- Per-user notification streams
- Notification history with read/unread status
- Browser notification support
- Automated transaction scheduling
- Background worker for recurring payments
- Support for daily, weekly, monthly frequencies
- Row-Level Security (RLS) β PostgreSQL enforces data isolation at the database level; application bugs cannot leak cross-user data
- Financial Audit Trail β automatic before/after change tracking on all financial tables via PostgreSQL triggers
- Refresh Token Rotation β dual-token authentication with theft detection; reusing a revoked refresh token revokes all user sessions
- User management with editable table
- Demo user cleanup automation
- Batch user updates with confirmation modal
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frameworks & Drivers β
β βββββββββββ ββββββββββββ ββββββββββββ βββββββββββββββββββ β
β β Gin β βPostgreSQLβ β Docker β β Zerolog Logger β β
β βββββββββββ ββββββββββββ ββββββββββββ βββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Interface Adapters β
β βββββββββββββββ βββββββββββββββ ββββββββββββββββββββββββββββ
β β Handlers β βRepositories β β Middleware ββ
β β(Controllers)β β (Database) β βAuth, RLS, RateLimit, ββ
β β β β β βCORS, ErrorHandler ββ
β βββββββββββββββ βββββββββββββββ ββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Application Business Rules β
β βββββββββββββββ βββββββββββββββ ββββββββββββββββββββββββββββ
β β Services β β Workers β β Notification SSE ββ
β β(Use Cases) β β(Background) β β (Real-time Push) ββ
β βββββββββββββββ βββββββββββββββ ββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Enterprise Business Rules β
β βββββββββββββββ βββββββββββββββ ββββββββββββββββββββββββββββ
β β Entities β βValue Objectsβ β Validation ββ
β βUser,Account β β Money β β Rules ββ
β βββββββββββββββ βββββββββββββββ ββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js 14 App Router β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Pages (RSC) β
β ββββββββββββ βββββββββββ βββββββββββ ββββββββββββββββββββ β
β βDashboard β βAccounts β βBudgets β β Admin Backoffice β β
β ββββββββββββ βββββββββββ βββββββββββ ββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Client Components β
β ββββββββββββββββ ββββββββββββββ βββββββββββββββββββββββββ β
β β shadcn/ui β β Recharts β β Animated Components β β
β β Components β β Charts β β (Framer Motion) β β
β ββββββββββββββββ ββββββββββββββ βββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β State & Data β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββββ β
β βReact Query β β Zustand β β SSE Notifications β β
β β(Server Data)β β(Client State)β β(Real-time Updates) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Internationalization β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β next-intl (ES/EN) ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Configurable rate limiting with multiple strategies:
// Features:
- IP-based rate limiting (default fallback)
- User-based rate limiting (authenticated users)
- Endpoint-specific configurations
- Burst traffic allowance
- IP whitelist support (CIDR notation)
- Automatic cleanup of old entries
- Rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining)Scheduled background tasks for maintenance and automation:
| Worker | Description | Interval |
|---|---|---|
| Demo Cleanup | Removes demo users after 24h | Configurable |
| Transaction Scheduler | Processes recurring transactions | Hourly |
High-performance caching layer:
// Capabilities:
- TTL-based expiration
- Automatic cleanup intervals
- Prefix-based deletion
- Full cache flush
- Thread-safe operationsReal-time notification system:
// Implementation:
- Per-user notification streams
- Automatic stream creation
- Message history persistence
- Read/unread status tracking
- Bulk operations (mark all read, delete all)Structured logging with Zerolog:
- Request/response logging middleware
- Error tracking with stack traces
- Performance metrics
- Configurable log levels
PostgreSQL RLS is enforced on all 22 user-owned tables with FORCE ROW LEVEL SECURITY. Each policy checks a transaction-scoped app.current_user_id setting established by RLSMiddleware at the start of every authenticated request. This means even if application code has a bug that omits a WHERE user_id = ? clause, the database still returns only the current user's rows. Background workers use a dedicated database role with BYPASSRLS privilege to operate across all users.
A PostgreSQL trigger function (fn_financial_audit) is attached to eight core financial tables: transactions, account, budgets, investments, savings_goals, loans, certificates, and credit_cards. On every INSERT, UPDATE, or DELETE it captures a full to_jsonb() snapshot of the before and after state into the financial_audit_log table. This provides a tamper-evident record of all financial changes without requiring any application-level code changes.
Optimized data fetching with Next.js 14:
- Server-side data loading
- Streaming with Suspense
- Minimal client-side JavaScript
SSE integration for instant notifications:
// Using @microsoft/fetch-event-source
- Automatic reconnection
- Bearer token authentication
- Event parsing and state updatesFull multi-language support:
- Spanish (ES) and English (EN)
- Server-side translations
- URL-based locale detection
Mobile-first responsive UI:
- Collapsible sidebar navigation
- Icon-only tabs on mobile
- Fullscreen search modal for mobile
- Horizontal scroll containment for tables
Built with shadcn/ui and Radix:
- Animated tabs with sliding indicators
- Data tables with sorting and filtering
- Toast notifications (Sonner)
- Form validation (react-hook-form + Zod)
Multiple chart libraries:
- Recharts: Line and bar charts
- Nivo: Pie charts, heatmaps, radar charts
- Animated counters: Smooth number transitions
| Technology | Purpose |
|---|---|
| Go 1.21+ | Primary language |
| Gin | HTTP framework |
| PostgreSQL | Primary database |
| SQLite | Testing database |
| JWT | Authentication |
| r3labs/sse | Server-Sent Events |
| go-cache | In-memory caching |
| Zerolog | Structured logging |
| golang-migrate | Database migrations |
| testify | Testing framework |
| go-sqlmock | Middleware unit testing |
| Technology | Purpose |
|---|---|
| Next.js 14 | React framework (App Router) |
| TypeScript | Type safety |
| Tailwind CSS | Styling |
| shadcn/ui | UI component library |
| React Query | Server state management |
| Zustand | Client state management |
| next-intl | Internationalization |
| NextAuth | Authentication |
| Framer Motion | Animations |
| Vitest | Testing framework |
| Technology | Purpose |
|---|---|
| Docker | Containerization |
| Docker Compose | Local development |
| GitHub Actions | CI/CD |
| Make | Build automation |
GestorDePresupuesto/
βββ BackEnd/ # Go backend
β βββ cmd/ # Application entrypoints
β β βββ api/
β β βββ bootstrap/ # Dependency injection
β βββ internal/
β β βββ config/ # Configuration
β β βββ domain/ # Entities (User, Account, etc.)
β β βββ services/ # Business logic
β β βββ platform/
β β β βββ cache/ # In-memory cache
β β β βββ dto/ # Data Transfer Objects
β β β βββ server/
β β β β βββ handler/ # HTTP handlers
β β β β βββ middleware/ # Auth, RateLimit, CORS
β β β β βββ routes/ # Route definitions
β β β βββ storage/ # Repository implementations
β β β βββ worker/ # Background workers
β β β βββ observability/ # Logging
β β βββ e2e/ # E2E tests
β βββ docs/ # Documentation
β βββ docker-compose.yaml
β
βββ FrontendNextjs/gestor/ # Next.js frontend
β βββ app/ # App Router pages
β β βββ (auth)/ # Auth pages (login, register)
β β βββ admin/ # Admin backoffice
β β βββ app/ # Main application
β β β βββ accounts/
β β β βββ budget/
β β β βββ transactions/
β β β βββ analysis/
β β βββ api/ # API routes
β βββ components/
β β βββ common/ # Shared components
β β βββ ui/ # shadcn/ui components
β β βββ transactions/ # Feature components
β βββ contexts/ # React contexts
β βββ hooks/ # Custom hooks
β β βββ queries/ # React Query hooks
β βββ lib/ # Utilities
β βββ messages/ # i18n translations
β βββ types/ # TypeScript types
β βββ tests/ # Unit tests
β
βββ e2e-test/ # E2E test suite
βββ Makefile # Build commands
βββ README.md
- Go 1.21+
- Node.js 18+
- PostgreSQL 16+ (or Docker)
- Make
# Navigate to backend
cd BackEnd
# Start PostgreSQL with Docker
docker-compose up -d
# Run migrations
make migrate
# Start the server (with hot reload)
make dev# Navigate to frontend
cd FrontendNextjs/gestor
# Install dependencies
npm install
# Start development server
npm run dev# Run both backend and frontend checks
make backend-check
make frontend-check
# Run all tests
make testerDiagram
USER ||--o{ ACCOUNT : owns
USER ||--o{ CATEGORY : creates
USER ||--o{ BUDGET : sets
USER ||--o{ TRANSACTION : makes
USER ||--o{ INVESTMENT : tracks
USER ||--o{ NOTIFICATION : receives
ACCOUNT ||--o{ TRANSACTION : contains
CATEGORY ||--o{ TRANSACTION : categorizes
CATEGORY ||--o{ BUDGET : limits
USER {
string id PK
string name
string last_name
string email UK
string password
string role
boolean confirmed
boolean is_demo
timestamp created_at
timestamp deleted_at
}
ACCOUNT {
string id PK
string name
string bank
decimal initial_balance
decimal current_balance
string user_id FK
}
TRANSACTION {
string id PK
string name
string description
decimal amount
enum type
string account_id FK
string category_id FK
string user_id FK
}
CATEGORY {
string id PK
string name
string icon
string color
string user_id FK
}
BUDGET {
string id PK
decimal amount
decimal current_amount
string category_id FK
string user_id FK
}
cd BackEnd
# Unit tests
make test
# E2E tests
make test-e2e
# Coverage report
make coveragecd FrontendNextjs/gestor
# Run tests
npm run test
# Type checking
npm run type-check
# Full code quality check
npm run code-qualityDetailed documentation available in:
BackEnd/ARCHITECTURE.md- Backend architecture deep diveBackEnd/CONTRIBUTING.md- Contribution guidelinesBackEnd/docs/- Additional documentation- Configuration guide
- Error handling patterns
- Testing strategies
This project demonstrates:
- Clean Architecture - Separation of concerns, dependency inversion
- SOLID Principles - Applied throughout the codebase
- Repository Pattern - Database abstraction for testability
- Middleware Pattern - Authentication, rate limiting, logging
- Worker Pattern - Background job processing
- SSE Pattern - Real-time event streaming
- React Query - Server state management
- React Server Components - Next.js 14 App Router patterns
- Form Validation - Zod schemas with react-hook-form
- Responsive Design - Mobile-first with Tailwind CSS
This project is for learning and demonstration purposes.
Made with β€οΈ for learning modern full-stack development