Skip to content

stefan1condeescu/remote-app-update-system

Repository files navigation

Remote Application Update Demo

A small Python client-server project that demonstrates remote application distribution and updates over TCP sockets. The server keeps a catalog of available application files, clients can list and download them, and a publisher script can push new versions to clients that previously downloaded an app.

This project is intended as a networking and systems-programming demo. It does not include authentication, authorization, or transport encryption, so it should only be used on a trusted local network or in a controlled lab environment.

Features

  • Concurrent TCP server that handles multiple clients with threads.
  • Simple JSON header protocol with optional binary file payloads.
  • Client commands for listing, downloading, running, stopping, checking, and reading logs for demo apps.
  • Publisher workflow for releasing a new app version to the server.
  • Automatic update push to connected clients that previously downloaded the app.
  • Pending update handling when a client is currently running the app.
  • Docker Compose support for running the server in a container.

Tech Stack

  • Python 3.11+
  • Python standard library only: socket, threading, json, subprocess, pathlib
  • Docker and Docker Compose for optional containerized server runs

Project Structure

.
|-- client.py              # Interactive client CLI
|-- common.py              # Shared framing/protocol helpers
|-- publisher.py           # Publishes a new app version to the server
|-- reset_demo.py          # Resets generated demo app state
|-- server.py              # Concurrent TCP update server
|-- Dockerfile             # Container image for the server
|-- docker-compose.yml     # Local server container configuration
|-- new_versions/          # Example app versions for publishing
`-- server_apps/           # Seed apps and server version metadata

Runtime state is written to client_data/ and server_apps/downloads.json; these files are intentionally ignored by Git.

Requirements

  • Python 3.11 or newer
  • Docker Desktop or Docker Engine, only if you want to use the containerized server

No third-party Python packages are required.

Local Setup

Create and activate a virtual environment if you want an isolated Python interpreter:

python -m venv .venv
source .venv/bin/activate

On Windows PowerShell:

python -m venv .venv
.\.venv\Scripts\Activate.ps1

Run Locally

Start the server:

python server.py 127.0.0.1 5000

In another terminal, start a client:

python client.py client-a 127.0.0.1 5000

Inside the client prompt, try:

list
download app1.py
run app1.py
status
logs app1.py
stop app1.py
quit

Publish a newer version from another terminal:

python publisher.py app1.py new_versions/app1_v2.py 127.0.0.1 5000

If the client downloaded app1.py, the server sends the update automatically. If the app is running, the client stores the update in client_data/<client-id>/pending/ and applies it after the app stops.

Reset the demo state:

python reset_demo.py

Run With Docker Compose

Build and start the server container:

docker compose up --build

The compose file maps host port 8709 to container port 5000, so a local client can connect with:

python client.py client-a 127.0.0.1 8709

Environment Variables

Variable Used by Default Description
APPS_DIR server.py ./server_apps Directory containing server-side app files and version metadata.

Demo Notes

  • server_apps/app1.py and server_apps/app2.py are seed demo apps.
  • new_versions/app1_v2.py and new_versions/app1_v3.py are sample payloads for testing updates.
  • server_apps/downloads.json tracks which clients downloaded each app during a run and should not be committed.
  • client_data/ contains local client state, downloaded apps, pending updates, and logs and should not be committed.

Security Notes

This project is a learning/demo implementation. Before using the design beyond a local lab, add authentication, authorization, TLS, input validation, app integrity checks, and a safer deployment model.

About

A Python TCP client-server system that demonstrates remote application downloads, version tracking, and automatic update delivery.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors