Software
Reference
Development

Development

Setup

Clone the repository

git clone https://github.com/pieeg-club/PiEEG-server.git
cd PiEEG-server

Create a virtual environment

python -m venv .venv
source .venv/bin/activate  # Linux/macOS
# .venv\Scripts\Activate.ps1  # Windows PowerShell

Install dependencies

pip install -e ".[dev]"

Install dashboard dependencies

cd dashboard
yarn install

Running Tests

python -m pytest tests/ -x -q --tb=short

Building the Dashboard

cd dashboard
yarn build

The built dashboard is copied to pieeg_server/static/dashboard/ and served by the Python server.

Project Structure

PiEEG-server/
├── pieeg_server/        # Python server package
│   ├── __main__.py      # CLI entry point
│   ├── server.py        # WebSocket server
│   ├── acquisition.py   # 250 Hz read loop
│   ├── hardware.py      # SPI/GPIO driver
│   └── ...
├── dashboard/           # React + Vite frontend
│   ├── src/
│   │   ├── App.tsx
│   │   ├── components/
│   │   ├── experiences/
│   │   └── hooks/
│   └── ...
├── notebooks/           # Jupyter analysis notebooks
├── tests/               # pytest suite
├── doc/                 # This documentation (Nextra)
└── recordings/          # Saved EEG sessions

Release Process

  1. Update version in pyproject.toml
  2. Run tests: pytest tests/ -x
  3. Build dashboard: cd dashboard && yarn build
  4. Build package: python -m build
  5. Publish: twine upload dist/*

The CI pipeline runs tests automatically on push. Check the GitHub Actions (opens in a new tab) for build status.