Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡️ OmniPulse — Polyglot Real-Time Telemetry & AI Analytics Platform

TypeScript Python NestJS Django Celery Redis PostgreSQL Docker

OmniPulse is an enterprise-grade, event-driven polyglot microservice ecosystem designed for high-throughput IoT/energy telemetry ingestion, background analytical aggregation, and AI-driven anomaly detection in real time.


🏗 System Architecture

           +----------------------------------+
           |    React / Next.js Dashboard     |
           +-----------------+----------------+
                             |  ▲
         HTTP / REST (JWT)   |  | WebSockets (Live Alerts)
                             ▼  |
  +------------------------------------------------------+
  |       SERVICE 1: NestJS (API & Ingestion Gateway)     |
  |   • DTO Validation (class-validator)                 |
  |   • Rate Limiting & Auth Guards                      |
  |   • Redis Message Producer                           |
  +--------------------------+---------------------------+
                             |
                             | Event Queue (LPUSH / RPOP)
                             ▼
                +--------------------------+
                |   Redis Message Broker   |
                +-------------+------------+
                              |
                              | Task Execution
                              ▼
  +------------------------------------------------------+
  |    SERVICE 2: Django REST & Celery (Analytics Engine)|
  |   • PostgreSQL Data Persistence                      |
  |   • Celery Workers (Batch Processing & Aggregations) |
  |   • Scheduled Tasks (Celery Beat CRON)               |
  |   • AI / LLM Anomaly Detection Pipeline              |
  +--------------------------+---------------------------+
                             |
                             ▼
                +--------------------------+
                |    PostgreSQL Database   |
                +--------------------------+

🚀 Key Features

  • Polyglot Microservices: NestJS for event-driven async I/O & Django for analytical computation and data modeling.
  • High-Throughput Ingestion: Non-blocking ingestion pipeline via NestJS connected to Redis queues.
  • Background Worker Architecture: Asynchronous workers powered by Celery & Redis for scheduled tasks and heavy reporting.
  • Robust Data Validation: Type-safe DTOs (class-validator) on the gateway and strict DRF Serializers on the analytics layer.
  • Containerized Infrastructure: Single-command local infrastructure setup with Docker Compose.

📁 Repository Structure

omnipulse/
├── docker-compose.yaml       # PostgreSQL & Redis infrastructure
├── gateway-nest/             # NestJS Ingestion Gateway & WebSockets
│   ├── src/
│   │   ├── telemetry/        # Telemetry ingestion controller & DTOs
│   │   └── redis/            # Redis connection service & DI provider
│   ├── package.json
│   └── tsconfig.json
└── analytics-django/         # Django REST Framework & Celery Worker
    ├── core/                 # Django settings & Celery config
    ├── api/                  # Models, Serializers, Views & Celery Tasks
    ├── manage.py
    └── requirements.txt

⚙️ Quick Start Guide

1. Prerequisites


2. Infrastructure Setup (PostgreSQL & Redis)

From the project root:

docker compose up -d

3. Start Gateway Service (NestJS)

cd gateway-nest
npm install
npm run start:dev
  • Endpoint: http://localhost:3000

4. Start Analytics Engine & Workers (Django + Celery)

Step 4.1: Database Migrations & Django Server

cd analytics-django
python3 -m venv env
source env/bin/activate   # On Windows: env\Scripts\activate
pip install -r requirements.txt

python manage.py migrate
python manage.py runserver 8000

Step 4.2: Run Celery Worker (In a separate terminal)

cd analytics-django
source env/bin/activate
celery -A core worker -l info

📡 API Reference

Ingest Telemetry Metric

POST /api/telemetry (NestJS Gateway)

Request Body:

{
  "device_id": "sensor-eu-west-01",
  "metric_value": 78.4,
  "sensor_type": "power_load"
}

Response (202 Accepted):

{
  "status": "queued",
  "message": "Telemetry sent to analytics processing pipeline",
  "data": {
    "device_id": "sensor-eu-west-01",
    "metric_value": 78.4,
    "sensor_type": "power_load",
    "received_at": "2026-08-16T15:10:00.000Z"
  }
}

🛠 Tech Stack Details

Layer Technology Purpose
API Gateway NestJS (TypeScript) Ingestion, validation, rate limiting, WebSockets
Message Broker Redis Asynchronous queue and inter-service messaging
Analytics Backend Django & DRF (Python) ORM aggregations, business logic, reporting
Task Queue Celery & Celery Beat Scheduled polling, anomaly detection, background processing
Database PostgreSQL Relational data persistence
DevOps Docker Compose Orchestration of local development services

📄 License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages