Skip to content

cessdel/backend_ergonoapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ergono-Backend (Orchestrator)

Language Database Protocol Status

Ergono-Backend serves as the central orchestration unit for the Real-Time Data Acquisition System.

Written in Python, this server manages high-concurrency WebSocket connections to facilitate communication between the mobile sensor nodes (ErgonoApp) and the storage layer. It utilizes an asynchronous architecture (asyncio) to handle data ingestion, command synchronization, and high-performance persistence into TimescaleDB via asyncpg.


Key Features

  • Asynchronous WebSocket Server: Manages real-time, bi-directional communication using the websockets library.
  • High-Performance Database Access: Uses asyncpg for non-blocking, high-speed data insertion into TimescaleDB/PostgreSQL.
  • Real-Time Data Processing: Handles incoming sensor streams and JSON payloads efficiently using Python's native asyncio loop.
  • Session Orchestration: Broadcasts global control commands (Start/Stop) to synchronize data collection across connected devices.
  • Simulation Capabilities: Includes logic for data simulation and testing environments.

Tech Stack

This project is built on a fully asynchronous Python stack to ensure low latency and high scalability.

Category Technology
Core Architecture asyncio
Communication websockets
Database Driver asyncpg (PostgreSQL Client)
Data Handling json, io
Utilities datetime, random

Installation & Setup

Prerequisites

  • Python 3.10 or higher.
  • A running instance of TimescaleDB (or PostgreSQL).
  • Git.

Getting Started

  1. Clone the repository:

    git clone https://github.com/cessdel/backend_ergonoapp
    cd backend_ergonoapp
  2. Create a Virtual Environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
  3. Install dependencies: Since asyncio, json, and random are part of the Python standard library, you only need to install the external packages:

    pip install websockets asyncpg

    (Or install via requirements.txt if available)

Configuration

Ensure your database credentials are correct. You can configure the connection strings directly in the main script or via environment variables, depending on your setup.

  • Database: PostgreSQL/TimescaleDB
  • Driver: asyncpg
  • Port: Default WebSocket port (e.g., 8765)

Running the Orchestrator

To start the WebSocket server and begin listening for connections:

python app.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors