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."
}
โ๏ธ 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
- Live Endpoint: https://hng-13-stage0.onrender.com/api/me
- GitHub Repo: https://github.com/samthatcode/php-laravel-docker
๐งญ 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)