Modernized inventory tracking stack built with a minimal .NET API, a shared core library, and a Svelte single-page app.
As seen on Budget Bytes: Build an Inventory Manager for Free!
InventoryManagementAPI/– Minimal API exposing receipt analysis and inventory endpoints.InventoryTrackerApp.Core/– Shared models, data access, text/image analysis helpers.inventory-frontend/– Vite-powered Svelte UI that talks to the API.
Svelte UI ──▶ InventoryManagementAPI ──▶ SQL
│
└──▶ InventoryTrackerApp.Core
- .NET 9+ SDK
- Node.js 18+ and npm
- Azure Subscription with:
-
Navigate to the repository root.
-
Restore dependencies and compile:
dotnet restore dotnet build
-
Configure environment variables used by the API/Core:
AZURE_SQL_CONN– SQL connection string.AI_FOUNDRY_ENDPOINT– Microsoft Foundry endpoint URL (ends with/).API_KEY– API key for the Foundry AI resource.
Alternatively, configure the AzureOpenAI section in appsettings.json:
{ "AzureOpenAI": { "Endpoint": "your-azure-openai-endpoint", "Deployment": "your-deployment-name", "ApiKey": "your-api-key", "Temperature": 0.1, "MaxOutputTokens": 256, "CatalogSampleSize": 50, "MinimumConfidence": 0.6 } } -
Run the API:
dotnet run --project InventoryManagementAPI/InventoryManagementAPI.csproj
The API listens on
http://localhost:5000by default (HTTPS onhttps://localhost:7269).
- Install dependencies:
cd inventory-frontend npm install - Start the dev server (proxies
/apitohttp://localhost:5000):npm run dev
- If the backend runs on a different URL, set
VITE_API_PROXYbefore starting the dev server or setVITE_API_BASE_URLfor production builds. - Build for production:
npm run build
| Method | Route | Description |
|---|---|---|
| GET | / |
Health string. |
| GET | /items |
Returns current inventory items. |
| POST | /analyze |
Accepts an image/* file upload, |
| extracts products, saves to storage. |
- Upload a photo/receipt for automatic item extraction.
- View inventory list with timestamps, categories, expiration dates.
- Trigger manual refreshes without reloading the page.
- Use
dotnet watch --project InventoryManagementAPIfor hot reload while developing the API. - The Vite dev server proxies
/api/*calls to the backend, so no CORS changes are needed in development. - To serve the built Svelte assets from ASP.NET later, point a static file middleware to
inventory-frontend/distafter runningnpm run build.