A Flask-based web application for performing economic analysis calculations, including worklife expectancy, annual earnings factors, and present value calculations.
- Evaluee Management (Create, Read, Update, Delete)
- Demographics Calculator (anchored at Date of Injury)
- Worklife Factor Calculator
- Annual Earnings Factor (AEF) Calculator
- Earnings Calculator with multi-scenario support
- Support for discounting calculations
- Excel report generation
- Modern, responsive UI with Bootstrap 5
- Clone the repository:
git clone https://github.com/yourusername/economic-analysis.git
cd economic-analysis
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
- Initialize the database:
flask db upgrade
The application supports different environments through configuration classes:
- Development: SQLite database, debug mode enabled
- Production: PostgreSQL database, debug mode disabled
- Testing: In-memory SQLite database
Set the FLASK_CONFIG
environment variable to choose the configuration:
export FLASK_CONFIG=development # or production, testing
- Development server:
flask run
- Production server (using gunicorn):
gunicorn "forensic_econ_app:create_app()"
economic-analysis/
├── forensic_econ_app/
│ ├── __init__.py
│ ├── models/
│ │ └── models.py
│ ├── routes/
│ │ ├── evaluee.py
│ │ ├── demographics.py
│ │ ├── worklife.py
│ │ ├── aef.py
│ │ └── earnings.py
│ ├── templates/
│ │ ├── base.html
│ │ └── evaluee/
│ │ ├── index.html
│ │ ├── create.html
│ │ ├── edit.html
│ │ └── view.html
│ ├── static/
│ │ ├── css/
│ │ │ └── style.css
│ │ └── js/
│ │ └── main.js
│ ├── utils/
│ │ └── calculations.py
│ └── config/
│ └── config.py
├── migrations/
├── tests/
├── .env
├── .env.example
├── requirements.txt
└── README.md
When making changes to the database models:
- Generate migration:
flask db migrate -m "Description of changes"
- Apply migration:
flask db upgrade
python -m pytest
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Flask and its extensions
- Bootstrap for the UI framework
- All contributors and users of the application