Skip to content

davidpal3c/IoTDeviceTelemetryAPI-v0.1

Repository files navigation

IoT Telemetry Dashboard API

A production-minded, memory-optimized ASP.NET Core Web API that simulates telemetry ingestion from IoT devices. This project showcases advanced backend design patterns, low-level memory awareness (stack vs heap), and a clean layered architecture ideal for high-performance, energy-constrained environments like IoT. Perfectly suited for portfolio demonstration and technical interviews.

🎯 Why This Project?

  • Brushup on ASP.NET Core and design concepts – Layered architecture, service abstraction, and clean dependency injection

  • Highlight IoT-relevant patterns – Struct-based DTOs, batching, lightweight validation, GC avoidance

  • Implement a memory-conscious design – Stack vs heap, async I/O, and efficient EF Core usage. Profiling heap vs stack usage for educational insights (BenchmarkDotNet Integration).


📐 Architecture

This project implements a robust 4-layer architecture to ensure separation of concerns, scalability, and maintainability:

Layer Folder Responsibility
Presentation Layer Controllers/ Exposes REST API endpoints, handles HTTP logic
Business Logic Layer Services/ Central logic (e.g., CRC validation, data transformation)
Data Access Layer Repositories/ EF Core queries, stored procedure calls, batch operations
Database Layer Data/ SQLite schema, migrations, and DbContext configuration

🧱 Tech Stack

  • ASP.NET Core Web API – Modern, cross-platform framework
  • Entity Framework Core + SQLite – Lightweight, embedded relational DB
  • C# 12 – Using record and readonly struct for memory-sensitive DTOs (Data Transfer Objects)
  • Swagger/OpenAPI – For self-documenting API and manual testing
  • Optional Frontend – React + Axios + Chart.js/Recharts (planned)

🧠 Memory-Conscious Design

This app is tailored for environments where memory allocation matters:

Technique Benefit
readonly struct for DTOs Uses stack memory → avoids GC overhead
AsNoTracking() Reduces EF Core memory pressure during reads
Async/Await on EF methods Efficient I/O, responsive threads
Batching and Pagination Prevents memory spikes, improves DB performance
Scoped Services Avoids memory leaks from long-lived dependencies
Lightweight CRC validation Realistic low-cost check for data integrity

🔄 API Endpoints

(2025-06-04)

Method Route Purpose
POST /api/telemetry Submit new telemetry data with CRC validation
GET /api/telemetry/{deviceId} Retrieve the latest readings for a device
DELETE /api/telemetry/cleanup Batch delete old data (e.g., older than 7 days)

🚀 Future Enhancements

🧾 Stored Procedure Integration: Use SQL Server for performance-heavy cleanup logic

🖥️ React Dashboard: Live UI with telemetry charts using Recharts or Chart.js

🔁 Real-Time Telemetry via SignalR: Push updates from backend to frontend without polling

🔐 JWT Authentication: Secure access to telemetry endpoints

🐳 Dockerization: Containerize backend and optional frontend for deployment

🔄 GitHub Actions CI/CD: Automated testing, linting, and deployment pipelines

🧪 Unit & Integration Tests: Coverage of services and controllers using xUnit or NUnit

🧠 Redis or LiteDB Caching: Optional low-memory persistent caching layer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages