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 (1)
Nice to read! I liked it!