Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.git
.gitignore
.github
.venv
.env
.agents
.pytest_cache
.ruff_cache
__pycache__
*.pyc
*.egg-info
.sessioniq-data
data
logs
docs
tests
web/node_modules
web/dist*
docker-compose.yml
Dockerfile
.dockerignore
20 changes: 20 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Keep LF endings in build and source files; CRLF breaks shell-style
# entrypoints and container builds.
*.py text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.mjs text eol=lf
*.json text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.sh text eol=lf
*.conf text eol=lf
*.css text eol=lf
*.html text eol=lf
Dockerfile text eol=lf
.dockerignore text eol=lf

*.png binary
*.ico binary
*.wav binary
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
backend:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- run: pip install -e ".[dev]"
- run: ruff check .
- run: pytest -q

frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
with:
version: 12.4.2
- uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm test
- run: pnpm build

docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: docker build -t sessioniq-api .
- run: docker build -t sessioniq-dashboard ./web
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
__pycache__/
.pytest_cache/
.ruff_cache/
.streamlit/secrets.toml
data/
data/uploads/
data/chroma/
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.12-slim

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
SESSIONIQ_HOST=0.0.0.0 \
SESSIONIQ_PORT=8000

WORKDIR /app

COPY pyproject.toml README.md ./
COPY src ./src
RUN pip install --no-cache-dir .

COPY scripts ./scripts

EXPOSE 8000

HEALTHCHECK --interval=30s --timeout=5s --start-period=40s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health', timeout=3)"

CMD ["python", "scripts/run_api.py"]
39 changes: 32 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
Upload audio, MIDI, and notes — SessionIQ analyzes them, organizes them into albums and songs,
and answers questions about your work **with citations to the exact files it used.**

[![CI](https://github.com/xfznprojects/sessioniq/actions/workflows/ci.yml/badge.svg)](https://github.com/xfznprojects/sessioniq/actions/workflows/ci.yml)
[![Python](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python&logoColor=white)](https://www.python.org/)
[![FastAPI](https://img.shields.io/badge/FastAPI-009688?logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com/)
[![React](https://img.shields.io/badge/React-19-61DAFB?logo=react&logoColor=black)](https://react.dev/)
[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-4-38BDF8?logo=tailwindcss&logoColor=white)](https://tailwindcss.com/)
[![Tests](https://img.shields.io/badge/tests-143_passing-2ea44f)](#-testing)
[![Ruff](https://img.shields.io/badge/lint-ruff-261230?logo=ruff&logoColor=white)](https://docs.astral.sh/ruff/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

Expand Down Expand Up @@ -244,10 +244,31 @@ flowchart LR
**Backend** — Python 3.11+, FastAPI, Uvicorn, Pydantic, librosa, numpy, soundfile, pretty_midi/mido,
scipy (K-weighted loudness), ChromaDB (optional), faster-whisper (optional), OpenAI SDK (OpenAI **or** Ollama).
**Frontend** — React 19, TypeScript, Vite, Tailwind CSS 4, TanStack Table, Recharts, HTML audio, Framer Motion, Lucide, music-metadata.
**Quality** — Pytest, Ruff, `tsc` + Vite build.
**Quality** — Pytest, Ruff, `tsc` + Vite build, GitHub Actions, Docker Compose.

## 🚀 Quick start

### Docker

```bash
docker compose up --build
```

Then open **http://localhost:8080**. nginx serves the dashboard and proxies `/api` and `/uploads`
to the API container, so the browser sees a single origin. Runtime data lives in the
`sessioniq-data` volume and survives restarts.

To load the generated demo content:

```bash
docker compose exec api python scripts/seed_demo.py
docker compose restart api
```

To enable a model, uncomment `env_file: .env` in `docker-compose.yml` and put your keys in `.env`.

### Local toolchain

**Prerequisites:** Python 3.11+ and Node 22.18+ (Node 24 recommended).

> Paths below use Windows/PowerShell. On macOS/Linux use `.venv/bin/python` instead of `.venv\Scripts\python.exe`.
Expand All @@ -264,8 +285,9 @@ python -m venv .venv

```powershell
cd web
npm install # or: pnpm install
npm run dev # → http://127.0.0.1:5173
corepack enable # provides the pnpm version pinned in package.json
pnpm install
pnpm dev # → http://127.0.0.1:5173
```

**3. Load demo content** (optional, recommended)
Expand Down Expand Up @@ -321,7 +343,7 @@ sessioniq/
├── web/src/ # React + TypeScript dashboard
│ ├── App.tsx
│ └── components/ # Sidebar, Chat, Inspector, Insights, Studio, Pipeline, Player…
├── scripts/ # run_api, run_streamlit, seed_demo, check_local_ai
├── scripts/ # run_api, seed_demo, check_local_ai
└── tests/ # pytest suite
```

Expand All @@ -330,10 +352,13 @@ sessioniq/
```powershell
.\.venv\Scripts\python.exe -m pytest # 143 passing
.\.venv\Scripts\python.exe -m ruff check .
cd web; npm test # frontend scope regressions
npm run build # tsc + vite build
cd web; pnpm test # frontend scope regressions
pnpm build # tsc + vite build
```

CI runs the backend suite on Python 3.11 and 3.12, the frontend tests and build, and both
container images on every push and pull request.

## 🗄️ Library persistence and recovery

SessionIQ is a single-process local app by design. Writes are serialized within the API process and
Expand Down
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
services:
api:
build: .
environment:
SESSIONIQ_HOST: 0.0.0.0
SESSIONIQ_PORT: "8000"
volumes:
- sessioniq-data:/app/.sessioniq-data
ports:
- "8000:8000"
restart: unless-stopped
# Uncomment to pass model credentials through from a local .env file.
# env_file: .env

web:
build: ./web
depends_on:
api:
condition: service_healthy
ports:
- "8080:80"
restart: unless-stopped

volumes:
sessioniq-data:
Loading