How youssefontys/secure-application works
This repository is a secure notes web application, with account registration and password login, optional TOTP two-factor authentication, account management, and private encrypted notes. A browser request enters the Flask app, which applies CSRF checks and dispatches to authentication, account, or notes handlers; those handlers use shared security services and PostgreSQL. The app also emits security events. Separate user-facing scripts support local or Azure deployment and teardown. Relationships among sampled app modules are supported by excerpts and the SOURCE INDEX; deployment capabilities are partly documented in the README, so unsampled internals are not expanded.
Main entry points: auth.py Authentication · account.py Account management · app.py Flask app · db.py Database access
Components 22
Web application
- Flask app
app/app.py - Web pages
app/web/templates - Authentication
app/auth.py - Account management
app/account.py - Notes
app/notes.py
Security services
- CSRF protection
app/csrf.py - Password rules
app/passwords.py - Login throttling
app/throttle.py - TOTP
app/totp.py - Data encryption
app/encryption.py
Persistence and events
- Database access
app/db.py - PostgreSQL
db/schema.sql - Security events
app/events.py
Deployment operations
- Deployment CLI
scripts/deployment.py - Local deployment
scripts/deploy_local.py - Azure deployment
scripts/deploy_azure.py - Azure bootstrap
scripts/setup_azure.py - Teardown
scripts/undo.py - Compose stack
compose.yaml - Azure resources
terraform
Other components
- Visitor
- Authenticator app
Connections 31
- Visitor → Flask app: uses
README.md - Flask app → CSRF protection: checks requests
app/app.py - Flask app → Authentication: registers routes
app/app.py - Flask app → Account management: registers routes
app/app.py - Flask app → Notes: registers routes
app/app.py - Flask app → Web pages: renders
README.md - Authentication → Database access: queries
app/auth.py - Authentication → Password rules: checks passwords
app/auth.py - Authentication → Login throttling: limits attempts
app/auth.py - Authentication → TOTP: checks codes
app/auth.py - Authentication → Data encryption: uses
app/auth.py - Authentication → Security events: records events
app/auth.py - Account management → Database access: queries
app/account.py - Account management → Data encryption: encrypts secrets
app/account.py - Account management → Password rules: checks passwords
app/account.py - Account management → Login throttling: limits attempts
app/account.py - Account management → TOTP: uses codes
app/account.py - Account management → Security events: records events
app/account.py - Notes → Database access: queries
app/notes.py - Notes → Data encryption: seals notes
app/notes.py - Notes → Security events: records events
app/notes.py - Login throttling → Database access: stores limits
app/throttle.py - Database access → PostgreSQL: queries
app/db.py - Authenticator app → Authentication: provides codes
README.md - Deployment CLI → Local deployment: starts
scripts/deployment.py - Deployment CLI → Azure deployment: starts
scripts/deployment.py - Deployment CLI → Teardown: starts
scripts/deployment.py - Local deployment → Compose stack: starts stack
README.md - Azure deployment → Azure bootstrap: runs if needed
scripts/deploy_azure.py - Azure deployment → Azure resources: applies resources
scripts/deploy_azure.py - Teardown → Azure resources: destroys resources
scripts/undo.py