Skip to content
Draft
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
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,14 @@ FLUENT_AI_KEY=fai_dev_admin
# (e.g. POST /tools/greek-room/repeated-words), so leave this empty. If/when
# fluent-ai adopts versioned routing, set this to /api/v1 — no code change needed.
FLUENT_AI_API_PREFIX=

# Cloudflare R2 — audio recording storage
# Account ID found in Cloudflare dashboard → R2 → Overview
R2_ACCOUNT_ID=your-cloudflare-account-id
# S3-compatible Access Key ID generated in R2 → Manage R2 API Tokens
R2_ACCESS_KEY_ID=your-r2-access-key-id
# Corresponding secret access key
R2_SECRET_ACCESS_KEY=your-r2-secret-access-key
# Name of the R2 bucket to store audio recordings
R2_BUCKET_NAME=your-bucket-name

6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ EMAIL_SERVICE_SENDER=no-reply@test.example.com
FRONTEND_URL=http://localhost:5173
FLUENT_AI_URL=http://localhost:8200
FLUENT_AI_KEY=test-only-dummy-fluent-ai-key

# R2 credentials for testing
R2_ACCOUNT_ID=test-r2-account-id
R2_ACCESS_KEY_ID=test-r2-access-key-id
R2_SECRET_ACCESS_KEY=test-r2-secret-access-key
R2_BUCKET_NAME=test-r2-bucket-name
1 change: 1 addition & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import '@/domains/projects/users/project-users.route';
import '@/domains/users/projects/user-projects.route';
import '@/domains/chapter-assignments/presence/chapter-assignments-presence.route';
import '@/domains/ai-tools/ai-tools.route';
import '@/domains/recordings/recordings.route';
configureOpenAPI(server);

export default server;
16 changes: 16 additions & 0 deletions src/db/migrations/0012_add_recordings.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE "recordings" (
"id" serial PRIMARY KEY NOT NULL,
"project_unit_id" integer NOT NULL,
"bible_text_id" integer NOT NULL,
"relative_path" varchar NOT NULL,
"recorded_by_user_id" integer NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "recordings_relative_path_unique" UNIQUE("relative_path")
);
--> statement-breakpoint
ALTER TABLE "recordings" ADD CONSTRAINT "recordings_project_unit_id_project_units_id_fk" FOREIGN KEY ("project_unit_id") REFERENCES "public"."project_units"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "recordings" ADD CONSTRAINT "recordings_bible_text_id_bible_texts_id_fk" FOREIGN KEY ("bible_text_id") REFERENCES "public"."bible_texts"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "recordings" ADD CONSTRAINT "recordings_recorded_by_user_id_users_id_fk" FOREIGN KEY ("recorded_by_user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "idx_recordings_project_unit" ON "recordings" USING btree ("project_unit_id");--> statement-breakpoint
CREATE INDEX "idx_recordings_bible_text" ON "recordings" USING btree ("bible_text_id");--> statement-breakpoint
CREATE INDEX "idx_recordings_user" ON "recordings" USING btree ("recorded_by_user_id");
1 change: 1 addition & 0 deletions src/db/migrations/0013_add_metadata_to_recordings.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "recordings" ADD COLUMN "metadata" jsonb;
Loading