This project is a RESTful API developed with ASP.NET Core Web API, designed to serve an Angular SPA for displaying weather information. It features user authentication and authorization with JWT bearer tokens, data persistence in MySQL, and integrates with the OpenWeatherMap API.
- .NET 8 SDK
- MySQL/MariaDB
- IIS for hosting (Optional for development)
You'll just need to clone the repo, update appsettings with your settings and connection string. Build and run. One tricky part is that you should register on openweatherapi to get your apikey.
POST /api/auth/register: Registers a new user. POST /api/auth/login: Authenticates a user and returns a JWT. GET /api/weather/week-summary: Retrieves weather information. Requires authentication.
This project uses ASP.NET Core Identity for user management and role-based authorization. Passwords are hashed and stored securely. JWT tokens are used for authentication.
Instructions for deploying to IIS. It is pretty simple I've followed this youtube video.
Angular SPA link.