Skip to main content

InventoryAlert — Introduction

A real-time stock portfolio and alert system built on .NET 10 + Next.js 15.

InventoryAlert is a full-stack system that monitors global stock prices via the Finnhub API and automatically dispatches per-user in-app alerts when user-defined thresholds are triggered. It is designed to be multi-user, event-driven, and observable by default.

What Problem Does It Solve?

Users who maintain a portfolio of stock positions need to know immediately when prices hit critical levels — without constantly checking manually. InventoryAlert automates this through:

  • Background jobs that sync market prices every 15 minutes across the full catalog.
  • Event-driven fan-out that evaluates each user's thresholds independently.
  • In-app Notification hub that delivers real-time alerts the moment a threshold is breached.
  • Full audit trails so every trade and price movement is traceable via structured Seq logs.

Core Capabilities

FeatureDescription
🔍 Global Stock CatalogBrowse and search StockListing entries (DB-first with Finnhub fallback)
📊 Portfolio ManagementTrack positions via Trade ledger (Buy/Sell/Dividend/Split) with dynamic cost-basis
👁️ WatchlistWatch-only tracking without requiring an open position
Alert RulesDefine threshold conditions (PriceAbove, PriceBelow, PercentDropFromCost, LowHoldingsCount)
📈 Price SyncAutomatic global price updates from Finnhub every 15 minutes → PriceHistory
📉 Market IntelligenceBasic Financials, Earnings Surprises, Analyst Recommendations, Insider Transactions
🏢 Company ProfilesAuto-fetches Ticker metadata (Logo, Industry, Website, Exchange) on demand
🔔 In-App NotificationsBell-badge hub — breaches write Notification rows; UI polls every 30s
🗓️ Market CalendarsEarnings release calendar, IPO calendar, and exchange holiday list
📰 Market & Company NewsPer-ticker and general news from Finnhub, stored permanently in DynamoDB
🔒 Multi-User IsolationPer-user portfolio/alerts/watchlist fully isolated; global market data shared

High-Level Component Map

┌──────────────┐ REST ┌───────────────────┐ EF Core ┌────────────┐
│ Next.js UI │ ────────▶ │ InventoryAlert │ ─────────▶ │ PostgreSQL │
│ :3000 │ │ .Api :8080 │ └────────────┘
└──────────────┘ └───────────────────┘
│ SQS ┌────────────┐
┌────────▼─────────┐ ────────▶ │ DynamoDB │
│ InventoryAlert │ │ (News) │
│ .Worker │ └────────────┘
└──────────────────┘

┌───────────────┼───────────────┐
▼ ▼ ▼
Finnhub API Redis Cache Seq Logs
:5341

Seed Accounts

UsernamePasswordRole
adminpasswordAdmin
user1passwordUser