BotNetApi is the backend service for the vending machine bot delivery network.
It acts as the central source of truth for:
- Bot status
- Battery levels
- Availability/service state
Other systems in the project communicate with the bots exclusively through this API.
Primary consumers:
- Frontend web application
- Bot simulator application
Bot Simulators
|
v
ASP.NET Core API
|
v
Azure SQL Database
^
|
Frontend Web App
The bot simulators push updates into the API.
The frontend pulls data from the API to display:
- Bot availability
- Battery status
The frontend and simulators should NOT communicate directly with the database.
- ASP.NET Core Web API (.NET 10)
- Entity Framework Core
- Azure SQL Database
- Swagger/OpenAPI
/api/bots
Production base URL:
https://ewu-deliverybotsystem-api.mangocoast-332176b0.westus2.azurecontainerapps.io
Local development URL:
http://localhost:5021/api/bots
https://localhost:7260/api/bots (HTTPS)
| Method | Route | Description |
|---|---|---|
PUT |
/api/bots/{id}/recharge |
Set battery to 100 |
PUT |
/api/bots/{id}/servicing-status |
Set servicing state |
Each bot contains:
The frontend will primarily:
GET /api/botsUse for:
- Status dashboards
- Admin pages
GET /api/bots/{id}The simulator should periodically push updates into the API.
Typical simulator flow:
POST /api/botsExample:
{
"name": "BOT-ECHO",
"batteryLevel": 100,
"isOnline": true
}
isServicingCustomeris omitted — new bots always start as not servicing a customer.
PUT /api/bots/12{
"name": "BOT-ECHO",
"batteryLevel": 85,
"isOnline": true,
"isServicingCustomer": false
}PUT /api/bots/12/rechargeAutomatically sets:
batteryLevel = 100
PUT /api/bots/12/servicing-status{
"isServicingCustomer": true
}When servicing is complete:
{
"isServicingCustomer": false
}DELETE /api/bots/{id}Permanently removes a bot from the system. Use only when decommissioning a bot.
Response: 204 No Content
{
"id": 4,
"name": "Bot-4",
"batteryLevel": 82,
"lastUpdated": "2026-05-17T18:12:55Z",
"isOnline": true,
"isServicingCustomer": false
}Recommended:
- Battery updates periodically
- Service state changes as needed
Recommended:
- Poll every few seconds
OR
- Add SignalR later if real-time updates become necessary
SignalR is intentionally NOT included yet to keep the project simple.
Development:
- SQL Server LocalDB
Production:
- Azure SQL Database
Entity Framework Core migrations will manage schema creation.
Migration commands:
dotnet ef migrations add <MigrationName>
dotnet ef database updateSwagger UI is available during local development:
http://localhost:5021/swagger
https://localhost:7260/swagger (HTTPS)
Developers can:
- Test endpoints
- View request/response schemas
- Experiment without Postman
Included:
- CRUD operations
- Bot status management
- EF Core persistence
Not included yet:
- Authentication
- Authorization
- Real-time websocket updates
- Queueing systems
- Distributed services
- Bot routing/pathfinding
- Reservations
- Multi-city support
This API is intentionally:
- Simple
- Beginner-friendly
- Easy to explain in a classroom setting
- Structured similarly to real production APIs
- Built so it can later evolve into a larger distributed system without major rewrites
