TDD Employee Profile Generator
Generate a professional HTML team roster page from employee profiles. Add managers, engineers, and interns with validated data and download a standalone HTML file.
About
Team rosters maintained in spreadsheets or Slack channels decay fast. People leave, roles change, and contact details go stale without anyone noticing. This tool generates a self-contained HTML page from structured employee data - each record validated against format rules for email, unique id, and role-specific fields (officeNumber for managers, GitHub handle for engineers, school for interns). The output file requires zero dependencies: open it in any browser, print it, or host it on an internal server.
The generator enforces data integrity before compilation. An invalid email pattern or a duplicate employee ID triggers rejection at input time, not after you have distributed the page. The generated markup uses inline styles for full portability. Note: GitHub profile URLs are constructed from the username string but not validated against the GitHub API - verify handles independently for accuracy.
Formulas
The generator applies a template compilation pattern. Each employee record E is validated then mapped to an HTML card fragment:
Email validation uses the pattern:
Employee ID uniqueness is enforced by set membership:
HTML entity sanitization replaces dangerous characters to prevent XSS in the generated file:
Where E = employee object, role โ {Manager, Engineer, Intern}, fields = all string properties of the record.
Reference Data
| Role | Required Fields | Special Field | Card Icon | Validation Rule |
|---|---|---|---|---|
| Manager | Name, ID, Email | Office Number | โ | Office number must be non-empty string |
| Engineer | Name, ID, Email | GitHub Username | ๐ง | GitHub username: alphanumeric + hyphens |
| Intern | Name, ID, Email | School | ๐ | School name must be non-empty string |
| All Roles | Name | - | - | Non-empty, max 50 characters |
| All Roles | ID | - | - | Positive integer, unique across team |
| All Roles | - | - | RFC 5322 simplified pattern | |
| Output | Standalone HTML file with inline CSS, no external dependencies | |||
| File Size | Approximately 3 - 15 KB depending on team size | |||
| Browser Support | Any modern browser (Chrome, Firefox, Safari, Edge) | |||
| Generated HTML includes @media print rules for A4 output | ||||
| Max Team Size | No hard limit; tested up to 100 employees | |||
| Data Persistence | Team data saved to localStorage, survives page reload | |||