feat(V2-6/V2-7/V2-8): Mobile MVP + Teams + Billing 스캐폴딩
V2-6 — Mobile (Expo) MVP
- apps/mobile/ 신규, npm workspace에서 제외 (Expo deps 부담 회피)
- Expo SDK 51 + Expo Router + AsyncStorage Supabase 클라이언트
- 화면: index/login/(tabs)/{meetings,record,profile}
- expo-av로 녹음 → Edge Function stt-proxy 호출
- expo-web-browser + expo-linking으로 OAuth 콜백 처리
- README에 setup/EAS build 가이드
- 루트 package.json workspaces를 명시 나열로 변경 (apps/mobile 제외)
V2-7 — 팀 기능 (Web)
- apps/web/src/app/teams/page.tsx — 가입한 팀 카드 그리드
- apps/web/src/app/teams/[id]/page.tsx — 멤버 + 공유 회의
- components/teams/create-team-form.tsx — 팀 생성 + owner 자동 team_members
- components/teams/invite-member-form.tsx — user_id 직접 초대 (V2-7b에서 invite flow)
- Sidebar에 Teams/Billing 메뉴 + 아이콘
- ko.json에 nav.teams/nav.billing 키 추가
- V2-2 teams/team_members RLS 활용
V2-8 — 결제 스캐폴딩
- apps/web/src/app/billing/page.tsx — Free/Pro/Team 가격표 + 현재 구독
- components/billing/checkout-button.tsx — Edge Function 호출 후 redirect
- server/supabase/functions/stripe-checkout/index.ts:
- JWT 인증 -> 기존 customer 조회/생성 -> Checkout Session 생성
- subscriptions 테이블에 customer_id upsert
- server/supabase/functions/stripe-webhook/index.ts:
- checkout.session.completed -> subscriptions tier=pro/team active
- customer.subscription.updated/created -> status/period 업데이트
- customer.subscription.deleted -> tier=free, status=canceled
- signature 검증은 placeholder (V2-8b에서 정식)
- server/supabase/config.toml에 두 함수 등록 (webhook verify_jwt=false)
검증:
- desktop typecheck OK (회귀 없음)
- web typecheck OK
- web next build OK (11 라우트)
- mobile은 별도 install 필요 (workspace 제외)
memory/project_status.md 갱신 — V2 마스터 플랜 전 페이즈 로컬 완료
This commit is contained in:
parent
5c0f4a2b98
commit
61a96b3e9b
136 changed files with 2641 additions and 251 deletions
122
apps/web/src/app/teams/page.tsx
Normal file
122
apps/web/src/app/teams/page.tsx
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
// apps/web/src/app/teams/page.tsx
|
||||
// 팀 리스트 + 새 팀 생성
|
||||
|
||||
import Link from 'next/link'
|
||||
import { redirect } from 'next/navigation'
|
||||
import { Box, Grid } from '@mui/material'
|
||||
import { MetalCard, PhosphorText } from '@d3ro/ui/components/ds'
|
||||
import { d3roPalette, typoSx } from '@d3ro/ui/theme'
|
||||
import { Sidebar } from '@/components/layout/sidebar'
|
||||
import { CreateTeamForm } from '@/components/teams/create-team-form'
|
||||
import {
|
||||
getSupabaseServerClient,
|
||||
isSupabaseConfiguredServer
|
||||
} from '@/lib/supabase-server'
|
||||
|
||||
interface TeamRow {
|
||||
id: string
|
||||
name: string
|
||||
avatar_url: string | null
|
||||
member_count: number
|
||||
role: 'owner' | 'admin' | 'member'
|
||||
}
|
||||
|
||||
async function loadTeams(): Promise<TeamRow[]> {
|
||||
try {
|
||||
const supabase = await getSupabaseServerClient()
|
||||
// 본인이 속한 팀만 RLS로 자동 필터링
|
||||
const { data: members } = await supabase
|
||||
.from('team_members')
|
||||
.select('team_id, role, teams(id, name, avatar_url)')
|
||||
|
||||
if (!members) return []
|
||||
|
||||
return members
|
||||
.filter((m: { teams: unknown }) => m.teams !== null)
|
||||
.map((m: { team_id: string; role: string; teams: unknown }) => {
|
||||
const team = m.teams as { id: string; name: string; avatar_url: string | null }
|
||||
return {
|
||||
id: team.id,
|
||||
name: team.name,
|
||||
avatar_url: team.avatar_url,
|
||||
member_count: 0, // count는 별도 query 필요. MVP에서는 생략
|
||||
role: m.role as 'owner' | 'admin' | 'member'
|
||||
}
|
||||
})
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
export default async function TeamsPage(): Promise<React.ReactElement> {
|
||||
if (!isSupabaseConfiguredServer()) {
|
||||
redirect('/login')
|
||||
}
|
||||
const supabase = await getSupabaseServerClient()
|
||||
const {
|
||||
data: { user }
|
||||
} = await supabase.auth.getUser()
|
||||
if (!user) redirect('/login')
|
||||
|
||||
const teams = await loadTeams()
|
||||
|
||||
return (
|
||||
<Box sx={{ display: 'flex', minHeight: '100vh' }}>
|
||||
<Sidebar />
|
||||
<Box component="main" sx={{ flex: 1, p: 4, overflow: 'auto' }}>
|
||||
<PhosphorText variant="title" sx={{ mb: 4 }}>
|
||||
TEAMS
|
||||
</PhosphorText>
|
||||
|
||||
<Box sx={{ mb: 4 }}>
|
||||
<CreateTeamForm />
|
||||
</Box>
|
||||
|
||||
{teams.length === 0 ? (
|
||||
<MetalCard sx={{ p: 6, textAlign: 'center', color: d3roPalette.text.muted }}>
|
||||
아직 가입한 팀이 없습니다. 위에서 새 팀을 만들거나, 다른 팀에서 초대를 받아보세요.
|
||||
</MetalCard>
|
||||
) : (
|
||||
<Grid container spacing={3}>
|
||||
{teams.map((team) => (
|
||||
<Grid size={{ xs: 12, sm: 6, md: 4 }} key={team.id}>
|
||||
<Link href={`/teams/${team.id}`} style={{ textDecoration: 'none' }}>
|
||||
<MetalCard sx={{ p: 3, cursor: 'pointer', minHeight: 140 }}>
|
||||
<Box sx={{ ...typoSx('value'), color: d3roPalette.text.primary, mb: 1 }}>
|
||||
{team.name}
|
||||
</Box>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'inline-block',
|
||||
px: 1.5,
|
||||
py: 0.5,
|
||||
borderRadius: 1,
|
||||
fontSize: 10,
|
||||
bgcolor:
|
||||
team.role === 'owner'
|
||||
? d3roPalette.tag.purpleBg
|
||||
: team.role === 'admin'
|
||||
? d3roPalette.tag.orangeBg
|
||||
: d3roPalette.tag.greenBg,
|
||||
color:
|
||||
team.role === 'owner'
|
||||
? d3roPalette.tag.purple
|
||||
: team.role === 'admin'
|
||||
? d3roPalette.tag.orange
|
||||
: d3roPalette.tag.green,
|
||||
textTransform: 'uppercase',
|
||||
letterSpacing: '1px'
|
||||
}}
|
||||
>
|
||||
{team.role}
|
||||
</Box>
|
||||
</MetalCard>
|
||||
</Link>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue