Building My First Backend API: A Dynamic Profile Endpoint HNG 13

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyrinNew
    Senior Member
    • Feb 2024
    • 5175

    #1

    Building My First Backend API: A Dynamic Profile Endpoint HNG 13

    I just completed the Backend Wizards Stage 0 task by building a RESTful API that serves profile data with dynamic cat facts! 🚀


    What I Built


    · GET /api/me endpoint returning JSON profile data

    · Real-time cat facts from CatFact.Ninja API

    · Rate limiting (10 requests/30 seconds)

    · Dynamic UTC timestamps

    · Error handling with fallback facts


    Tech Stack


    · C# / ASP.NET Core Web API

    · Microsoft Rate Limiting

    · HttpClient for external API calls

    · Railway for deployment


    Key Learnings


    · ASP.NET Core controller design and routing

    · External API integration with proper error handling

    · Implementing rate limiting policies

    · C# async/await patterns for HTTP requests

    · Structured JSON responses with anonymous types


    Example Response:






    {
    "status": "success",
    "user": {
    "email": "ikechukwugodwin22@gmail.com",
    "name": "Ikechukwu F. Godwin",
    "stack": "C#/ASP.NET Web API"
    },
    "timeStamp": "2025-10-15T14:30:45.123Z",
    "fact": "Cats have whiskers on their front legs too!"
    }







    This project solidified my backend fundamentals with ASP.NET Core - from API design to production deployment! 💻




    More...
Working...