feat(V2-2): Supabase 인프라 — 스키마 + RLS + Edge Functions 스캐폴딩
server/supabase/ 신규 디렉토리:
config.toml — Supabase CLI 설정
- 프로젝트 ID, DB 포트, auth providers (Google/GitHub/Apple),
edge_runtime, functions.*.verify_jwt 설정
migrations/ (PostgreSQL DDL, 시간순):
- 20260409000001_initial_schema.sql
12개 테이블: profiles, teams, team_members, meetings,
meeting_memos, meeting_documents, transcripts, history,
dictionary, memo_tags, daily_usage, subscriptions
+ 인덱스 + FK CASCADE + transcripts Realtime publication
- 20260409000002_rls_policies.sql
개인 전용(history/dictionary): user_id = auth.uid()
팀 공유(meetings 등): 본인 OR team_members 조회 subquery
daily_usage: 읽기만, 쓰기는 service_role RPC
- 20260409000003_auth_triggers.sql
handle_new_user — auth.users INSERT → profiles+subscriptions 자동 생성
moddatetime — 8개 테이블 updated_at 자동 갱신
increment_daily_usage — service_role 전용 쿼터 RPC
- 20260409000004_storage_buckets.sql
audio/exports/avatars 3개 버킷 + 경로 기반 접근 정책
(파일 경로가 {user_id}/...로 시작해야 쓰기 허용)
functions/ (Deno/TypeScript Edge Functions):
- _shared/cors.ts — CORS 헤더 + preflight 핸들러
- _shared/auth.ts — requireUser (JWT 검증 + User 반환)
- _shared/quota.ts — 티어별 쿼터 체크 + consume + service role client
- stt-proxy/index.ts — Google Cloud STT 래퍼 스캐폴딩
placeholder 응답, 실제 API 호출 코드는 주석으로 포함
- llm-proxy/index.ts — Anthropic Messages API 래퍼 스캐폴딩
티어별 허용 모델 정책 (free=Haiku, pro=Sonnet, team=Opus)
설계 문서:
- docs/v2/phase-V2-2.md — 상세 설계 (스키마/RLS/Edge Functions/Realtime)
- docs/v2/phase-V2-2-setup.md — 사용자 액션 가이드 (Supabase 계정/
OAuth 등록/CLI/배포/검증)
apps/desktop typecheck 통과 (server/는 Deno 런타임이라 별도).
실제 Supabase 프로젝트 배포는 사용자가 phase-V2-2-setup.md 따라 수행.
This commit is contained in:
parent
3524e958ba
commit
97eb886ec3
16 changed files with 1675 additions and 8 deletions
88
server/supabase/config.toml
Normal file
88
server/supabase/config.toml
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
# Supabase 프로젝트 설정 (로컬 개발 + CLI 기준)
|
||||
# 공식 문서: https://supabase.com/docs/guides/cli/config
|
||||
|
||||
project_id = "d3ro-voice"
|
||||
|
||||
[api]
|
||||
enabled = true
|
||||
port = 54321
|
||||
schemas = ["public", "storage"]
|
||||
extra_search_path = ["public", "extensions"]
|
||||
max_rows = 1000
|
||||
|
||||
[db]
|
||||
port = 54322
|
||||
shadow_port = 54320
|
||||
major_version = 15
|
||||
|
||||
[db.pooler]
|
||||
enabled = false
|
||||
|
||||
[db.seed]
|
||||
enabled = true
|
||||
sql_paths = ["./seed.sql"]
|
||||
|
||||
[realtime]
|
||||
enabled = true
|
||||
|
||||
[studio]
|
||||
enabled = true
|
||||
port = 54323
|
||||
|
||||
[inbucket]
|
||||
enabled = true
|
||||
port = 54324
|
||||
|
||||
[storage]
|
||||
enabled = true
|
||||
file_size_limit = "50MiB"
|
||||
|
||||
[auth]
|
||||
enabled = true
|
||||
site_url = "http://localhost:5173"
|
||||
additional_redirect_urls = [
|
||||
"http://localhost:5173",
|
||||
"https://d3ro.dev",
|
||||
"d3ro-voice://auth-callback"
|
||||
]
|
||||
jwt_expiry = 3600
|
||||
enable_signup = true
|
||||
enable_anonymous_sign_ins = false
|
||||
enable_manual_linking = false
|
||||
|
||||
[auth.email]
|
||||
enable_signup = true
|
||||
double_confirm_changes = true
|
||||
enable_confirmations = false
|
||||
|
||||
[auth.external.google]
|
||||
enabled = true
|
||||
client_id = "env(GOOGLE_OAUTH_CLIENT_ID)"
|
||||
secret = "env(GOOGLE_OAUTH_SECRET)"
|
||||
redirect_uri = ""
|
||||
|
||||
[auth.external.github]
|
||||
enabled = true
|
||||
client_id = "env(GITHUB_OAUTH_CLIENT_ID)"
|
||||
secret = "env(GITHUB_OAUTH_SECRET)"
|
||||
redirect_uri = ""
|
||||
|
||||
[auth.external.apple]
|
||||
enabled = true
|
||||
client_id = "env(APPLE_OAUTH_CLIENT_ID)"
|
||||
secret = "env(APPLE_OAUTH_SECRET)"
|
||||
redirect_uri = ""
|
||||
|
||||
[edge_runtime]
|
||||
enabled = true
|
||||
policy = "per_worker"
|
||||
inspector_port = 8083
|
||||
|
||||
[functions.stt-proxy]
|
||||
verify_jwt = true
|
||||
|
||||
[functions.llm-proxy]
|
||||
verify_jwt = true
|
||||
|
||||
[analytics]
|
||||
enabled = false
|
||||
Loading…
Add table
Add a link
Reference in a new issue