A full-stack F# web application that displays a dashboard with data from various APIs, storing historical data in a SQLite database.
FStackDashboard/
├── Models/ # Data models for weather, stocks, and metrics
├── Data/ # Entity Framework database context
├── Services/ # API services and background data collection
├── Controllers/ # Web API controllers
├── wwwroot/ # Frontend HTML, CSS, and JavaScript
├── Program.fs # Main application entry point
└── FStackDashboard.fsproj
- Dashboard Web UI: Modern responsive dashboard showing weather, stock prices, and system metrics
- API Endpoints: RESTful API endpoints for accessing dashboard data
- Background Service: Daily data collection service that fetches and stores data
- SQLite Database: Local database for storing historical data
- Sample Data: Uses sample data generators that can be replaced with real API calls
GET /api/dashboard/summary
- Dashboard summary with recent dataGET /api/dashboard/weather
- Weather data for multiple citiesGET /api/dashboard/stocks
- Stock price dataGET /api/dashboard/metrics
- System metrics dataPOST /api/dashboard/refresh
- Manually refresh all data
The application includes sample data generators for:
- Weather Data: Temperature, humidity, and conditions for major cities
- Stock Prices: Price data for major tech stocks (AAPL, GOOGL, MSFT, TSLA, AMZN)
- System Metrics: CPU usage, memory, disk space, network traffic, and active users
- .NET 9.0 SDK or later
- ASP.NET Core runtime
dotnet build
dotnet run --urls http://localhost:5000
The application will be available at:
- Dashboard: http://localhost:5000
- API Documentation: http://localhost:5000/swagger
The application automatically creates a SQLite database (dashboard.db
) on first run.
- Backend: F# with ASP.NET Core
- Database: Entity Framework Core with SQLite
- Frontend: Vanilla HTML/CSS/JavaScript
- Background Services: Hosted services for data collection
- API: RESTful endpoints with JSON responses
To replace sample data with real API calls:
- Update
Services/ApiService.fs
to call real APIs - Add API keys and configuration to
appsettings.json
- Install HTTP client packages as needed
- Update data models if API response formats differ
The project is structured as a standard ASP.NET Core application written in F#:
- Functional programming patterns throughout
- Immutable data models with CLIMutable attributes for Entity Framework
- Task-based async programming for API calls
- Background services for data collection