A Flask-based web application that monitors mortgage rates and automatically notifies users when favorable refinancing conditions are met.
This repository is a read-only mirror of the primary GitLab repository.
Primary Repository: https://gitlab.com/ekoziol/refi-alert
Please submit issues and merge requests to the GitLab repository.
- Mortgage Tracking: Users can add and manage multiple mortgages with detailed information
- Custom Alert Configuration: Set target monthly payments or interest rates for refinancing
- Automated Rate Monitoring: Background scheduler checks market rates periodically
- Email Notifications: Automatic alerts when refinancing conditions are met
- Payment Integration: Stripe subscription-based alert service
- Interactive Dashboard: Visualize mortgage data and refinancing opportunities
- Python 3.8+
- PostgreSQL database
- SMTP email account (Gmail, SendGrid, etc.)
- Stripe account (for payment processing)
- Clone the repository:
git clone <repository-url>
cd refi_alert- Create virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration- Initialize database:
flask db upgrade- Run the application:
python wsgi.pyThe application will be available at http://localhost:5000
See .env.example for all required environment variables. Key configurations:
MAIL_SERVER=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-passwordFor Gmail, create an app password: https://myaccount.google.com/apppasswords
STRIPE_API_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...- Flask Web Application: User interface and API
- PostgreSQL Database: Data persistence
- Flask-Mail: Email delivery
- APScheduler: Background job scheduler
- Stripe: Payment processing
- Plotly/Dash: Interactive mortgage calculators
refi_monitor/notifications.py- Email notification servicerefi_monitor/scheduler.py- Background alert evaluationrefi_monitor/mortgage.py- Mortgage and alert managementrefi_monitor/calc.py- Mortgage calculation utilities
- Sign up and create an account
- Add a mortgage with your current loan details
- Set an alert with target refinancing conditions
- Subscribe via Stripe to activate monitoring
- Receive notifications when conditions are met
Manually trigger alert checks:
curl -X POST http://localhost:5000/admin/trigger-alerts \
-H "Content-Type: application/json" \
--cookie "session=<session-cookie>"The application includes a comprehensive automated publishing and distribution system:
- Scheduled Monitoring: Checks alerts daily at 9 AM and every 4 hours
- Smart Evaluation: Accounts for refinance costs and prevents duplicate notifications
- Rich Email Templates: HTML emails with detailed refinancing information
- Payment Integration: Automatic payment confirmations
For detailed documentation, see DISTRIBUTION.md
refi_alert/
├── refi_monitor/ # Main application package
│ ├── __init__.py # App initialization
│ ├── models.py # Database models
│ ├── routes.py # Main routes
│ ├── auth.py # Authentication
│ ├── mortgage.py # Mortgage/alert routes
│ ├── notifications.py # Email service (NEW)
│ ├── scheduler.py # Background jobs (NEW)
│ ├── calc.py # Calculation utilities
│ ├── forms.py # WTForms
│ ├── plots.py # Plotly charts
│ └── dash/ # Dash apps
├── config.py # Configuration
├── wsgi.py # WSGI entry point
├── requirements.txt # Dependencies
└── migrations/ # Database migrations
# TODO: Add test suite
pytest# Create migration
flask db migrate -m "Description"
# Apply migration
flask db upgrade
# Rollback
flask db downgrade- Set
FLASK_ENV=production - Use strong
SECRET_KEY - Configure production database
- Set up production email service (SendGrid/SES)
- Configure Stripe production keys
- Integrate real mortgage rate API
- Set up SSL/TLS certificates
- Configure reverse proxy (nginx)
- Set up monitoring and logging
- Add proper admin role checking
- Heroku: Add
Procfileand use Heroku Postgres - AWS: EC2 + RDS or Elastic Beanstalk
- Google Cloud: App Engine or Cloud Run
- DigitalOcean: App Platform or Droplet
The system is ready to integrate with real mortgage rate APIs:
-
Freddie Mac Primary Mortgage Market Survey (Free)
- Weekly rate data
- http://www.freddiemac.com/pmms/
-
Mortgage News Daily (Paid)
- Real-time rates
- Location-specific data
-
Zillow Mortgage API (Paid)
- Zip code-specific rates
To integrate, update get_current_mortgage_rates() in refi_monitor/scheduler.py
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
[Add your license here]
For issues and questions:
- Check DISTRIBUTION.md for distribution system docs
- Review application logs
- Open an issue on GitHub