Skip to content

ChrisTitusTech/fstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

F# Stack Dashboard

A full-stack F# web application that displays a dashboard with data from various APIs, storing historical data in a SQLite database.

Project Structure

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

Features

  • 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

API Endpoints

  • GET /api/dashboard/summary - Dashboard summary with recent data
  • GET /api/dashboard/weather - Weather data for multiple cities
  • GET /api/dashboard/stocks - Stock price data
  • GET /api/dashboard/metrics - System metrics data
  • POST /api/dashboard/refresh - Manually refresh all data

Sample 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

Running the Application

Prerequisites

  • .NET 9.0 SDK or later
  • ASP.NET Core runtime

Build and Run

dotnet build
dotnet run --urls http://localhost:5000

The application will be available at:

Database

The application automatically creates a SQLite database (dashboard.db) on first run.

Architecture

  • 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

Customization

To replace sample data with real API calls:

  1. Update Services/ApiService.fs to call real APIs
  2. Add API keys and configuration to appsettings.json
  3. Install HTTP client packages as needed
  4. Update data models if API response formats differ

Development

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published