API Layer¶
Project:
KeDevO.YardPro.APIType: ASP.NET Core Web API (.NET 10.0) Base URL:https://localhost:7254(dev) /https://api.yardpro.uk(prod)
Architecture Role¶
Web (Blazor Server) → HTTP → API → Infrastructure → Database
→ Integration (eBay, Facebook)
→ NHTSA (VIN decode)
The API is the single gateway to all data and external integrations.
Dependencies¶
| Dependency | Version | Purpose |
|---|---|---|
| Swashbuckle.AspNetCore | 10.1.1 | Swagger UI |
| JwtBearer | 10.0.2 | JWT token validation |
| EF Core SQLite | 10.0.2 | Database |
| CsvHelper | 33.1.0 | Vehicle catalog CSV import |
| QRCoder | 1.7.0 | QR code generation for labels |
Startup Pipeline¶
- Blazor Server + Razor Components
- EF Core — SQLite with auto-migration on startup
- JWT Auth — HMAC SHA-256 signing, 1-hour token lifetime
- Swagger — At root
/, ReDoc at/docs - Security Headers — X-Content-Type-Options, X-Frame-Options, X-XSS-Protection
- CORS — Permissive for development
- Static files — For media uploads
Controllers (20)¶
AuthController — api/auth¶
JWT login endpoint.
VehiclesController — api/vehicle¶
CRUD, VIN lookup via NHTSA, search with make/model/status filters.
PartsController — api/parts¶
CRUD, reserve/sell workflow (transactional: create customer → invoice → payment → mark sold).
EbayController — api/ebay (9 partial class files)¶
- Authentication — OAuth consent URL, token callback, account management
- Listings — Create/update/withdraw/bulk operations
- Orders — Sync and acknowledge
- Templates — Listing template CRUD
- Category Mappings — Part category → eBay category
- Business Policies — Fulfillment, return, payment policies
FacebookController — api/facebook¶
Account connection, page posting, engagement tracking.
Services¶
| Service | Purpose |
|---|---|
| CarApiService | NHTSA VIN decoding |
| InterchangeGenerationService | Part interchange matching |
| InvoiceService | Transactional sell: invoice → payment → status |
| MediaService | File upload/delete/reorder |
| VehicleCatalogImportService | CSV import with batch insert (1000/batch) |