gitea edfe2f1bfe Remove the serial bridge's unused Django client
The bridge reads the COM port and streams SSE to the frontend; it never
talks to Django. backend_client.py (a Django API client) and config.py
(which held BACKEND_URL / API_ENDPOINT) were imported by nothing - app.py
calls load_dotenv() and reads os.getenv directly, and the PyInstaller spec
builds from app.py alone.

Their presence implied a coupling that does not exist, and the stale
BACKEND_URL=8000 in .env read as a misconfiguration rather than an inert
value.

Also drops the matching backend settings from .env.example, the now
unnecessary 'requests' hidden import from the spec, and the two files from
the SETUP.md tree. requests and urllib3 remain in requirements.txt - no
bridge module uses them now, but pruning dependencies is a build concern
left for a separate change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 19:49:14 +03:00
2026-02-21 19:53:04 +02:00
2026-02-24 00:13:56 +02:00
2026-02-24 00:13:56 +02:00
2026-02-21 19:53:04 +02:00

ScalesApp - Multi-Component Application

A distributed application consisting of three main components:

Architecture

1. Frontend (React)

  • Location: /frontend
  • Description: React web application that displays real-time data from the serial port
  • Communicates with: Django backend via REST API
  • Port: 3000 (default)

2. Backend (Django)

  • Location: /backend
  • Description: Django REST API server for storing and retrieving serial data
  • Database: SQLite (configurable)
  • Port: 8000 (default)

3. Serial Bridge (Python)

  • Location: /serial_bridge
  • Description: Python application that reads data from COM ports
  • Features: System tray integration, runs as EXE (via PyInstaller)
  • Communicates with: Django backend via REST API
  • Data Flow: COM Port → Serial Bridge → Django Backend → React Frontend

Installation & Setup

Prerequisites

  • Node.js 16+ (for React)
  • Python 3.8+ (for Django and Serial Bridge)
  • pip or conda for Python packages

Quick Start

  1. Backend Setup

    cd backend
    python -m venv venv
    venv\Scripts\activate
    pip install -r requirements.txt
    python manage.py migrate
    python manage.py runserver
    
  2. Frontend Setup

    cd frontend
    npm install
    npm start
    
  3. Serial Bridge Setup

    cd serial_bridge
    python -m venv venv
    venv\Scripts\activate
    pip install -r requirements.txt
    python app.py
    

Data Flow

COM Port
   ↓
Serial Bridge (Python)
   ↓
Django Backend REST API
   ↓
React Frontend

Configuration

Each component has its own configuration file:

  • Frontend: .env
  • Backend: settings.py and .env
  • Serial Bridge: config.py and .env

Development Tips

  • Keep all three services running during development
  • Use CORS headers properly in Django for frontend requests
  • Serial Bridge should continuously read COM data and POST to backend
  • Frontend should poll/subscribe to backend for updates
S
Description
VehicleScales app with Django and React. It has a python service reading from comport and forwarding data to frontend via sse
Readme 4.3 MiB
Languages
JavaScript 62.1%
Python 23.8%
CSS 13.8%
Dockerfile 0.1%