DEV Community

Cover image for Dynamic Profile API
Samuel Osho
Samuel Osho

Posted on

Dynamic Profile API

HNG i13 Backend โ€” Stage 0 Task: Dynamic Profile API

Hey everyone ๐Ÿ‘‹

I just completed Stage 0 of the HNG i13 Backend Track, where we were tasked with building a dynamic REST API that returns our profile information along with a random cat fact fetched from the Cat Facts API.

Even as a Laravel developer, I love using these small tasks to experiment with different hosting setups and third-party integrations, and Iโ€™m sharing this so others can learn and grow alongside me.

๐Ÿ’ก What I Built

I created a simple Laravel API endpoint:

/api/me

The endpoint returns:

  • My email, name, and backend stack
  • A timestamp in ISO 8601 UTC format
  • A dynamic cat fact (fetched fresh on every request)

Example response:

{
  "status": "success",
  "user": {
    "email": "version.control.dev@gmail.com",
    "name": "Samuel Osho",
    "stack": "Laravel/PHP"
  },
  "timestamp": "2025-10-18T12:45:32.567Z",
  "fact": "Cats sleep 70% of their lives."
}


Enter fullscreen mode Exit fullscreen mode

โš™๏ธ Tools & Technologies

  • Laravel 11 โ€“ my go-to PHP framework
  • PHP HTTP Client โ€“ for consuming the Cat Facts API
  • Carbon โ€“ for UTC timestamp formatting
  • Render.com โ€“ experimenting with Docker-based deployment

๐Ÿง  What I Learned / Tips for Others

Even as someone familiar with Laravel, this small project reinforced some key practices:

  • How to integrate external APIs cleanly within a Laravel route
  • Handling API failures gracefully using try/catch and fallback messages
  • Returning well-structured JSON responses following strict schema requirements
  • Deploying Laravel projects quickly using Renderโ€™s Docker hosting

If youโ€™re new to backend APIs, these are simple steps that can help you practice API consumption, JSON formatting, and dynamic data handling.

๐Ÿ”— Links

๐Ÿงญ Next Steps

Iโ€™m excited for the upcoming stages!
Even small tasks like this remind us that good practices in API design, error handling, and dynamic responses are what separate simple code from robust, production-ready systems.

Sharing this to help others experiment, learn, and grow โ€” because the best way to improve is to build, break, and iterate together.

#HNGi13 #BackendDevelopment #Laravel #PHP #WebDevelopment #LearningByDoing #API #HNGInternship #RESTAPI #DevTips

Top comments (0)