Interactive random user profile generator with instant results
Generate random user profiles asynchronously without page reload.
| Path | Method | Description |
|---|---|---|
/ |
GET |
Main page with an initial random profile display |
/profile |
GET |
Endpoint to fetch a new random profile (HTML snippet for HTMX) |
Profiles are generated using Faker with consistent gender names.
Avatars are chosen randomly from RandomUser.me:
- Avatar URLs follow the format:
https://randomuser.me/api/portraits/{avatar_gender}/{avatar_id}.jpg
where{avatar_gender}is"men"or"women"and{avatar_id}is0-99. - Emails are currently random, even though names respect gender.
- The backend function
generate_profile()handles all profile generation. - You can adjust or replace the avatar source by modifying the URL generation logic.
- Generate a random user profile instantly
- Works asynchronously without full page reload (HTMX + FastAPI)
- Responsive design for desktop and mobile
- Profiles include name, email, phone, address, job, and avatar
- Python 3.12 – core programming language
- FastAPI – high-performance backend framework
- Jinja2 – HTML templating
- HTMX – asynchronous frontend requests
- Tailwind CSS – responsive and modern UI
- Render.com – zero-config deployment