StatementSmart is a web application that parses Lloyds Bank statement PDFs, converts them to structured Excel sheets and automatically categorises transactions using machine learning
# Get OPENAI_API_KEY from https://platform.openai.com/playground/prompts and add to .env file.
OPENAI_API_KEY='Your API key'
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python app.pydocker build -t statement-smart .
docker run --env-file .env -p 3000:3000 statement-smart .
├── .github
│ └── workflows
│ ├── deploy-app.yml
│ ├── terraform-destroy.yml
│ └── terraform-plan-and-apply.yml
├── .gitignore
├── README.md
├── app
│ ├── Dockerfile
│ ├── app.py
│ ├── name.py
│ ├── requirements.txt
│ ├── static
│ │ └── style.css
│ ├── templates
│ │ └── index.html
└── terraform
├── .terraform
│ ├── modules
│ ├── providers
│ └── terraform.tfstate
├── main.tf
├── modules
│ ├── container_app
│ ├── container_app_environment
│ ├── container_registry
│ ├── dns_zone
│ ├── front_door
│ ├── log_analytics
│ └── storage_account
├── terraform.tf
└── variables.tf- Builds a Docker image from the Flask app, scans it with Trivy for vulnerabilities, pushes it to Azure Container Registry (ACR), and deploys it to Azure Container Apps.
- Runs a Checkov security scan, formats and validates Terraform code, and posts the Terraform plan to the pull request as a comment. On manual trigger, it applies the approvedTerraform plan to provision Azure infrastructure.
- Manually triggered workflow that initializes the Terraform backend and destroys all previously provisioned infrastructure in Azure.
The terraform/ directory provisions all necessary Azure infrastructure to support deployment and delivery of the application to end users.
Provisioned Resources:
- Azure Container Apps: Hosts the application in a fully managed, serverless container environment with built-in scaling and HTTPS support.
- Azure Container Registry (ACR): Stores and manages private Docker container images used for deployments.
- Azure DNS: Manages custom domain names and DNS records for routing traffic to application endpoints.
- Azure Front Door: Acts as a global entry point, providing load balancing, SSL termination, and fast content delivery through Microsoft's edge network.