A comprehensive mortgage calculator system built with Laravel 12, Inertia.js, Vue 3, and Filament Admin, designed for Philippine housing finance.
- Multi-Institution Support: HDMF (Pag-IBIG), RCBC, CBC
- Real-time Calculations: Instant computation of monthly amortization
- Qualification Assessment: Automatic qualification checking
- Comparison Tool: Side-by-side comparison of all lenders
- Amortization Schedule: Full payment breakdown with export options
- Save & Retrieve: Save calculations with unique reference codes
- Email Notifications: Send computation results via email
- Loan Profile Management: View, search, filter all saved profiles
- Analytics Dashboard: Real-time statistics and trend charts
- Export Features: PDF and CSV export capabilities
- Settings Management: Database-driven configuration for lending institutions
- Email Management: Resend computation emails to borrowers
- Database-driven settings with caching
- Role-based access control
- Performance-optimized with database indexes
- Responsive design (mobile-friendly)
- API-first architecture
- Comprehensive test coverage
- PHP 8.4+
- Composer
- Node.js & NPM
- MySQL/PostgreSQL
- Redis (recommended for caching)
git clone <repository-url> pabahay
cd pabahay
# Install PHP dependencies
composer install
# Install JavaScript dependencies
npm installcp .env.example .env
php artisan key:generateConfigure your .env file:
# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pabahay
DB_USERNAME=root
DB_PASSWORD=
# Mail (Resend recommended)
MAIL_MAILER=resend
RESEND_KEY=your-resend-api-key
# Cache (Redis recommended)
CACHE_STORE=redis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
# Settings Cache
SETTINGS_CACHE_ENABLED=true
SETTINGS_CACHE_TTL=3600# Run migrations
php artisan migrate
# Seed lending institution settings
# (Settings are automatically seeded via migration)# Development
npm run dev
# Production
npm run buildphp artisan make:filament-userAccess the public mortgage calculator at:
http://your-domain.com/calculator
Features:
- Select lending institution (HDMF, RCBC, CBC)
- Enter property and borrower details
- View instant computation results
- Save computation with optional email
- Compare all institutions side-by-side
- View amortization schedule
Access the admin panel at:
http://your-domain.com/admin
Default Capabilities:
- View all loan profiles
- Search and filter profiles
- Export profiles as PDF or CSV
- View analytics and statistics
- Configure lending institutions (admin only)
Admin User Flags:
Add these fields to your users table for permissions:
$table->boolean('is_admin')->default(false);
$table->boolean('is_super_admin')->default(false);POST /api/v1/mortgage-compute
POST /api/v1/mortgage/computeRequest Body:
{
"lending_institution": "hdmf|rcbc|cbc",
"total_contract_price": 1000000,
"age": 35,
"monthly_gross_income": 50000,
"co_borrower_age": null,
"co_borrower_income": null,
"additional_income": null,
"balance_payment_interest": null,
"percent_down_payment": null,
"percent_miscellaneous_fee": null,
"processing_fee": null,
"add_mri": false,
"add_fi": false
}POST /api/v1/mortgage/loan-profiles # Save computation
GET /api/v1/mortgage/loan-profiles/{code} # Retrieve by reference codeGET /api/v1/mortgage/lending-institutions # List all
GET /api/v1/mortgage/lending-institutions/{key} # Get onePOST /api/v1/mortgage/amortization-schedulePOST /api/v1/mortgage/compareSettings are managed through the admin interface:
- Navigate to Mortgage → HDMF/RCBC/CBC Settings
- Update interest rates, fees, terms as needed
- Changes take effect immediately (cached for 1 hour)
Manually clear settings cache:
php artisan cache:clearThe system uses Resend for email delivery:
- Sign up at resend.com
- Get your API key
- Add to
.env:
MAIL_MAILER=resend
RESEND_KEY=re_xxxxxxxxxxxxx# Run all tests
php artisan test
# Run specific test suite
php artisan test tests/Feature/LoanProfileManagementTest.php
# Run with coverage
php artisan test --coverageThe following indexes are automatically created:
reference_code- Fast lookup by reference codelending_institution- Filter by institutionqualified- Filter by qualification statuscreated_at- Sort by dateborrower_email- Search by email- Composite index on
lending_institution + qualified
Settings are cached for 1 hour by default. Configure in .env:
SETTINGS_CACHE_ENABLED=true
SETTINGS_CACHE_TTL=3600 # secondsFor production, run queue workers for email sending:
php artisan queue:work --queue=default- Public Calculator: No authentication required
- Admin Panel: Authentication required
- Settings Management:
is_admin = truerequired - Delete Operations:
is_admin = truerequired
API endpoints are rate-limited to prevent abuse.
Solution: Run migrations to seed settings:
php artisan migrate:freshSolution: Ensure dompdf fonts are writable:
chmod -R 755 storage/fontsSolution: Clear cache:
php artisan cache:clearSolution: Check Resend configuration and queue workers:
php artisan queue:work- Backend: Laravel 12, PHP 8.4
- Frontend: Inertia.js v2, Vue 3, Tailwind CSS v4
- Admin: Filament v3
- Database: MySQL/PostgreSQL
- Cache: Redis
- Email: Resend
- PDF: DomPDF
- Testing: Pest v4
Proprietary - All rights reserved
For support, email: support@example.com
Developed by [Your Team Name]