Development
Setup
Clone the repository
git clone https://github.com/pieeg-club/PiEEG-server.git
cd PiEEG-serverCreate a virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\Activate.ps1 # Windows PowerShellInstall dependencies
pip install -e ".[dev]"Install dashboard dependencies
cd dashboard
yarn installRunning Tests
python -m pytest tests/ -x -q --tb=shortBuilding the Dashboard
cd dashboard
yarn buildThe 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 sessionsRelease Process
- Update version in
pyproject.toml - Run tests:
pytest tests/ -x - Build dashboard:
cd dashboard && yarn build - Build package:
python -m build - Publish:
twine upload dist/*
The CI pipeline runs tests automatically on push. Check the GitHub Actions for build status.