memi-board 0.52.0 → 0.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,17 @@
1
1
  // memi-board 0.23+ Firestore Rules (flat schema)
2
2
  //
3
3
  // memiBoardUsers/{uid}
4
- // memiBoardSettings/{boardId} (구 memiBoards/{id} stub + settings/config 통합)
5
- // memiBoardPosts/{postId}(+ body/main) boardId 필드로 보드 스코핑
6
- // memiBoardComments/{commentId} postId + boardId 필드로 스코핑
7
- // memiBoardLikes/{likeId} 문서ID = `${postId}_${uid}` 또는 `${commentId}_${uid}`
4
+ // memiBoardSettings/{boardId} (merges the old memiBoards/{id} stub + settings/config)
5
+ // memiBoardPosts/{postId}(+ body/main) scoped to a board by the boardId field
6
+ // memiBoardComments/{commentId} scoped by the postId + boardId fields
7
+ // memiBoardLikes/{likeId} doc ID = `${postId}_${uid}` or `${commentId}_${uid}`
8
8
  //
9
- // 카테고리 없음 — boardId 가 곧 예전 category id.
10
- // posts/comments/likes 는 모두 최상위 flat 컬렉션이다. boardId(및 postId)가 이제
11
- // 경로가 아니라 문서 필드이므로, list/collectionGroup 쿼리에 대한 권한 검사가
12
- // 아래처럼 "쿼리의 등호(==) 필터가 그 필드를 상수로 고정해 주는가"에 의존한다.
13
- // (구버전의 collectionGroup carve-out은 더 이상 필요 없음 — memiBoardPosts가
14
- // 진짜 flat 컬렉션이라 작성자 교차조회도 일반 list 쿼리로 동작한다.)
9
+ // No categories — boardId is the old category id.
10
+ // posts/comments/likes are all top-level flat collections. Since boardId (and postId) are now
11
+ // document fields rather than paths, permission checks on list/collectionGroup queries
12
+ // depend, as below, on "whether the query's equality (==) filter pins that field to a constant".
13
+ // (The old collectionGroup carve-out is no longer needed — memiBoardPosts is
14
+ // a true flat collection, so cross-author lookups also work as regular list queries.)
15
15
 
16
16
  rules_version = '2';
17
17
  service cloud.firestore {
@@ -20,9 +20,9 @@ service cloud.firestore {
20
20
  function isSignedIn() {
21
21
  return request.auth != null;
22
22
  }
23
- // 호스트가 다른 기능(예: 손님 대기열)에서 익명 로그인을 켜둔 경우에도
24
- // 게시판 콘텐츠 생성(글/댓글/좋아요)만은 기본적으로 막는다 — 읽기·isSignedIn()
25
- // 전반은 그대로 두고, 아래 3개 create 규칙에서만 이 함수를 쓴다.
23
+ // Even if the host app enables anonymous sign-in for another feature (e.g. a guest queue),
24
+ // block creating board content (posts/comments/likes) by default — reads and isSignedIn()
25
+ // in general are left as-is; this function is used only in the 3 create rules below.
26
26
  function isBoardWriter() {
27
27
  return isSignedIn() && request.auth.token.firebase.sign_in_provider != 'anonymous';
28
28
  }
@@ -48,8 +48,8 @@ service cloud.firestore {
48
48
  function commentPath(commentId) {
49
49
  return /databases/$(database)/documents/memiBoardComments/$(commentId);
50
50
  }
51
- // 댓글 이미지 1장. 없거나 빈 목록도 허용한다. 경로는 그 댓글 폴더만.
52
- // 게시물 컬렉션 이름을 바꾼 호스트는 memiBoardPosts 접두사도 맞춘다.
51
+ // One comment image. A missing or empty list is also allowed. The path must be that comment's folder.
52
+ // Host apps that renamed the posts collection must also update the memiBoardPosts prefix.
53
53
  function commentImageEntryValid(img, postId, commentId) {
54
54
  return img.keys().hasOnly(['name', 'url', 'path', 'size', 'type'])
55
55
  && img.name is string
@@ -82,7 +82,7 @@ service cloud.firestore {
82
82
  && likeId == request.resource.data.postId + '_' + request.auth.uid;
83
83
  }
84
84
  function isValidCommentLike(likeId) {
85
- // 예전 댓글은 boardId 가 없을 수 있다. 스푸핑 방지는 댓글의 postId + 부모 글 boardId 로 한다.
85
+ // Older comments may lack boardId. Spoofing is prevented via the comment's postId + the parent post's boardId.
86
86
  return request.resource.data.keys().hasOnly(['uid', 'postId', 'boardId', 'createdAt', 'commentId', 'target'])
87
87
  && request.resource.data.target == 'comment'
88
88
  && request.resource.data.commentId is string
@@ -115,7 +115,7 @@ service cloud.firestore {
115
115
  return isBoardStaff() && isAllowedStaffForBoard(boardId);
116
116
  }
117
117
  // A visibility transition freezes new content until every listed flag is synchronized.
118
- // 공지(pinned·pinnedAt)는 매니저 전용 갱신으로만 바뀐다 — 작성자의 일반 수정으로는 못 바꾼다.
118
+ // Notices (pinned, pinnedAt) change only via manager-only updates — an author's regular edit cannot change them.
119
119
  function postPinUnchanged() {
120
120
  return request.resource.data.get('pinned', false) == resource.data.get('pinned', false)
121
121
  && request.resource.data.get('pinnedAt', null) == resource.data.get('pinnedAt', null);
@@ -183,8 +183,8 @@ service cloud.firestore {
183
183
  && request.resource.data.viewCount is int
184
184
  && request.resource.data.viewCount == resource.data.get('viewCount', 0) + 1;
185
185
  }
186
- // 답글 생성/삭제 batch에서는 대상이 최상위(root) 댓글이라 작성자가 아닌 사람도
187
- // replyCount만 ±1 갱신할 수 있어야 한다 — 아니면 답글 작성 자체가 배치 전체로 막힌다.
186
+ // In a reply create/delete batch the target is a root comment, so users other than its author
187
+ // must be able to update only replyCount by ±1 — otherwise the whole batch, and thus writing a reply, is blocked.
188
188
  function isReplyCountUpdate() {
189
189
  return isSignedIn()
190
190
  && request.resource.data.diff(resource.data).affectedKeys().hasOnly(['replyCount'])
@@ -193,30 +193,30 @@ service cloud.firestore {
193
193
  && (request.resource.data.replyCount == resource.data.get('replyCount', 0) + 1
194
194
  || request.resource.data.replyCount == resource.data.get('replyCount', 0) - 1);
195
195
  }
196
- // 프로필 이름 변경 시 나를 답글 대상으로 가리키는 다른 사용자의 댓글에
197
- // 복제된 replyToName만 동기화할 수 있다. 작성자/본문 등 다른 필드는 불변이다.
196
+ // When a profile name changes, only the copied replyToName in other users' comments that
197
+ // point to me as the reply target may be synced. Author, body, and other fields are immutable.
198
198
  function isReplyTargetProfileUpdate() {
199
199
  return isSignedIn()
200
200
  && resource.data.replyToUid == request.auth.uid
201
201
  && request.resource.data.replyToUid == resource.data.replyToUid
202
202
  && request.resource.data.diff(resource.data).affectedKeys().hasOnly(['replyToName']);
203
203
  }
204
- // data.boardId 는 이제 문서 필드다. list 쿼리에서 이 함수가 안전하게 평가되려면:
205
- // - isBoardAdmin()/isBoardStaff() 만으로 true 가 되는 경우는 항상 OK
206
- // (request.auth.uid 기준 get() 이라 문서 내용과 무관하게 항상 평가 가능)
207
- // - (isBoardStaff() && canWriteBoard(data.boardId)) 분기에 기대려면 쿼리에
208
- // where('boardId','==', b) 동등 필터가 있어야 한다 — 그래야 Firestore가
209
- // potential result set 전체에 대해 data.boardId == b 임을 정적으로 증명하고
210
- // get(boardSettingsPath(b))를 상수 조회로 안전하게 실행할 수 있다.
204
+ // data.boardId is now a document field. For this function to evaluate safely in list queries:
205
+ // - cases where isBoardAdmin()/isBoardStaff() alone yields true are always OK
206
+ // (get() is keyed on request.auth.uid, so it can always be evaluated regardless of document contents)
207
+ // - relying on the (isBoardStaff() && canWriteBoard(data.boardId)) branch requires the query
208
+ // to have a where('boardId','==', b) equality filter — that lets Firestore
209
+ // statically prove data.boardId == b for the entire potential result set and
210
+ // safely run get(boardSettingsPath(b)) as a constant lookup.
211
211
  function canReadPost(data) {
212
212
  return (data.get('listed', true) == true && data.isPublished == true)
213
213
  || (isSignedIn() && request.auth.uid == data.authorUid)
214
214
  || isBoardAdmin()
215
215
  || isBoardManager(data.boardId);
216
216
  }
217
- // 공개 피드·작성자 댓글 목록은 listed==true 동등 필터로 숨김 보드 댓글을 뺀다.
218
- // 글 상세(postId == 상수)에서는 부모 글을 읽을 수 있으면 숨김 댓글도 볼 수 있다
219
- // (작성자가 담당 스태프 메모를 읽는 경우).
217
+ // Public feeds and author comment lists exclude hidden-board comments with a listed==true equality filter.
218
+ // On a post detail (postId == constant), anyone who can read the parent post can also see hidden comments
219
+ // (e.g. an author reading an assigned staff memo).
220
220
  function canReadComment(data) {
221
221
  return data.listed == true
222
222
  || (isSignedIn() && request.auth.uid == data.authorUid)
@@ -231,7 +231,7 @@ service cloud.firestore {
231
231
  }
232
232
 
233
233
  match /memiBoardUsers/{uid} {
234
- // 이메일 말고는 다 공개 프로필 정보다 — 이메일은 private 서브컬렉션에 따로 둔다.
234
+ // Everything except email is public profile info — email is kept separately in a private subcollection.
235
235
  allow read: if true;
236
236
  allow create: if isSignedIn()
237
237
  && request.auth.uid == uid
@@ -252,7 +252,7 @@ service cloud.firestore {
252
252
  && request.resource.data.moderationBlockCount
253
253
  == resource.data.get('moderationBlockCount', 0) + 1
254
254
  )
255
- // 0.47.0 이하: 호출 전에 확정 횟수를 1 올린다.
255
+ // 0.47.0 and earlier: increment the confirmed count by 1 before the call.
256
256
  || (
257
257
  request.resource.data.diff(resource.data).affectedKeys()
258
258
  .hasOnly(['aiWritingCount', 'aiWritingWindowAt', 'updatedAt'])
@@ -273,8 +273,8 @@ service cloud.firestore {
273
273
  )
274
274
  )
275
275
  )
276
- // 0.47.1+: 호출 전에 예약만 잡고, 성공하면 확정한다. 실패하면 예약만 내린다.
277
- // 확정 횟수는 1씩만 오르고, 클라이언트가 내리지는 못한다.
276
+ // 0.47.1+: only reserve before the call, and confirm on success. On failure, only release the reservation.
277
+ // The confirmed count only increases by 1 at a time and cannot be decreased by the client.
278
278
  || (
279
279
  request.resource.data.diff(resource.data).affectedKeys()
280
280
  .hasOnly(['aiWritingPending', 'updatedAt'])
@@ -312,23 +312,23 @@ service cloud.firestore {
312
312
  )
313
313
  ));
314
314
 
315
- // 다른 작성자에 대해 나만 보는 개인 메모. 문서 ID가 targetUid라 대상당 하나로
316
- // 고정된다. 관리자도 못 읽는다 — 모더레이션용이 아니라 순전히 본인 참고용이다.
315
+ // A private memo about another author, visible only to me. The doc ID is targetUid, so there is
316
+ // one per target. Even admins can't read it — it is purely for personal reference, not moderation.
317
317
  match /memos/{targetUid} {
318
318
  allow read, write: if isSignedIn() && request.auth.uid == uid;
319
319
  }
320
320
 
321
- // 이메일만 담는 비공개 서브컬렉션. 본인·관리자만 읽고 쓴다.
321
+ // Private subcollection holding only the email. Only the user and admins can read and write.
322
322
  match /private/{docId} {
323
323
  allow read, write: if isBoardAdmin() || (isSignedIn() && request.auth.uid == uid);
324
324
  }
325
325
  }
326
326
 
327
- // 구 memiBoards/{boardId} stub + memiBoards/{boardId}/settings/config 를 하나로 합친
328
- // 캐노니컬 보드 문서. 목록 렌더링과 권한 검사가 모두 이 문서 하나만 읽는다.
329
- // create/update 를 분리한 이유: update 쪽 staff 분기가 resource.data(기존 값)를
330
- // 참조하는데, create 시점엔 resource 가 없어 하나로 묶으면 그 분기가 에러로
331
- // 평가된다 — 구버전에서도 보드 생성 자체는 admin 전용이었으므로 분리가 자연스럽다.
327
+ // Canonical board document that merges the old memiBoards/{boardId} stub + memiBoards/{boardId}/settings/config.
328
+ // List rendering and permission checks both read only this one document.
329
+ // Why create/update are separate: the staff branch on update references resource.data (existing values),
330
+ // but resource doesn't exist at create time, so combining them would make that branch evaluate
331
+ // to an error — board creation was admin-only in older versions too, so separating them is natural.
332
332
  match /memiBoardSettings/{boardId} {
333
333
  allow read: if true;
334
334
  allow create: if isBoardAdmin();
@@ -381,17 +381,17 @@ service cloud.firestore {
381
381
  }
382
382
 
383
383
  match /memiBoardComments/{commentId} {
384
- // 공개 피드·작성자 댓글 목록은 where('listed','==',true) 로 숨김 보드 댓글을 걸러낸다.
385
- // 글 상세는 postId 동등 필터라 부모 글 권한(canReadPost)으로 숨김 댓글도 읽을 수 있다.
384
+ // Public feeds and author comment lists filter out hidden-board comments with where('listed','==',true).
385
+ // Post details use a postId equality filter, so hidden comments can be read via parent post permission (canReadPost).
386
386
  allow read: if isBoardAdmin() || canReadComment(resource.data);
387
387
 
388
388
  allow create: if isBoardWriter()
389
389
  && request.resource.data.postId is string
390
390
  && request.resource.data.boardId is string
391
- // boardId 는 클라이언트가 채우는 비정규화 필드라 스푸핑이 가능하다 — 실제
392
- // 글의 boardId 와 다른 값을 채워 commentWriteRole 이 느슨한 다른 보드인 척
393
- // canWriteBoardComment() 를 우회하는 것을 막기 위해 부모 글의 실제 boardId 와
394
- // 일치하는지 확인한다(비용: 댓글 생성마다 get() 1회 추가).
391
+ // boardId is a denormalized field filled by the client and can be spoofed — to prevent
392
+ // filling in a value different from the post's actual boardId to pose as another board with a looser
393
+ // commentWriteRole and bypass canWriteBoardComment(), check that it matches the parent post's actual
394
+ // boardId (cost: one extra get() per comment creation).
395
395
  && get(postPath(request.resource.data.postId)).data.boardId == request.resource.data.boardId
396
396
  && canWriteBoardComment(request.resource.data.boardId)
397
397
  && boardWritesOpen(request.resource.data.boardId)
@@ -422,14 +422,14 @@ service cloud.firestore {
422
422
  );
423
423
  }
424
424
 
425
- // 좋아요 토글 전용 flat 컬렉션. 문서ID 관례 = `${targetId}_{uid}`.
426
- // 본문: target 없음(레거시) + 필드 4개. 댓글: target=='comment' + commentId.
425
+ // Flat collection for like toggles only. Doc ID convention = `${targetId}_{uid}`.
426
+ // Body: no target (legacy) + 4 fields. Comments: target=='comment' + commentId.
427
427
  match /memiBoardLikes/{likeId} {
428
- // "내가 좋아요한 글/댓글" 쿼리(where uid==auth.uid)를 위해 자기 것은 항상 읽을 수
429
- // 있다. 그 외에는 구버전과 동일하게, 해당 글을 읽을 수 있는 사람이면 (uid를
430
- // 정확히 알고 있는 한) 개별 get() 으로 좋아요 여부를 확인할 수 있다.
431
- // resource == null: 아직 없는 좋아요 문서를 트랜잭션에서 get 할 때.
432
- // 없으면 resource.data 접근이 실패해 일반 사용자의 첫 좋아요가 permission-denied 가 된다.
428
+ // Your own likes are always readable for the "posts/comments I liked" query (where uid==auth.uid).
429
+ // Otherwise, as in older versions, anyone who can read the post can check whether a like exists
430
+ // via an individual get() (as long as they know the exact uid).
431
+ // resource == null: when getting a like document that doesn't exist yet in a transaction.
432
+ // Without this, accessing resource.data fails and a regular user's first like becomes permission-denied.
433
433
  allow read: if isBoardAdmin() || (isSignedIn() && resource == null)
434
434
  || (isSignedIn() && request.auth.uid == resource.data.uid)
435
435
  || (resource != null && canReadPost(get(postPath(resource.data.postId)).data))
@@ -444,10 +444,10 @@ service cloud.firestore {
444
444
 
445
445
  allow delete: if isBoardAdmin() || (isSignedIn()
446
446
  && (request.auth.uid == resource.data.uid || canDeleteLike(resource.data)));
447
- // update 는 허용하지 않음 — 토글은 항상 create-or-delete.
447
+ // update is not allowed — toggling is always create-or-delete.
448
448
  }
449
449
 
450
- // 글 신고. 문서ID = `${postId}_{uid}`. 내용은 본인·스태프만 읽는다.
450
+ // Post reports. Doc ID = `${postId}_{uid}`. Contents are readable only by the reporter and staff.
451
451
  match /memiBoardReports/{reportId} {
452
452
  allow read: if (isSignedIn() && resource == null)
453
453
  || (isSignedIn() && request.auth.uid == resource.data.uid)
@@ -1,35 +1,35 @@
1
- # 다른 Nuxt 사이트에 memi-board 붙이기
1
+ # Adding memi-board to another Nuxt site
2
2
 
3
- [README](../README.md) · [국제화·번역 설정](internationalization.md) · [Firebase 준비](firebase-setup.md) · [역할 마이그레이션](roles-migration.md)
3
+ [README](../README.md) · [Internationalization and translation](internationalization.md) · [Firebase setup](firebase-setup.md) · [Role migration](roles-migration.md)
4
4
 
5
- 기존 Nuxt 4 사이트에 게시판을 추가하는 절차다. 호스트는 라우트·Firebase 연결·규칙 배포를 맡고, memi-board는 게시판 컴포넌트와 composable을 제공한다.
5
+ This is the procedure for adding a board to an existing Nuxt 4 site. The host app handles routes, the Firebase connection, and rule deployment; memi-board provides the board components and composables.
6
6
 
7
- 이 가이드의 국제화·번역 옵션을 포함한 예제는 **memi-board 0.47.0 이상**을 기준으로 한다. 필수 버전은 Nuxt 4+, Nuxt UI 4+, Firebase 12+, Vue 3.5+, VueFire 3.2+다.
7
+ The examples in this guide, including the internationalization and translation options, assume **memi-board 0.47.0 or later**. Required versions: Nuxt 4+, Nuxt UI 4+, Firebase 12+, Vue 3.5+, VueFire 3.2+.
8
8
 
9
- ## 1. 필요한 패키지 설치
9
+ ## 1. Install the required packages
10
10
 
11
- 기존 Nuxt 프로젝트 루트에서 실행한다.
11
+ Run this from the root of the existing Nuxt project.
12
12
 
13
13
  ```bash
14
14
  pnpm add memi-board@^0.47.0 @nuxt/ui nuxt-vuefire vuefire firebase
15
15
  ```
16
16
 
17
- `dayjs`는 필요 없다. `@nuxtjs/i18n`은 사이트 언어 전환이 필요할 때만 추가한다. 운영 환경에서는 검증한 memi-board 버전과 lockfile을 함께 관리한다.
17
+ `dayjs` is not needed. Add `@nuxtjs/i18n` only if you need site language switching. In production, manage the memi-board version you have verified together with the lockfile.
18
18
 
19
- ## 2. 먼저 언어 모드 선택
19
+ ## 2. Choose a language mode first
20
20
 
21
- | 서비스 | 권장 설정 |
21
+ | Service | Recommended setting |
22
22
  |---|---|
23
- | 한국어 공지·문의 게시판 | `locale: 'ko', i18n: { enabled: false }` |
24
- | 영어 전용 서비스 | `locale: 'en', i18n: { enabled: false }` |
25
- | 여러 언어 UI, 글은 작성한 언어 그대로 | `i18n: { enabled: true }, translation: { enabled: false }` |
26
- | 게시판·글을 여러 언어로 번역 | `i18n: { enabled: true }, translation: { enabled: true }` |
23
+ | Korean notice/inquiry board | `locale: 'ko', i18n: { enabled: false }` |
24
+ | English-only service | `locale: 'en', i18n: { enabled: false }` |
25
+ | Multilingual UI, posts shown in the language they were written in | `i18n: { enabled: true }, translation: { enabled: false }` |
26
+ | Translate boards and posts into multiple languages | `i18n: { enabled: true }, translation: { enabled: true }` |
27
27
 
28
- 설정 생략 시 두 기능은 모두 활성 상태다. 콘텐츠 번역에는 별도 Firebase AI Logic 준비가 필요하다. 자동 번역 토글의 의미와 실제 실행 시점은 [국제화·번역 설정](internationalization.md#4-번역이-실행되고-저장되는-시점)을 참고한다.
28
+ If omitted, both features are enabled. Content translation requires a separate Firebase AI Logic setup. For what the auto-translate toggle means and when translation actually runs, see [Internationalization and translation](internationalization.md#4-when-translations-run-and-are-saved).
29
29
 
30
- ## 3. Nuxt 설정에 병합
30
+ ## 3. Merge into the Nuxt config
31
31
 
32
- 다음은 **한국어 전용, AI 검열·번역을 사용하지 않는** 시작 예제다. 기존 `modules`, CSS, Firebase 설정이 있다면 중복 등록하지 않고 병합한다.
32
+ The following is a starter example that is **Korean-only and does not use AI moderation or translation**. If you already have `modules`, CSS, or Firebase settings, merge rather than registering them twice.
33
33
 
34
34
  ```ts
35
35
  // nuxt.config.ts
@@ -53,7 +53,7 @@ export default defineNuxtConfig({
53
53
  auth: { providers: ['google'] },
54
54
  moderation: { enabled: false },
55
55
  seo: {
56
- siteName: '우리 서비스',
56
+ siteName: 'Our Service',
57
57
  siteUrl: 'https://example.com',
58
58
  basePath: '/board'
59
59
  }
@@ -68,11 +68,11 @@ export default defineNuxtConfig({
68
68
  })
69
69
  ```
70
70
 
71
- Firebase 값은 **붙일 사이트의 Firebase 웹 앱 설정**을 사용한다. Storage 버킷 이름은 프로젝트마다 다를 수 있으므로 콘솔의 실제 값을 복사한다. Firebase Admin 서비스 계정 키는 클라이언트 설정에 넣지 않는다.
71
+ Use the **Firebase web app config of the site you are adding the board to**. Storage bucket names can differ per project, so copy the actual value from the console. Never put a Firebase Admin service account key in the client config.
72
72
 
73
- 공개 목록·상세의 SSR은 유지한다. `moderation.enabled: false`여도 기본 로컬 금칙어 검사는 남는다. 글쓰기 AI의 교정·문장 다듬기까지 끄는 옵션은 이 설정에 포함되지 않으며, 해당 AI 메뉴를 사용할 때는 AI Logic 연결이 필요하다.
73
+ Keep SSR for the public list and detail pages. Even with `moderation.enabled: false`, the default local banned-word check remains. This config has no option to turn off the writing AI's proofreading and sentence polishing; using those AI menus requires an AI Logic connection.
74
74
 
75
- ## 4. 스타일과 UApp 연결
75
+ ## 4. Styles and UApp
76
76
 
77
77
  ```css
78
78
  /* app/assets/css/main.css */
@@ -81,10 +81,10 @@ Firebase 값은 **붙일 사이트의 Firebase 웹 앱 설정**을 사용한다.
81
81
  @source "../../../node_modules/memi-board/dist/runtime/components";
82
82
  ```
83
83
 
84
- `@source`는 위 CSS 파일 위치 기준이다. 다른 위치의 CSS를 쓰면 상대 경로를 맞춘다.
84
+ `@source` is relative to the CSS file above. If your CSS lives elsewhere, adjust the relative path.
85
85
 
86
86
  ```vue
87
- <!-- app/app.vue — 기존 UApp이 있으면 중복으로 감싸지 않는다 -->
87
+ <!-- app/app.vue — if a UApp already exists, don't wrap it twice -->
88
88
  <template>
89
89
  <UApp>
90
90
  <NuxtPage />
@@ -92,13 +92,13 @@ Firebase 값은 **붙일 사이트의 Firebase 웹 앱 설정**을 사용한다.
92
92
  </template>
93
93
  ```
94
94
 
95
- 레이아웃이 있는 앱은 기존 `<NuxtLayout>` 구조를 유지한다. Nuxt UI 내부 문구도 한국어로 고정하려면 `@nuxt/ui/locale`의 `ko`를 가져와 `<UApp :locale="ko">`로 지정한다. 호스트의 `<html lang>`도 호스트가 관리한다.
95
+ Apps with layouts keep their existing `<NuxtLayout>` structure. To also pin Nuxt UI's internal strings to Korean, import `ko` from `@nuxt/ui/locale` and set `<UApp :locale="ko">`. The host app also manages `<html lang>`.
96
96
 
97
- ## 5. 규칙과 인덱스 배포
97
+ ## 5. Deploy rules and indexes
98
98
 
99
- 설치한 패키지의 다음 파일을 호스트 파일에 병합한다. 이미 사이트 규칙이 있으면 통째로 덮어쓰지 않는다.
99
+ Merge the following files from the installed package into the host files. If the site already has rules, don't overwrite them wholesale.
100
100
 
101
- | 패키지 파일 | 호스트 파일 |
101
+ | Package file | Host file |
102
102
  |---|---|
103
103
  | `node_modules/memi-board/docs/firestore.rules.example` | `firestore.rules` |
104
104
  | `node_modules/memi-board/docs/storage.rules.example` | `storage.rules` |
@@ -108,9 +108,9 @@ Firebase 값은 **붙일 사이트의 Firebase 웹 앱 설정**을 사용한다.
108
108
  firebase deploy --only firestore:rules,storage,firestore:indexes
109
109
  ```
110
110
 
111
- `firebase.json`에는 인덱스 파일 경로도 지정한다. Storage 규칙의 배포 버킷은 `vuefire.config.storageBucket`과 같아야 한다. 교차 서비스 IAM까지 포함한 최초 설정은 [Firebase 준비](firebase-setup.md#storage-규칙의-firestore-조회-권한-부모호스트-프로젝트-필수-설정)를 따른다. npm 설치나 웹 사이트 배포가 이 배포를 대신하지 않는다.
111
+ Also set the index file path in `firebase.json`. The bucket the Storage rules are deployed to must match `vuefire.config.storageBucket`. For the initial setup including cross-service IAM, follow [Firebase setup](firebase-setup.md#firestore-read-access-for-storage-rules-required-host-app-setup). Installing from npm or deploying the website does not replace this deployment.
112
112
 
113
- ## 6. 관리 페이지와 첫 게시판 만들기
113
+ ## 6. Admin pages and the first board
114
114
 
115
115
  ```vue
116
116
  <!-- app/pages/board-settings.vue -->
@@ -126,30 +126,30 @@ firebase deploy --only firestore:rules,storage,firestore:indexes
126
126
  </template>
127
127
  ```
128
128
 
129
- 로그인용 페이지 또는 기존 계정 화면에 `<MemiBoardSignIn />`을 추가하고 다음 순서로 초기화한다.
129
+ Add `<MemiBoardSignIn />` to a sign-in page or an existing account screen, then initialize in this order:
130
130
 
131
- 1. Firebase Authentication에서 Google 공급자와 사이트의 승인 도메인을 설정한다.
132
- 2. 게시판의 로그인 컴포넌트로 로그인하여 `memiBoardUsers/{uid}` 문서를 생성한다. 호스트 자체 로그인만 있다면 게시판 인증 composable도 사용하는 페이지를 연다.
133
- 3. 신뢰할 수 있는 Firebase Console 또는 서버 Admin SDK에서 해당 문서의 `role`을 `owner`로 지정한다.
134
- 4. 새로고침 또는 재로그인 후 `/board-settings`에서 ID가 `free`인 게시판을 만든다.
135
- 5. `/board-users`에서 필요한 계정에 `admin`·`manager`·`staff` 역할을 지정하고, 게시판 설정에서 담당자를 배정한다.
131
+ 1. In Firebase Authentication, set up the Google provider and the site's authorized domains.
132
+ 2. Sign in with the board's sign-in component to create the `memiBoardUsers/{uid}` document. If the host only has its own sign-in, open a page that also uses the board auth composable.
133
+ 3. From the trusted Firebase Console or a server-side Admin SDK, set that document's `role` to `owner`.
134
+ 4. After reloading or signing in again, create a board with the ID `free` in `/board-settings`.
135
+ 5. In `/board-users`, assign `admin`/`manager`/`staff` roles to the accounts that need them, and assign people in the board settings.
136
136
 
137
- 최초 owner 지정과 owner 이관은 클라이언트 역할 선택 메뉴로 하지 않는다. 라우트 접근 가드는 호스트가 추가하고, 실제 데이터 접근은 규칙으로 검증한다. 호스트 로그인 공급자가 게시판과 같은 Firebase Auth를 사용하면 로그인 상태를 공유한다.
137
+ Don't assign the first owner or transfer ownership through the client role selection menu. The host app adds route access guards, and actual data access is enforced by the rules. If the host's sign-in provider uses the same Firebase Auth as the board, sign-in state is shared.
138
138
 
139
- ## 7. 목록·글쓰기·상세 페이지 연결
139
+ ## 7. List, new post, and detail pages
140
140
 
141
- 권장 경로는 다음과 같다. `/board` 시작 페이지와 메뉴 구성은 호스트가 정한다.
141
+ The recommended paths are below. The host app decides the `/board` landing page and menu structure.
142
142
 
143
- | 파일 | URL | 전달할 값 |
143
+ | File | URL | Value to pass |
144
144
  |---|---|---|
145
- | `app/pages/board/[boardId]/index.vue` | `/board/free` | 목록의 `boardId` |
146
- | `app/pages/board/[boardId]/new.vue` | `/board/free/new` | 에디터의 `boardId` |
147
- | `app/pages/board/[boardId]/[slug]/index.vue` | `/board/free/글-slug` | slug를 조회해 상세의 `postId`로 전달 |
148
- | `app/pages/board/[boardId]/[slug]/edit.vue` | `/board/free/글-slug/edit` | 조회한 문서 ID로 기존 글 수정 |
145
+ | `app/pages/board/[boardId]/index.vue` | `/board/free` | `boardId` for the list |
146
+ | `app/pages/board/[boardId]/new.vue` | `/board/free/new` | `boardId` for the editor |
147
+ | `app/pages/board/[boardId]/[slug]/index.vue` | `/board/free/post-slug` | Look up the slug and pass it as the detail's `postId` |
148
+ | `app/pages/board/[boardId]/[slug]/edit.vue` | `/board/free/post-slug/edit` | Edit the existing post using the looked-up document ID |
149
149
 
150
- 컴포넌트는 Nuxt 모듈이 auto-import한다. `memi-board/runtime`에서는 composable과 타입만 가져온다.
150
+ Components are auto-imported by the Nuxt module. Import only composables and types from `memi-board/runtime`.
151
151
 
152
- ### 목록
152
+ ### List
153
153
 
154
154
  ```vue
155
155
  <!-- app/pages/board/[boardId]/index.vue -->
@@ -178,9 +178,9 @@ await useMemiBoardListSeo({
178
178
  </template>
179
179
  ```
180
180
 
181
- `canWrite`는 이 예제에서 로그인 여부만 표시한다. 스태프·관리자 전용 게시판을 운영할 때는 호스트가 게시판의 `writeRole`과 담당 범위까지 검사해 버튼을 표시한다. 규칙은 버튼 표시와 별개로 쓰기 권한을 검증한다.
181
+ In this example, `canWrite` only reflects whether the user is signed in. For staff- or admin-only boards, the host app should also check the board's `writeRole` and assignment scope before showing the button. The rules enforce write permission independently of whether the button is shown.
182
182
 
183
- 목록의 개별 설정 링크에 대응하는 페이지도 만든다.
183
+ Also create the page that the list's per-board settings link points to.
184
184
 
185
185
  ```vue
186
186
  <!-- app/pages/board-settings/[boardId].vue -->
@@ -194,9 +194,9 @@ const boardId = computed(() => String(route.params.boardId || ''))
194
194
  </template>
195
195
  ```
196
196
 
197
- 매니저 진입 가드에는 `canConfigureBoard(boardId)`, 콘텐츠 관리에는 `canManageBoard(boardId)`를 사용한다. 설정 컴포넌트도 기본적으로 담당 설정 권한을 확인한다.
197
+ Use `canConfigureBoard(boardId)` for the manager entry guard and `canManageBoard(boardId)` for content management. The settings component also checks assigned settings permission by default.
198
198
 
199
- ### 글쓰기
199
+ ### New post
200
200
 
201
201
  ```vue
202
202
  <!-- app/pages/board/[boardId]/new.vue -->
@@ -217,9 +217,9 @@ const { isSignedIn, rolePending } = useMemiBoardAuth()
217
217
  </template>
218
218
  ```
219
219
 
220
- 새 글의 `saved` 이벤트는 **slug**를 전달하고, 기존 글 수정의 `saved` 이벤트는 **Firestore 문서 ID**를 전달한다. 수정 페이지에서는 현재 URL의 slug를 유지해 이동한다. 에디터 자체가 게시판 언어를 적용한다.
220
+ For a new post, the `saved` event passes the **slug**; when editing an existing post, the `saved` event passes the **Firestore document ID**. On the edit page, navigate using the slug from the current URL. The editor itself applies the board language.
221
221
 
222
- ### 상세
222
+ ### Detail
223
223
 
224
224
  ```vue
225
225
  <!-- app/pages/board/[boardId]/[slug]/index.vue -->
@@ -262,14 +262,14 @@ watch([boardId, slug, seoPost], async ([board, currentSlug, seo], _, onCleanup)
262
262
  @list="navigateTo(`/board/${boardId}`)"
263
263
  @deleted="navigateTo(`/board/${boardId}`)"
264
264
  />
265
- <p v-else-if="unavailable">글을 찾을 수 없거나 접근 권한이 없습니다.</p>
266
- <p v-else>불러오는 중입니다.</p>
265
+ <p v-else-if="unavailable">The post could not be found, or you don't have access to it.</p>
266
+ <p v-else>Loading...</p>
267
267
  </template>
268
268
  ```
269
269
 
270
- `boardId`는 게시판 설정의 문서 ID, `postId`는 글의 Firestore 문서 ID, `slug`는 URL용 문자열이다. 상세 컴포넌트에 slug를 `postId`로 넣지 않는다. 위 예제의 공개 상세 SEO는 SSR에서 채우고, 초안·비공개 글의 클라이언트 조회는 로그인과 규칙을 따른다.
270
+ `boardId` is the board settings document ID, `postId` is the post's Firestore document ID, and `slug` is the URL string. Don't pass the slug as `postId` to the detail component. In the example above, SEO for public detail pages is filled in during SSR, while client-side reads of drafts and private posts follow sign-in state and the rules.
271
271
 
272
- ### 수정
272
+ ### Edit
273
273
 
274
274
  ```vue
275
275
  <!-- app/pages/board/[boardId]/[slug]/edit.vue -->
@@ -294,7 +294,7 @@ watch([boardId, slug, rolePending, isSignedIn], async (_, __, onCleanup) => {
294
294
  if (active && post && canEdit(post)) postId.value = post.id ?? ''
295
295
  }
296
296
  catch {
297
- // 로그인·권한·삭제·네트워크 오류는 아래 안내로 처리한다.
297
+ // Sign-in, permission, deletion, and network errors are handled by the message below.
298
298
  }
299
299
  }
300
300
  if (active) pending.value = false
@@ -302,7 +302,7 @@ watch([boardId, slug, rolePending, isSignedIn], async (_, __, onCleanup) => {
302
302
  </script>
303
303
 
304
304
  <template>
305
- <p v-if="pending">불러오는 중입니다.</p>
305
+ <p v-if="pending">Loading...</p>
306
306
  <MemiBoardEditor
307
307
  v-else-if="postId"
308
308
  :board-id="boardId"
@@ -310,46 +310,46 @@ watch([boardId, slug, rolePending, isSignedIn], async (_, __, onCleanup) => {
310
310
  @saved="navigateTo(`/board/${boardId}/${encodeURIComponent(slug)}`)"
311
311
  @cancel="navigateTo(`/board/${boardId}/${encodeURIComponent(slug)}`)"
312
312
  />
313
- <p v-else>글을 수정할 권한이 없거나 글을 불러올 수 없습니다.</p>
313
+ <p v-else>You don't have permission to edit this post, or it could not be loaded.</p>
314
314
  </template>
315
315
  ```
316
316
 
317
- ## 8. 역할과 서비스별 명칭
317
+ ## 8. Roles and service-specific labels
318
318
 
319
319
  ```ts
320
320
  memiBoard: {
321
321
  roleLabels: {
322
- user: '고객',
323
- staff: '매장 직원',
324
- manager: '매장 관리자',
325
- admin: '운영자',
326
- owner: '최고 관리자'
322
+ user: 'Customer',
323
+ staff: 'Store staff',
324
+ manager: 'Store manager',
325
+ admin: 'Operator',
326
+ owner: 'Super admin'
327
327
  }
328
328
  }
329
329
  ```
330
330
 
331
- 명칭만 바뀌며 권한은 바뀌지 않는다. manager는 `allowedManagerUids`에 지정된 게시판의 설정과 스태프 배정을 관리한다. 매장·조직과 게시판을 연결하고 담당 배정을 동기화하는 책임은 호스트에 있다. 단순히 같은 Firebase 프로젝트를 쓴다고 조직 경계가 자동 생성되지 않는다.
331
+ Only the labels change; permissions do not. A manager manages the settings and staff assignments of the boards listed in `allowedManagerUids`. Linking stores or organizations to boards and syncing assignments is the host app's responsibility. Simply sharing the same Firebase project does not automatically create organization boundaries.
332
332
 
333
- 기본 파일 규칙에서 타인 파일 수정·삭제는 전역 admin/owner만 가능하다. 담당 staff/manager의 타인 첨부 교체·파일 정리가 필요한 서비스는 게시판 배정을 확인하는 서버 API를 추가한다. 기본 Storage 파일 읽기는 공개다. 자세한 역할과 기존 데이터 이전은 [역할 마이그레이션](roles-migration.md)을 따른다.
333
+ Under the default file rules, only a global admin/owner can modify or delete other users' files. Services where assigned staff/managers need to replace other users' attachments or clean up files should add a server API that verifies board assignment. Default Storage file reads are public. For details on roles and migrating existing data, see [Role migration](roles-migration.md).
334
334
 
335
- ## 9. 다른 사이트와 데이터 분리
335
+ ## 9. Separating data from other sites
336
336
 
337
- | 구성 | 권장 방식 |
337
+ | Setup | Recommended approach |
338
338
  |---|---|
339
- | 별도 서비스·고객사의 독립 사이트 | Firebase 프로젝트도 분리 |
340
- | 같은 서비스 안의 여러 게시판 | 같은 프로젝트에서 `boardId`로 구분 |
341
- | 한 프로젝트 안의 다른 컬렉션 이름 | `postsCollection` 등 6개 이름과 Rules·Storage 경로·인덱스를 함께 변경 |
339
+ | Independent sites for separate services or clients | Use separate Firebase projects too |
340
+ | Multiple boards within the same service | Same project, separated by `boardId` |
341
+ | Different collection names within one project | Change the 6 names such as `postsCollection` together with the rules, Storage paths, and indexes |
342
342
 
343
- 컬렉션 이름 옵션이나 `boardId`는 그 자체로 보안상 테넌트 격리를 보장하지 않는다. 기본 admin/owner는 해당 컬렉션 전체를 관리한다. 서로 독립적인 관리자 경계가 필요하면 프로젝트를 분리하거나 호스트 규칙을 별도로 설계한다.
343
+ Collection name options and `boardId` do not, by themselves, guarantee tenant isolation for security. The default admin/owner manages the entire collection. If you need independent administrator boundaries, separate the projects or design the host rules separately.
344
344
 
345
- ## 10. 배포 전 확인
345
+ ## 10. Pre-deployment checklist
346
346
 
347
- - 첫 owner 로그인 후 `free` 게시판 생성, 일반 계정의 글·댓글 작성 확인.
348
- - 글 상세 진입 시 slug → 문서 ID 조회와 원문 표시 확인.
349
- - 선택한 국제화 모드에 맞춰 언어·번역 UI와 AI 요청 여부 확인.
350
- - 매니저가 담당 게시판만 설정하고 다른 게시판은 설정하지 못하는지 확인.
351
- - 앱이 쓰는 Storage 버킷에 규칙이 배포됐는지 확인하고 이미지·첨부 업로드 확인.
352
- - 공개 목록·상세 HTML에 OG 메타가 있는지 배포 URL에서 확인.
353
- - 웹 앱 배포와 Firebase 규칙·인덱스 배포 결과를 각각 확인.
347
+ - After the first owner signs in, verify creating the `free` board and writing posts and comments with a regular account.
348
+ - On opening a post detail page, verify the slug → document ID lookup and that the original content is shown.
349
+ - Verify the language/translation UI and whether AI requests are made, according to the chosen internationalization mode.
350
+ - Verify that a manager can configure only their assigned boards and not other boards.
351
+ - Verify that the rules are deployed to the Storage bucket the app uses, and test image and attachment uploads.
352
+ - Verify on the deployed URL that the public list and detail HTML contain OG meta tags.
353
+ - Check the results of the web app deployment and the Firebase rules/index deployment separately.
354
354
 
355
- 오류별 확인 순서는 [README 문제 해결](../README.md#문제-해결)을 참고한다.
355
+ For troubleshooting steps by error, see [README Troubleshooting](../README.md#troubleshooting).