🪻 distributed transcription service thistle.dunkirk.sh
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add transcription database schema and dependencies

- Add transcriptions table with status tracking
- Add eventsource-client for SSE support
- Configure environment variables for Whisper service
- Ignore uploads directory and .env file

💘 Generated with Crush

Co-Authored-By: Crush <crush@charm.land>

+35 -1
+4
.env.example
··· 1 + # Whisper Service URL 2 + # URL of the faster-whisper transcription server 3 + # See README for setup instructions 4 + WHISPER_SERVICE_URL=http://localhost:8000
+2
.gitignore
··· 1 1 node_modules 2 2 thistle.db 3 + uploads/ 4 + .env
+5
bun.lock
··· 4 4 "": { 5 5 "name": "inky", 6 6 "dependencies": { 7 + "eventsource-client": "^1.2.0", 7 8 "lit": "^3.3.1", 8 9 "ua-parser-js": "^2.0.6", 9 10 }, ··· 52 53 "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], 53 54 54 55 "detect-europe-js": ["detect-europe-js@0.1.2", "", {}, "sha512-lgdERlL3u0aUdHocoouzT10d9I89VVhk0qNRmll7mXdGfJT1/wqZ2ZLA4oJAjeACPY5fT1wsbq2AT+GkuInsow=="], 56 + 57 + "eventsource-client": ["eventsource-client@1.2.0", "", { "dependencies": { "eventsource-parser": "^3.0.0" } }, "sha512-kDI75RSzO3TwyG/K9w1ap8XwqSPcwi6jaMkNulfVeZmSeUM49U8kUzk1s+vKNt0tGrXgK47i+620Yasn1ccFiw=="], 58 + 59 + "eventsource-parser": ["eventsource-parser@3.0.6", "", {}, "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg=="], 55 60 56 61 "is-standalone-pwa": ["is-standalone-pwa@0.1.1", "", {}, "sha512-9Cbovsa52vNQCjdXOzeQq5CnCbAcRk05aU62K20WO372NrTv0NxibLFCK6lQ4/iZEFdEA3p3t2VNOn8AJ53F5g=="], 57 62
+1
package.json
··· 14 14 "typescript": "^5" 15 15 }, 16 16 "dependencies": { 17 + "eventsource-client": "^1.2.0", 17 18 "lit": "^3.3.1", 18 19 "ua-parser-js": "^2.0.6" 19 20 }
+23 -1
src/db/schema.ts
··· 13 13 const migrations = [ 14 14 { 15 15 version: 1, 16 - name: "Complete schema", 16 + name: "Complete user schema", 17 17 sql: ` 18 18 CREATE TABLE IF NOT EXISTS users ( 19 19 id INTEGER PRIMARY KEY AUTOINCREMENT, ··· 36 36 37 37 CREATE INDEX IF NOT EXISTS idx_sessions_user_id ON sessions(user_id); 38 38 CREATE INDEX IF NOT EXISTS idx_sessions_expires_at ON sessions(expires_at); 39 + `, 40 + }, 41 + { 42 + version: 2, 43 + name: "Add transcriptions table", 44 + sql: ` 45 + CREATE TABLE IF NOT EXISTS transcriptions ( 46 + id TEXT PRIMARY KEY, 47 + user_id INTEGER NOT NULL, 48 + filename TEXT NOT NULL, 49 + original_filename TEXT NOT NULL, 50 + status TEXT NOT NULL DEFAULT 'uploading', 51 + progress INTEGER NOT NULL DEFAULT 0, 52 + transcript TEXT, 53 + error_message TEXT, 54 + created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), 55 + updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), 56 + FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE 57 + ); 58 + 59 + CREATE INDEX IF NOT EXISTS idx_transcriptions_user_id ON transcriptions(user_id); 60 + CREATE INDEX IF NOT EXISTS idx_transcriptions_status ON transcriptions(status); 39 61 `, 40 62 }, 41 63 ];