M0: repo scaffold, backend skeleton, schema + migrations, dev compose, docs

- Apache-2.0, README, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, issue templates
- FastAPI app with /api/v1 healthz/readyz/system-status (honest AI disclosure)
- Full SQLAlchemy schema (users, devices, refresh tokens, recordings, assets,
  upload sessions, transcripts, summaries, tags, jobs, exports) + Alembic
  migrations incl. Postgres FTS tsvector columns
- Settings via SHONAR_* env only; local + S3 storage abstraction with
  path-traversal-safe keys
- Docker dev compose (postgres+redis, 127.0.0.1-only); CI workflow; scripts
- shared/openapi.json contract generated from app
This commit is contained in:
avi 2026-09-08 13:23:45 -05:00
commit 5fab96e824
46 changed files with 3616 additions and 0 deletions

28
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,28 @@
---
name: Bug report
about: Something is broken
title: "[BUG] "
labels: bug
---
## Describe the bug
## Component
- [ ] Android app
- [ ] Backend API
- [ ] Worker / AI pipeline
- [ ] Deployment / Docker
## To Reproduce
Steps to reproduce the behavior.
## Expected behavior
## Environment
- Server version (`GET /api/v1/system/status`):
- Android version / device:
- Storage backend: local / s3
- AI providers configured: none / transcription / llm
## Logs
Redact any personal data before pasting logs.

View file

@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for S.H.O.N.A.R.
title: "[FEATURE] "
labels: enhancement
---
## Problem statement
What problem does this solve for self-hosted voice-note users?
## Proposed solution
## Privacy impact
Does this touch audio, transcripts, network, or AI providers? How is it
disclosed to the user?
## Alternatives considered

49
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,49 @@
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
backend:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: shonar
POSTGRES_PASSWORD: shonar
POSTGRES_DB: shonar_test
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U shonar"
--health-interval 5s --health-timeout 3s --health-retries 10
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: uv venv .venv && uv pip install -e ".[dev]"
- run: .venv/bin/ruff check .
- run: .venv/bin/pytest
env:
SHONAR_TEST_DATABASE_URL: postgresql+asyncpg://shonar:shonar@localhost:5432/shonar_test
android:
runs-on: ubuntu-latest
defaults:
run:
working-directory: android
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with: { distribution: temurin, java-version: 17 }
- uses: gradle/actions/setup-gradle@v4
# Skipped until the Android project lands (M3).
- run: ./gradlew test assembleDebug --no-daemon
continue-on-error: ${{ !hashFiles('android/**/build.gradle.kts') }}