Developed in collaboration with Lampros Mpaltadoros.
A Django web application for managing anonymized cardiology subject records and visualizing uploaded ECG waveform files.
Django App → Authentication → Subject Records → ECG Upload → Waveform Visualization → Clinical Summary Dashboard
Important: This is a software demonstration app. It is not a medical or diagnostic system.
This project demonstrates a Django-based application for storing and reviewing anonymized AFib/cardiology subject records. The app includes authentication, subject CRUD workflows, search and rhythm filtering, dashboard-level summary visualizations, and an ECG upload feature that plots waveform files on each subject detail page.
The original project has been cleaned and modernized so it can run from a fresh environment without the old local virtual environment or SQLite database.
| Feature | Description |
|---|---|
| Authentication | Register, login, and logout workflows |
| Subject dashboard | List anonymized cardiology records |
| Summary visualizations | Display rhythm, age, gender, and electrical-axis distributions with Chart.js |
| Search and filtering | Search by subject label and filter by rhythm |
| CRUD operations | Create, view, update, and delete subject records |
| ECG upload | Upload a .csv or .txt ECG waveform file for each subject |
| ECG waveform visualization | Plot uploaded ECG time-series data on the subject detail page |
| Demo data | Synthetic subject records and a synthetic ECG sample for local testing |
Each subject record can optionally include an uploaded ECG file. The subject detail page reads the file, parses the waveform, and renders it as an interactive line chart.
Supported upload formats:
.csv or .txt
Supported ECG structures:
time,amplitude
0.000,0.01
0.004,0.03
0.008,0.05or one amplitude value per line:
0.01
0.03
0.05
If the uploaded file contains only amplitude values, fill in the subject's ECG sampling rate (Hz) field so the x-axis can be interpreted in seconds.
A synthetic ECG example is included at:
data/demo/sample_ecg.csv
See docs/ECG_UPLOAD_FORMAT.md for details.
afib-cardiology-records-app/
├── afibapp/ # Django project settings and URL config
├── project/ # Main cardiology records app
├── users/ # Authentication-related views/templates
├── templates/ # Shared templates
├── static/ # CSS and images
├── fixtures/ # Synthetic subject records
├── data/demo/ # Synthetic ECG example file
├── docs/ # Upgrade, data model, and ECG format notes
├── scripts/ # Smoke test script
├── manage.py
├── requirements.txt
├── environment.yml
├── .env.example
├── .gitignore
└── README.md
Create and activate a virtual environment:
python -m venv .venvWindows PowerShell:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\.venv\Scripts\Activate.ps1macOS/Linux:
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun migrations:
python manage.py migrateOptional: load synthetic demo subject records:
python manage.py loaddata fixtures/demo_subjects.jsonCreate an admin/superuser account:
python manage.py createsuperuserStart the development server:
python manage.py runserverOpen:
http://127.0.0.1:8000/
- Log in.
- Open the subject dashboard:
http://127.0.0.1:8000/subjects/
- Create or edit a subject.
- Upload an ECG file in the ECG file field.
- Optionally add the ECG sampling rate (Hz).
- Save the subject.
- Open the subject detail page to view the ECG waveform.
For testing, use:
data/demo/sample_ecg.csv
After installing dependencies, run:
python scripts/smoke_test.pyThe test checks the Django project configuration and verifies that migrations are in sync.
The original local SQLite database is not included. This prevents sharing local users, passwords, or subject records. The repository includes only synthetic demo records and a synthetic ECG sample.
Files excluded from version control include:
db.sqlite3
*.sqlite3
media/
.venv/
env/
__pycache__/
staticfiles/
.env
Uploaded ECG files are stored under media/ecg_uploads/ during local development and are not committed to GitHub.
- Python
- Django 5.2 LTS
- SQLite
- Bootstrap 5
- Chart.js
- HTML/CSS
- The app is intended for software demonstration and local development.
- It is not designed for production deployment without additional security, privacy, and compliance work.
- The included subject records and ECG waveform are synthetic.
- The ECG visualization is intended for viewing uploaded waveform data, not automated diagnosis.
- It is not a medical or diagnostic system.
Code in this repository is provided under the MIT License.