Skip to content

Repository files navigation

Dataset Query Client-Server Application

A desktop client-server application for controlled exploration of the Los Angeles arrest dataset. The project combines a custom TCP protocol, authenticated PostgreSQL persistence, moderator tooling, analytical queries, and PySide6 interfaces.

Built as an individual advanced programming and mathematics project at Howest.

Capabilities

Moderator server

  • Starts and stops the socket server from a desktop interface.
  • Registers and authenticates users against PostgreSQL.
  • Tracks connected clients, queries, and query popularity.
  • Shows server logs and client history in real time.
  • Broadcasts messages to all connected clients.

Client

  • Registers and signs users in.
  • Runs parameterized dataset queries without exposing the source dataset.
  • Displays analytical results and query history.
  • Sends messages and receives moderator broadcasts.

Architecture

PySide6 client
    │  framed JSON messages over TCP
    ▼
threaded Python socket server
    ├── protocol validation and authentication
    ├── pandas-based dataset queries
    └── PostgreSQL users, sessions, and query history

Messages use a shared protocol module and an explicit length prefix, avoiding assumptions that one socket read equals one complete message. Each client connection is handled independently while the moderator interface receives thread-safe status updates.

Run locally

Requirements: Python 3.10 or newer, Docker with Compose, and a desktop session for PySide6.

git clone https://github.com/SnaetWarre/Server-Client-Python.git
cd Server-Client-Python

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

docker compose up -d
python run_server.py

Open a second terminal in the same virtual environment:

python run_client.py

The launcher scripts use the actual application modules under app/server and app/client. The server and client default to 127.0.0.1:8888; the interfaces allow those values to be changed.

Project structure

app/
├── client/       # socket client, PySide6 interface, and widgets
├── server/       # server, connection handlers, queries, and persistence
└── shared/       # protocol constants and message framing
Data/             # analysis scripts and generated plots
init.sql          # PostgreSQL schema
docker-compose.yml
run_server.py
run_client.py

Verification

python -m compileall app run_server.py run_client.py

# Requires the PostgreSQL container and configured test database
pytest test_postgres.py

Continuous integration runs the dependency-independent source compilation check. The PostgreSQL integration test remains a local check because it expects the project database configuration.

Dataset and scope

The application uses the public Los Angeles arrest dataset on Kaggle. It is an academic desktop application rather than an internet-facing production service. A production version would require transport encryption, centrally managed secrets, stricter authorization, migration tooling, observability, and explicit data-retention controls.

Further reading

About

PySide6 client-server dataset analysis application with a custom TCP protocol, PostgreSQL, authentication, and moderator tooling.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages