Skip to content

AlanRacic/WeatherGatewayAPI

Repository files navigation

WeatherGatewayAPI — ASP.NET Core Web API with External Service Integration (.NET 10)

Live Cloud Demo

Azure Cloud App Service (Swagger / OpenAPI):

https://weathergatewayapi-a8hqgeavazg6a5c3.italynorth-01.azurewebsites.net/swagger


Overview

WeatherGatewayAPI is an ASP.NET Core Web API that acts as a gateway to an external weather service, demonstrating secure API design, external service integration, and production-oriented backend patterns.

The project implements JWT-based authentication, structured logging, DTO-based data transformation, and global exception handling. It showcases how a backend service receives client requests, communicates with an external API, and returns structured, reliable responses.

The architecture emphasizes clean separation of concerns, predictable error handling, maintainable service orchestration, and cloud-oriented deployment practices aligned with modern .NET backend development.

The application is deployed to Microsoft Azure Cloud App Service and integrated with a GitHub Actions CI/CD workflow for automated build and deployment.


Tech Stack

Core
C# · .NET 10 · ASP.NET Core Web API

Integration & Data Handling
HttpClient · JSON · DTO Mapping

Security & Infrastructure
JWT Authentication · Authorization

Architecture & Practices
Dependency Injection · Middleware · Logging · Options Pattern · Async/Await

Cloud & Deployment
Azure Cloud App Service · GitHub Actions · CI/CD · Swagger / OpenAPI


Key Features

  • JWT-based authentication with token generation and secured endpoints
  • Protected API endpoints using [Authorize] and JWT validation
  • External API integration via HttpClient with configurable base URL and timeout
  • DTO-based transformation of external service responses into internal models
  • Structured logging using ILogger for request tracking and diagnostics
  • Global exception handling via custom middleware with consistent JSON responses
  • Input validation with clear error messaging for predictable API behavior
  • Separation of concerns between controllers, services, and data contracts
  • Live cloud deployment to Azure Cloud App Service with public Swagger endpoint
  • Automated CI/CD workflow using GitHub Actions for build and deployment

Architecture Notes

  • Controller layer handles HTTP requests, validation, and response formatting
  • Service layer encapsulates external API communication and business logic
  • DTOs define boundaries between external responses and internal API contracts
  • Options pattern is used for strongly typed configuration (API settings, timeouts, keys)
  • Middleware centralizes exception handling and standardizes error responses
  • HttpClient is configured via dependency injection for reliability and reuse
  • Deployment pipeline is integrated with GitHub Actions and Azure Cloud App Service for automated cloud deployment

This project reflects a gateway-style architecture, where the API acts as an intermediary between clients and external services.


What This Project Demonstrates

  • Designing a secure Web API with JWT authentication in ASP.NET Core
  • Integrating external services using HttpClient and configuration-based setup
  • Handling errors across service and middleware layers with consistent responses
  • Applying DTO mapping to decouple external and internal data models
  • Implementing structured logging for observability and debugging
  • Using dependency injection and options pattern for clean configuration management
  • Deploying ASP.NET Core Web APIs to Azure Cloud App Service
  • Implementing a CI/CD workflow with GitHub Actions
  • Understanding modern cloud-oriented backend deployment workflows

How to Run (Local Setup)

Prerequisites

  • .NET SDK 10
  • Optional: Visual Studio 2022 or Rider

Steps

Clone the repository:

git clone https://github.com/alanracic/WeatherGatewayAPI.git

Update configuration in appsettings.json:

  • Set external API base URL
  • Provide a valid API key
  • Configure JWT settings if needed

Run the application:

dotnet run

Use Swagger / OpenAPI to test endpoints in the local development environment.


Cloud Deployment

The application is deployed to Azure Cloud App Service and publicly accessible through Swagger / OpenAPI.

Live Cloud Endpoint

https://weathergatewayapi-a8hqgeavazg6a5c3.italynorth-01.azurewebsites.net/swagger

Deployment Workflow

  • Source control managed with GitHub
  • Automated build and deployment using GitHub Actions
  • Deployment target: Azure Cloud App Service
  • Public Swagger endpoint enabled for API testing and documentation

Project Structure (High-Level)

  • Controllers — API endpoints (Auth, Weather)
  • Service — external service integration and business logic
  • Dtos — request/response data contracts
  • Middleware — global exception handling
  • Program.cs — application configuration and service wiring

Skills Demonstrated

ASP.NET Core Web API · C# · .NET 10 · JWT Authentication · HttpClient · External API Integration · DTO Mapping · Middleware · Logging · Dependency Injection · Options Pattern · Async/Await · Azure Cloud App Service · GitHub Actions · CI/CD · Swagger / OpenAPI


Project Status

Actively maintained as part of a professional .NET portfolio, demonstrating external service integration, secure API design, modern cloud deployment workflows, and clean backend architecture patterns aligned with modern ASP.NET Core development practices.

About

ASP.NET Core Web API acting as a gateway to an external weather service, built with .NET 10 and deployed to Azure Cloud App Service, featuring JWT authentication, HttpClient integration, DTO mapping, structured logging, global exception handling, and GitHub Actions CI/CD

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages