Corporate Human Resources Portal with Zoneless Angular 22 & Flask
Corporate HR portal for SMEs in Flask 3.1, MySQL 8, Redis, and zoneless Angular 22: self-hosted CSP redesign, revocable token_version JWT, document expiry alerts, 122.35 kB gzip, and Vitest + Pytest suites.

Problem
Small and medium-sized businesses often track employee rosters across scattered spreadsheets, local folders full of expired contracts, and unaudited permissions.
While the initial functional MVP handled basic CRUD workflows, a full UX and engineering audit uncovered key gaps for daily production operations:
- Fragmented visual identity: a neon-styled login screen clashed with a default dark Bootstrap admin panel packed with OS emojis and competing multicolor action buttons.
- HR workflow friction: a cluttered 9-link top bar, duplicated department consultation/management views, search inputs ignoring
Enterand failing to sync filters to the URL, and misleading “no results” flashes while loading. - Accessibility & client technical debt:
FormsModuleforms bypassing pre-submit validation, duplicate error toasts fired by both interceptors and views, modals lackingEscape/ focus trapping, and internal CLI hints exposed on the login screen.
Architecture and decisions
Decoupled full-stack platform running Python 3.12, Flask 3.1, SQLAlchemy 2.0, Marshmallow, Alembic, MySQL 8, and Redis behind Nginx + Gunicorn in Docker Compose, paired with a zoneless Angular 22 (Standalone, Signals), strict TypeScript 6, and RxJS 7 SPA.
“Institutional Clarity” Design System under strict CSP
- Restrained admin ergonomics: light theme by default with optional dark mode (white surfaces over
#F8FAFC, crisp#E2E8F0borders, and a single#1E40AFinstitutional accent), soft semantic status pills, Inter Variable withtabular-nums, andes-ARsalary formatting. - Zero-CDN self-hosting (
font-src 'self'): both typography and vector icons (Bootstrap Icons) are bundled locally via NPM—removing external CDNs and OS emojis to satisfy strict Nginx CSP headers. - Domain navigation & unified workflows: collapsible domain sidebar (Operations, Organization, Security) hidden on
/login, live KPI dashboard (Overview), consolidated department deep-links (/empleados?departamento_id=X) preserving filters and pagination inqueryParams, a streamlined 6-column table with debounced search, filter chips, and skeletons, plus automatic document-expiry badges (Expired, Expiring ≤30 days, Valid).
Zoneless Angular 22 rigor & full-stack AppSec
- Typed Reactive Forms & full keyboard accessibility: complete migration to
ReactiveFormsModulewith inline validation, automaticsueldo_basesuggestions by job role, and a live password-policy checklist. Parametrized confirmation modal witharia-modal,Escape, backdrop close, andfocus trapreturning focus to the trigger element, paired with hover-pausablearia-livetoasts. - Zero-duplicate error orchestration (
WeakSet): clean boundary betweenerrorInterceptor(network, auth, permissions,5xx) and form handlers (400/422), tracking already-notified errors in aWeakSetto eliminate duplicate alerts. - Production security controls: versioned JWT authentication (
token_version) for instant revocation on account deactivation or password reset, multi-tenant isolation (tenant_id), Redis rate limiting, uploaded file verification via magic bytes, CSV formula injection protection, and OWASP security headers in Nginx.
// Memory-safe global HTTP error deduplication in Angular
const handledErrors = new WeakSet<object>();
if (!handledErrors.has(err)) {
handledErrors.add(err);
toast.error(mapHttpError(err));
}
Challenges
- Eliminating state friction under zoneless strict mode: synchronizing department drill-downs, debounced search, and pagination inside
queryParamswithout empty-state flicker while migrating all forms to typedReactiveFormsModuleunderstrict: trueandstrictTemplates: true. - End-to-end document security & CSP compliance: inspecting uploaded files by raw magic bytes, neutralizing spreadsheet formula payloads during CSV/Excel workflows, and serving 100% self-hosted fonts/icons under strict OWASP/CSP headers with zero
localhostreferences in production builds.
Outcomes
- Optimized production bundle: 122.35 kB transferred (gzip) initial load with route-level lazy chunks (
1 kB–23 kB), 0 build warnings, and cleanstrict: true+strictTemplates: truecompilation on TypeScript 6 / Angular 22. - Automated quality coverage: 23 Vitest frontend unit tests (role guards, reactive forms, double-submit prevention, deactivation confirmation, error handling) paired with the backend Pytest suite.
- Deployment-ready infrastructure: persistent Docker storage volumes, Alembic schema migrations, zero
localhostleaks, and active OWASP/CSP headers on Nginx.
A full walkthrough of the live KPI Overview, Employee Roster, Document Expiry Alerts, and light/dark themes is available via the Video demo link in the header and sidebar. Proprietary codebase reserved for B2B/SaaS licensing.