The PharmaVault dashboard gives you an at-a-glance view of your entire medication inventory the moment you log in. It aggregates every item you own into four plain-English counters and renders a colour-coded pie chart so you can immediately spot whether stock is healthy, approaching expiry, or already past it — without digging through individual records.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JReyna217/PharmaVault/llms.txt
Use this file to discover all available pages before exploring further.
Dashboard Stats
Every time the dashboard loads it callsIInventoryDao.GetDashboardStatsAsync(int userId) and populates a DashboardStatsDto object with four integer counters derived from the quantities stored in your inventory rows.
TotalStock
The sum of all quantity values across every inventory row that belongs to the authenticated user. This is the headline number shown at the top of the dashboard.
GoodStock
Units whose expiration date falls more than 30 days in the future. These are considered safe to use without any urgency.
ExpiringSoonStock
Units expiring on or before
CURRENT_DATE + INTERVAL '30 days' but not yet past today’s date. The 30-day window gives you time to plan before stock becomes unusable.ExpiredStock
Units whose expiration date is strictly before today (
CURRENT_DATE). These should be reviewed and removed from active use.How Expiration Thresholds Work
The four counters are calculated in a single PostgreSQL query usingCASE expressions evaluated against CURRENT_DATE. No application-layer date math is involved — the database computes the buckets at query time.
COALESCE(..., 0) ensures that a user with no inventory rows receives zeroes instead of NULL for every counter.| Category | Condition |
|---|---|
| Expired | expiration_date < CURRENT_DATE |
| Expiring Soon | expiration_date >= CURRENT_DATE AND expiration_date <= CURRENT_DATE + 30 days |
| Good | expiration_date > CURRENT_DATE + 30 days |
ApexCharts Pie Chart
WhenTotalStock > 0, the dashboard renders an interactive pie chart powered by the ApexCharts Blazor library. The chart maps each stock category to a fixed colour:
| Slice | Colour | Hex |
|---|---|---|
| Good Condition | Green | #198754 |
| Expiring Soon | Amber | #ffc107 |
| Expired | Red | #dc3545 |
transparent so it blends with any page theme. When TotalStock equals zero the chart is hidden entirely to avoid rendering an empty or misleading graphic.
InventoryChartData Model
Each pie slice is backed by a lightweight data class that holds a human-readable label and a count:
Dashboard.razor.cs after stats are loaded:
Accessing the Dashboard
The dashboard is served at the
/dashboard route and requires an authenticated session. Unauthenticated visitors are redirected to / (the login page) automatically by the cookie authentication middleware.ClaimsPrincipal:
- User’s full name — read from
ClaimTypes.Name, which is set toUser.FullNameat login. - Current date — formatted as
"dddd, MMMM dd, yyyy"(e.g., Monday, July 14, 2025) usingDateTime.Now.