BHR // Emumba

Internal HR tool — authorised access only

1 USD = 279.30 PKR  |  1 USD = 3.6725 AED  |  1 EUR = 1.17 USD  |  1 CAD = 0.72 USD
Assignments all departments & headcount
Who people on a project
Comp full compensation breakdown
Top N highest earners company-wide
P&L revenue · cost · margin
/person
Sync data sync status
BambooHR
Billing Sheet
Architecture system overview
flowchart TB Browser["BROWSER — Single Page App Vanilla JS · No framework · JetBrains Mono + Syne Views: Assignments · Who · Comp · People Dir · Top N · Location · P&L · Sync · Arch"] subgraph FLASK ["FLASK SERVER (Python 3)"] AUTH["Auth Layer Google OAuth 2.0 + OIDC Dev password (local only)"] API["REST API /projects /who /comp /search /top /location /employees /sync-status /sync-now /profitability /profitability/project /person/{id}/profitability /sync-billing /sync-billing-status"] MEM["In-Memory Cache · 5 min TTL keys: employees · bonus_all · table_info · billing · contracts"] SYNCT["BambooHR Sync Thread _sync_loop() · every 1 hour 50 parallel BambooHR requests"] SYNCB["Billing Sync Thread _billing_sync_loop() · every 24 hours reads Google Sheet → writes to DynamoDB"] end subgraph AWS ["AWS"] SM["Secrets Manager bhr/bamboohr_api_key · bhr/flask_secret_key bhr/google_client_id · bhr/google_client_secret · bhr/allowed_emails bhr/google_sheet_id · bhr/google_service_account_json env var fallback for local dev"] DDB["DynamoDB bhr_employees — active roster (one item per employee) bhr_meta — bonus_all · table_info · billing_sync_status bhr_billing — monthly billing records per employee bhr_contracts — contract data per employee TTL: 2 hours (employee/bonus) · 24 hours (billing)"] end subgraph EXT ["External Services"] BAMBOO["BambooHR API api.bamboohr.com / emumba / v1 POST /reports/custom · GET /meta/tables GET /employees/{id}/tables/{alias}"] GOOGLE["Google OAuth 2.0 accounts.google.com scope: openid email profile"] SHEETS["Google Sheets API sheets.googleapis.com billing sheet — status · project · billing amount per employee per month auth: service account (bhr/google_service_account_json)"] end Browser -->|"HTTPS · session cookie"| AUTH AUTH -->|"OAuth 2.0 redirect"| GOOGLE AUTH --> API API --> MEM MEM -->|"cache miss"| DDB SYNCT -->|"50 parallel req · hourly"| BAMBOO SYNCT -->|"batch write · 2h TTL"| DDB SYNCB -->|"read billing data · every 24h"| SHEETS SYNCB -->|"batch write · 24h TTL"| DDB SM -.->|"app startup · 7 secrets"| FLASK
Location headcount by city