age-estimation-sveltekit Svelte Themes

Age Estimation Sveltekit

Application developed as part of a technical challenge that estimates a person's age based on the entered name.

๐Ÿ”ฎ Svelte Age Predictor

Front-end application built with SvelteKit that uses the public API agify.io to estimate a personโ€™s average age based on the entered name.

This project was originally created as part of a technical challenge for a hiring process. Although I didnโ€™t advance in the process, I decided to keep it in my portfolio as it was a great opportunity to learn SvelteKit and API consumption.

๐Ÿง  About the Project

The app queries the agify.io API to return the average estimated age and record count for a given name. It features a reactive input field with a debounce mechanism and URL synchronization, offering a smooth and simple user experience.

๐ŸŒ Features

  • Query to the agify.io API
  • Reactive input field with 1-second debounce
  • URL synchronization with the search (?name=...)
  • Displays the estimated average age and record count
  • Responsive layout with pure CSS (no frameworks)
  • Styling focused on simplicity and performance

๐Ÿ› ๏ธ Technologies Used

๐Ÿ“ฑ Responsiveness

The layout adapts to different screen sizes, ensuring usability on desktop, tablet, and mobile.

๐Ÿ“… Development Stages

01 โ€“ Project Setup

  • Created the project with SvelteKit
  • Initial structure and automatic routing for the main page

02 โ€“ Data Entry and URL Sync

  • Input field created with bind:value
  • URL synchronization using goto() whenever the name changes
  • If the page loads with ?name=, the input is automatically populated

03 โ€“ API Integration

  • Implemented load() to fetch data from agify.io
  • API response (name, age, count) displayed in the interface
  • Handles initial state and clears the URL if the field is emptied

04 โ€“ Styling with Pure CSS

  • Dark palette with green highlights
  • Centered layout
  • Montserrat font (Google Fonts)

๐Ÿ‘จโ€๐Ÿ’ป Developer

Developed by Caio Castelhano โ€“ front-end developer based in Brazil.
For freelance inquiries, collaborations, or feedback, feel free to get in touch.

Top categories

Loading Svelte Themes