Created
July 3, 2026 01:01
-
-
Save hashimwarren/a06f372590e0f67474a18c40769752f4 to your computer and use it in GitHub Desktop.
Test Coding Agents With an Employee Directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Build an Employee Directory app using: | |
| * Next.js for the web application | |
| * Neon Postgres for the database (https://neon.new/) | |
| * Better-Auth for authentication | |
| * Drizzle ORM for schema and database access | |
| * Zod for data validation | |
| Core entities: | |
| 1. Employee | |
| 2. Team | |
| 3. City | |
| 4. User/Auth account | |
| Employees should have: | |
| * Photo URL | |
| * Name | |
| * Title | |
| * Job description | |
| * Bio | |
| * City | |
| * Team | |
| * Manager | |
| * Direct reports | |
| * Role: admin or employee | |
| Teams should have: | |
| * Name | |
| * Team leader | |
| * Employees on that team | |
| Cities should have: | |
| * Name | |
| * Employees located in that city | |
| Authentication and access control: | |
| * There must be a login page. | |
| * There must be at least two user roles: admin and employee. | |
| * Admins can create, read, update, and delete all employees, teams, and cities. | |
| * Employees can view the directory. | |
| * Employees can update only their own profile fields. | |
| * Employees cannot update another employee’s profile. | |
| * Employees cannot change their own role. | |
| * Employees cannot assign themselves a new manager, team, or city unless you explicitly decide those fields are safe; document the decision. | |
| * Unauthenticated users should be redirected to login when visiting protected pages. | |
| * Authorization must be enforced on the server, not merely by hiding UI controls. | |
| Required pages and routes: | |
| Home page: | |
| / | |
| The home page should show the employee directory with search and useful navigation. | |
| It should include: | |
| * Search by employee name, title, team, city, and bio text | |
| * A list/grid of employees | |
| * Links to individual employee pages | |
| * Links to team pages | |
| * Links to city pages | |
| Employee detail route: | |
| /employees/[id] | |
| The employee page should show: | |
| * Photo | |
| * Name | |
| * Title | |
| * Job description | |
| * Bio | |
| * City | |
| * Team | |
| * Who this person reports to | |
| * Who this person manages | |
| * Links to manager, direct reports, team, and city | |
| * Edit controls only when the logged-in user has permission | |
| Team route: | |
| /teams/[id] | |
| The team page should show: | |
| * Team name | |
| * Team leader | |
| * Employees on the team | |
| * Links to each employee | |
| * Admin-only edit controls | |
| City route: | |
| /cities/[id] | |
| The city page should show: | |
| * City name | |
| * Employees in that city | |
| * Links to each employee | |
| * Admin-only edit controls | |
| Admin area: | |
| /admin | |
| Admins should be able to: | |
| * Create employees | |
| * Update employees | |
| * Delete employees | |
| * Create teams | |
| * Update teams | |
| * Delete teams | |
| * Create cities | |
| * Update cities | |
| * Delete cities | |
| Employees should not be able to access the admin area. | |
| Database requirements: | |
| Design a normalized relational schema. | |
| The schema should support: | |
| * Employees belonging to one team | |
| * Employees belonging to one city | |
| * Employees having one manager | |
| * Employees having many direct reports | |
| * Teams having one team leader | |
| * Users/auth accounts mapping to employees | |
| * Role-based authorization | |
| Use Better Auth for authentication and session handling. | |
| Include migrations or schema setup instructions. | |
| Seed data: | |
| Include seed data with: | |
| * At least 100 employees | |
| * At least 3 cities: New York, Tokyo, and Mumbai | |
| * At least 1 admin user | |
| * At least 2 employee users | |
| * At least 10 employees who manages multiple people | |
| * At least 5 team leaders | |
| * Employees spread across multiple cities and teams | |
| Testing requirements: | |
| The app should be easy to verify by checking: | |
| * Login works | |
| * Logout works | |
| * Admin can access admin routes | |
| * Employee cannot access admin routes | |
| * Admin can edit any profile | |
| * Employee can edit only their own profile | |
| * Employee cannot edit another employee | |
| * Employee cannot change role | |
| * Unauthenticated user is redirected to login | |
| * Employee detail routes work | |
| * Team routes work | |
| * City routes work | |
| * Search returns relevant employees | |
| * Manager/direct-report relationships display correctly | |
| * Team leader relationship displays correctly | |
| * City drill-down works correctly | |
| Deliverables: | |
| 1. Working Next.js app | |
| 2. Database schema | |
| 3. Seed script | |
| 4. Better Auth setup | |
| 5. Role-based access control | |
| 6. CRUD functionality | |
| 7. Search | |
| 8. Route pages for home, employee, team, city, and admin | |
| Do not stop at a scaffold. Build the app to a state where a developer can run it, seed it, log in as admin or employee, and verify the main workflows. | |
| At the end, include: | |
| * What was implemented | |
| * What assumptions were made | |
| * Any limitations | |
| * How to run the app | |
| * Demo credentials for seeded users | |
| * A checklist of verification steps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment