A full-stack web application that fetches and displays weather data, events, and points of interest from the Open Data Hub API for South Tyrol. It uses OpenAI to generate natural language recommendations and explanations.
OpenDataHubAssistant/
??? src/
? ??? OpenDataHubAssistant.Api/ # ASP.NET Core Web API
? ? ??? Controllers/ # API endpoints
? ? ??? Program.cs # Application entry point
? ??? OpenDataHubAssistant.Core/ # Domain layer
? ? ??? Models/ # Entity models
? ? ??? DTOs/ # Data transfer objects
? ? ??? Interfaces/ # Service interfaces
? ? ??? Services/ # Business logic
? ? ??? Enums/ # Enumerations
? ??? OpenDataHubAssistant.Infrastructure/ # Data & external services
? ??? Data/ # EF Core DbContext
? ??? Repositories/ # Repository implementations
? ??? ExternalClients/ # Open Data Hub API clients
? ??? Services/ # OpenAI LLM service
? ??? Configuration/ # Settings classes
??? frontend/ # Angular application
? ??? src/
? ??? app/
? ??? components/ # Chat & Direct query pages
? ??? services/ # API service
? ??? models/ # TypeScript interfaces
??? README.md
- Weather Data: Fetch current and forecasted weather for South Tyrol locations
- Events: Get upcoming events from Open Data Hub
- Points of Interest: Discover attractions, museums, and activities
- Weather Classification: Automatic classification (Good/Bad/Rainy/Cold/Hot/Windy)
- Activity Recommendations: Smart suggestions based on weather conditions
- AI-Powered Chat: Natural language interface using OpenAI
- Two UI Modes:
- Chat Interface: Conversational Q&A about weather and activities
- Direct Query: Form-based data lookup with detailed results
- .NET 8 SDK
- Node.js 18+ and npm
- Angular CLI (optional, can use npx)
The application uses the public Open Data Hub Tourism API endpoints by default:
- Weather:
https://tourism.opendatahub.com/v1/Weather - Events:
https://tourism.opendatahub.com/v1/Event - POI:
https://tourism.opendatahub.com/v1/ODHActivityPoi
These can be customized in src/OpenDataHubAssistant.Api/appsettings.json:
{
"OpenDataHub": {
"WeatherApiBaseUrl": "https://tourism.opendatahub.com/v1/Weather",
"EventsApiBaseUrl": "https://tourism.opendatahub.com/v1/Event",
"PoiApiBaseUrl": "https://tourism.opendatahub.com/v1/ODHActivityPoi",
"CacheTtlMinutes": 15,
"TimeoutSeconds": 30,
"RetryCount": 3
}
}To enable AI-powered responses, configure OpenAI:
Option A: Environment Variable (Recommended)
# Windows PowerShell
$env:OPENAI_API_KEY = "your-api-key-here"
# Linux/macOS
export OPENAI_API_KEY="your-api-key-here"Option B: appsettings.json (Not recommended for production)
{
"OpenAI": {
"ApiKey": "your-api-key-here",
"Model": "gpt-3.5-turbo",
"BaseUrl": "https://api.openai.com/v1",
"MaxTokens": 500,
"Temperature": 0.7
}
}Note: Without an OpenAI API key, the application will use rule-based fallback responses.
The application uses SQLite by default. The database file (opendatahub.db) is created automatically in the API project directory.
To use a different database provider, update the connection string in appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=opendatahub.db"
}
}# Navigate to the solution directory
cd "D:\Masters\UNIBZ\Semester 1\Architecture\Project\impl trial"
# Restore packages and build
dotnet build
# Run the API
cd src/OpenDataHubAssistant.Api
dotnet runThe API will be available at:
- HTTP:
http://localhost:5213 - HTTPS:
https://localhost:7088 - Swagger UI:
https://localhost:7088/swagger
# Navigate to the frontend directory
cd frontend
# Install dependencies
npm install
# Run the development server
npm startThe Angular app will be available at http://localhost:4200
# Build
dotnet build
# Run tests (if available)
dotnet test
# Create new migration
dotnet ef migrations add MigrationName --project src/OpenDataHubAssistant.Infrastructure --startup-project src/OpenDataHubAssistant.Api
# Apply migrations
dotnet ef database update --project src/OpenDataHubAssistant.Infrastructure --startup-project src/OpenDataHubAssistant.Api# Development server
npm start
# Build for production
npm run build
# Lint
npm run lint| Endpoint | Method | Description |
|---|---|---|
/api/locations |
GET | List all available locations |
/api/locations/{id} |
GET | Get a specific location |
/api/weather?lat={lat}&lon={lon}&date={date} |
GET | Get weather by coordinates |
/api/weather/city/{city}?date={date} |
GET | Get weather by city name |
/api/recommendations?locationId={id}&date={date} |
GET | Get AI-powered recommendations |
/api/recommendations/city/{city}?date={date} |
GET | Get recommendations by city |
/api/chat |
POST | Send chat message |
/api/chat/status |
GET | Check LLM availability |
/health |
GET | Health check endpoint |
Id(int, PK)Name(string)Latitude(double)Longitude(double)
Id(int, PK)LocationId(int, FK)Timestamp(DateTime)TemperatureC(double)PrecipitationMm(double)WindKph(double)ConditionText(string)RawJson(string, nullable)
Id(int, PK)Name(string)Description(string)StartDate(DateTime)EndDate(DateTime)Location(string)IsIndoor(bool)ExternalId(string)
Id(int, PK)Name(string)Type(string)Description(string)Address(string)IsIndoor(bool)ExternalId(string)Latitude(double, nullable)Longitude(double, nullable)
Id(int, PK)LocationId(int, FK, nullable)Timestamp(DateTime)QueryText(string)RecommendationText(string)SourceDataSummary(string)
| Classification | Condition |
|---|---|
| Good | No bad conditions present |
| Bad | Any of: Rainy, Cold, or Windy |
| Cold | Temperature < 10°C |
| Hot | Temperature > 30°C |
| Rainy | Precipitation > 0.5mm |
| Windy | Wind > 30 km/h |
The database includes these South Tyrol locations:
| Name | Latitude | Longitude |
|---|---|---|
| Bolzano | 46.4983 | 11.3548 |
| Merano | 46.6713 | 11.1594 |
| Bressanone | 46.7176 | 11.6565 |
| Brunico | 46.7964 | 11.9365 |
| Vipiteno | 46.8958 | 11.4328 |
- .NET 8
- ASP.NET Core Web API
- Entity Framework Core 8
- SQLite (default, configurable)
- Polly (retry policies)
- Angular 19+
- TypeScript
- RxJS
- CSS (no external framework)
- Open Data Hub Tourism API
- OpenAI API (GPT-3.5/GPT-4)
- Add unit tests for services
- Add integration tests for API endpoints
- Implement user authentication (if needed)
- Add support for multiple languages
- Enhance weather parsing for more detailed data
- Add caching layer for database queries
This project is for educational purposes.
- Open Data Hub for providing the South Tyrol tourism data API
- OpenAI for the language model API