From 85e2a1ae85d3c031c62ac19299fccc99ff460a3c Mon Sep 17 00:00:00 2001 From: Yesom Lee Date: Tue, 24 Nov 2026 09:37:31 +0900 Subject: [PATCH 01/41] Add together application issue preparation --- .github/ISSUE_TEMPLATE/together.md | 31 ++++++++++++++ .../src/lib/together-application.test.ts | 35 ++++++++++++++++ apps/landing/src/lib/together-application.ts | 40 +++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/together.md create mode 100644 apps/landing/src/lib/together-application.test.ts create mode 100644 apps/landing/src/lib/together-application.ts diff --git a/.github/ISSUE_TEMPLATE/together.md b/.github/ISSUE_TEMPLATE/together.md new file mode 100644 index 00000000..755e2c04 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/together.md @@ -0,0 +1,31 @@ +--- +name: 함께하는 곳 신청 +about: Braillify를 사용하고 있는 곳을 소개해 주세요. +title: '[함께하는 곳] ' +--- + +신청 내용과 로고는 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 적지 마세요. + +## 함께할 곳 + +- 구분 (기업·기관·학교·단체): +- 이름 (20자 이내): + +## 사용 내용 + +- 사용 상태 (사용 중·도입 준비 중): +- 사용처 이름: +- 사용처 주소 (선택): +- 어디에 어떤 용도로 쓰나요: +- 사용 방식: +- 사용 시작 시기 (선택): + +## 로고 + +밝은 바탕용 PNG 또는 JPG 로고 한 개를 첨부해 주세요 (2MB 이하). + +## 공개 동의 + +- [ ] 이름과 로고를 braillify.kr ‘함께하는 곳’에 게시하는 데 동의합니다. + +GitHub 계정이 없거나 게시 중단을 원하시면 contact@devfive.kr로 알려 주세요. diff --git a/apps/landing/src/lib/together-application.test.ts b/apps/landing/src/lib/together-application.test.ts new file mode 100644 index 00000000..8c2847b6 --- /dev/null +++ b/apps/landing/src/lib/together-application.test.ts @@ -0,0 +1,35 @@ +import { expect, test } from 'bun:test' + +import { applicationIssue } from './together-application' + +const application = { + kind: '학교', + name: '점자 학교', + status: '사용 중', + product: '학습 앱', + url: 'https://example.com/?a=1&b=2', + purpose: '안내 문장을 점자로 보여 줍니다.', + methods: ['Node.js', 'Rust'], + since: '2026년', + consent: true, +} + +test('신청 내용을 GitHub 이슈 주소와 본문에 보존한다', () => { + const result = applicationIssue(application) + const url = new URL(result.url) + expect(url.searchParams.get('title')).toContain(application.name) + expect(url.searchParams.get('body')).toBe(result.body) + expect(result.body).toContain(application.url) + expect(result.body).toContain('Node.js, Rust') + expect(result.copyRequired).toBe(false) +}) + +test('긴 신청 내용은 본문을 복사하도록 짧은 주소를 제공한다', () => { + const result = applicationIssue({ + ...application, + purpose: '가'.repeat(5000), + }) + expect(result.copyRequired).toBe(true) + expect(new URL(result.url).searchParams.has('body')).toBe(false) + expect(result.body).toContain('가'.repeat(5000)) +}) diff --git a/apps/landing/src/lib/together-application.ts b/apps/landing/src/lib/together-application.ts new file mode 100644 index 00000000..9892bcd4 --- /dev/null +++ b/apps/landing/src/lib/together-application.ts @@ -0,0 +1,40 @@ +export interface TogetherApplication { + kind: string + name: string + status: string + product: string + url: string + purpose: string + methods: string[] + since: string + consent: boolean +} + +export function applicationIssue(application: TogetherApplication) { + const body = [ + '## 함께할 곳', + `구분: ${application.kind}`, + `이름: ${application.name}`, + '', + '## 사용 내용', + `사용 상태: ${application.status}`, + `사용처 이름: ${application.product}`, + `사용처 주소: ${application.url || '없음'}`, + `용도: ${application.purpose}`, + `사용 방식: ${application.methods.join(', ')}`, + `사용 시작 시기: ${application.since || '없음'}`, + '', + `공개 동의: ${application.consent ? '동의' : '동의하지 않음'}`, + '', + '## 로고', + '여기에 밝은 바탕용 PNG 또는 JPG 로고 1개(2MB 이하)를 첨부해 주세요.', + ].join('\n') + + const url = new URL('https://github.com/dev-five-git/braillify/issues/new') + url.searchParams.set('title', `[함께하는 곳] ${application.name}`) + url.searchParams.set('body', body) + // shortcut: very long URLs require copying the body, until GitHub accepts larger issue URLs reliably. + const copyRequired = url.toString().length > 1800 + if (copyRequired) url.searchParams.delete('body') + return { body, url: url.toString(), copyRequired } +} From 57ac49561dd0f1fdb8072a75ff3900eafdfe35eb Mon Sep 17 00:00:00 2001 From: Yesom Lee Date: Tue, 24 Nov 2026 09:42:15 +0900 Subject: [PATCH 02/41] Validate and publish reviewed together listings --- .gitignore | 1 + apps/landing/TOGETHER.md | 17 +++++++++++ apps/landing/package.json | 2 +- apps/landing/together.json | 1 + scripts/generate-together.ts | 10 +++++++ scripts/together-data.test.ts | 53 +++++++++++++++++++++++++++++++++++ scripts/together-data.ts | 26 +++++++++++++++++ scripts/together-publish.ts | 19 +++++++++++++ 8 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 apps/landing/TOGETHER.md create mode 100644 apps/landing/together.json create mode 100644 scripts/generate-together.ts create mode 100644 scripts/together-data.test.ts create mode 100644 scripts/together-data.ts create mode 100644 scripts/together-publish.ts diff --git a/.gitignore b/.gitignore index 13354d85..642ac468 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ test_status.json # Paged test results emitted by `cargo test test_by_testcase` and served to the # landing page. Generated artifact, never committed. apps/landing/public/test-status/ +apps/landing/public/together.json .venv __pycache__ .pytest_cache diff --git a/apps/landing/TOGETHER.md b/apps/landing/TOGETHER.md new file mode 100644 index 00000000..360408b2 --- /dev/null +++ b/apps/landing/TOGETHER.md @@ -0,0 +1,17 @@ +# 함께하는 곳 목록 + +신청 이슈는 공개 데이터가 아니다. 실제 사용과 공개 동의, 로고를 확인한 뒤 관리자가 PR에서 `together.json`에 승인 순서대로 항목을 추가한다. 이슈 번호는 중복할 수 없다. + +```json +{ + "issue": 123, + "kind": "학교", + "name": "이름", + "logo": "/images/together/asset-123.png", + "approvedAt": "2026-11-20" +} +``` + +로고는 `public/images/together/`의 밝은 바탕용 PNG 또는 JPG 한 개로, 2 MiB 이하여야 한다. 빌드는 입력의 공개 필드만 `public/together.json`으로 생성하며 잘못된 기록이나 로고는 거부한다. 게시 중단 요청 시 해당 항목을 제거한다. + +인증 이미지와 배지 생성, 배포 완료 후 이슈 답글은 아직 구현되지 않았다. diff --git a/apps/landing/package.json b/apps/landing/package.json index a715f421..6396d817 100644 --- a/apps/landing/package.json +++ b/apps/landing/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build", + "build": "bun ../../scripts/generate-together.ts && next build", "start": "next start" }, "dependencies": { diff --git a/apps/landing/together.json b/apps/landing/together.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/apps/landing/together.json @@ -0,0 +1 @@ +[] diff --git a/scripts/generate-together.ts b/scripts/generate-together.ts new file mode 100644 index 00000000..a4cef12f --- /dev/null +++ b/scripts/generate-together.ts @@ -0,0 +1,10 @@ +import { readFile } from 'node:fs/promises' +import { dirname, join, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' + +import { validatePartners } from './together-data' +import { publishPartners } from './together-publish' + +const landing = resolve(dirname(fileURLToPath(import.meta.url)), '../apps/landing') +const partners = validatePartners(JSON.parse(await readFile(join(landing, 'together.json'), 'utf8'))) +await publishPartners(partners, join(landing, 'public')) diff --git a/scripts/together-data.test.ts b/scripts/together-data.test.ts new file mode 100644 index 00000000..6e6e340f --- /dev/null +++ b/scripts/together-data.test.ts @@ -0,0 +1,53 @@ +import { expect, test } from 'bun:test' +import { mkdir, mkdtemp, readFile, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' + +import { publishPartners } from './together-publish' +import { validatePartners } from './together-data' + +const approved = { + issue: 123, + kind: '학교', + name: '점자 학교', + logo: '/images/together/asset-123.png', + approvedAt: '2026-11-20', +} + +test('승인 순서와 공개 항목을 보존한다', () => { + expect(validatePartners([approved])).toEqual([approved]) + expect(validatePartners([{ ...approved, privateNotes: 'not public' }])).toEqual([approved]) +}) + +test('중복 이슈와 외부 또는 경로 이탈 로고를 거부한다', () => { + expect(() => validatePartners([approved, approved])).toThrow() + expect(() => validatePartners([{ ...approved, logo: 'https://example.com/a.png' }])).toThrow() + expect(() => validatePartners([{ ...approved, logo: '/images/together/../secret.png' }])).toThrow() +}) + +test('유효하지 않은 이름, 구분, 승인 일자와 이슈 번호를 거부한다', () => { + expect(() => validatePartners([{ ...approved, name: '가'.repeat(21) }])).toThrow() + expect(() => validatePartners([{ ...approved, kind: '기타' }])).toThrow() + expect(() => validatePartners([{ ...approved, approvedAt: '2026-02-30' }])).toThrow() + expect(() => validatePartners([{ ...approved, issue: -1 }])).toThrow() +}) + +test('잘못된 로고는 이전 공개 목록을 덮어쓰지 않는다', async () => { + const publicDir = await mkdtemp(join(tmpdir(), 'braillify-together-')) + const output = join(publicDir, 'together.json') + const logos = join(publicDir, 'images', 'together') + await mkdir(logos, { recursive: true }) + await writeFile(join(logos, 'asset-123.png'), 'not a PNG') + await writeFile(output, 'previous') + await expect(publishPartners([approved], publicDir)).rejects.toThrow() + expect(await readFile(output, 'utf8')).toBe('previous') +}) + +test('확인된 로고와 공개 기록으로 목록을 만든다', async () => { + const publicDir = await mkdtemp(join(tmpdir(), 'braillify-together-')) + const logos = join(publicDir, 'images', 'together') + await mkdir(logos, { recursive: true }) + await writeFile(join(logos, 'asset-123.png'), Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])) + await publishPartners([approved], publicDir) + expect(JSON.parse(await readFile(join(publicDir, 'together.json'), 'utf8'))).toEqual([approved]) +}) diff --git a/scripts/together-data.ts b/scripts/together-data.ts new file mode 100644 index 00000000..0f85ae38 --- /dev/null +++ b/scripts/together-data.ts @@ -0,0 +1,26 @@ +export interface Partner { + issue: number + kind: '기업' | '기관' | '학교' | '단체' + name: string + logo: string + approvedAt: string +} + +// Only maintainer-reviewed records belong in this list; an issue is not approval. +export function validatePartners(input: unknown): Partner[] { + if (!Array.isArray(input)) throw new Error('Partner data must be an array') + const seen = new Set() + return input.map((entry: unknown) => { + if (!entry || typeof entry !== 'object' || Array.isArray(entry)) throw new Error('Invalid partner') + const { issue, kind, name, logo, approvedAt } = entry as Record + if (!Number.isSafeInteger(issue) || (issue as number) <= 0 || seen.has(issue as number)) throw new Error('Invalid or duplicate issue') + if (typeof kind !== 'string' || !['기업', '기관', '학교', '단체'].includes(kind)) throw new Error('Invalid kind') + if (typeof name !== 'string' || !name.trim() || Array.from(name).length > 20 || /[\r\n\u0000-\u001f]/.test(name)) throw new Error('Invalid name') + if (typeof logo !== 'string' || !/^\/images\/together\/asset-[a-zA-Z0-9_-]+\.(png|jpg|jpeg)$/.test(logo)) throw new Error('Invalid logo') + if (typeof approvedAt !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(approvedAt)) throw new Error('Invalid approval date') + const date = new Date(`${approvedAt}T00:00:00Z`) + if (Number.isNaN(date.valueOf()) || date.toISOString().slice(0, 10) !== approvedAt) throw new Error('Invalid approval date') + seen.add(issue as number) + return { issue, kind, name, logo, approvedAt } as Partner + }) +} diff --git a/scripts/together-publish.ts b/scripts/together-publish.ts new file mode 100644 index 00000000..6d877d6c --- /dev/null +++ b/scripts/together-publish.ts @@ -0,0 +1,19 @@ +import { readFile, realpath, stat, writeFile } from 'node:fs/promises' +import { join, sep } from 'node:path' + +import type { Partner } from './together-data' + +export async function publishPartners(partners: Partner[], root: string) { + const publicDir = await realpath(root) + for (const partner of partners) { + const filename = await realpath(join(publicDir, partner.logo.slice(1))) + if (!filename.startsWith(`${publicDir}${sep}`)) throw new Error(`Logo is outside public directory: ${partner.logo}`) + const info = await stat(filename) + if (!info.isFile() || info.size > 2 * 1024 * 1024) throw new Error(`Invalid logo size: ${partner.logo}`) + const bytes = await readFile(filename) + const png = bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])) + const jpeg = bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff + if (partner.logo.endsWith('.png') ? !png : !jpeg) throw new Error(`Invalid logo format: ${partner.logo}`) + } + await writeFile(join(publicDir, 'together.json'), `${JSON.stringify(partners)}\n`) +} From c07e627586570e8597c2786bfaf9f0de2edc57bc Mon Sep 17 00:00:00 2001 From: Yesom Lee Date: Tue, 24 Nov 2026 09:47:45 +0900 Subject: [PATCH 03/41] Add together listing and application pages --- apps/landing/src/app/together/Together.tsx | 214 ++++++++++++++ apps/landing/src/app/together/page.tsx | 9 + .../src/app/together/register/Register.tsx | 269 ++++++++++++++++++ .../src/app/together/register/page.tsx | 9 + .../src/components/Header/MobileMenu.tsx | 10 + apps/landing/src/components/Header/Pages.tsx | 24 ++ 6 files changed, 535 insertions(+) create mode 100644 apps/landing/src/app/together/Together.tsx create mode 100644 apps/landing/src/app/together/page.tsx create mode 100644 apps/landing/src/app/together/register/Register.tsx create mode 100644 apps/landing/src/app/together/register/page.tsx diff --git a/apps/landing/src/app/together/Together.tsx b/apps/landing/src/app/together/Together.tsx new file mode 100644 index 00000000..0d74369f --- /dev/null +++ b/apps/landing/src/app/together/Together.tsx @@ -0,0 +1,214 @@ +'use client' + +import { Box, Flex, Text, VStack } from '@devup-ui/react' +import Link from 'next/link' +import { useEffect, useRef, useState } from 'react' + +type Partner = { issue: number; kind: string; name: string; logo: string } +const kinds = ['기업', '기관', '학교', '단체'] + +export default function Together() { + const [kind, setKind] = useState('기업') + const [name, setName] = useState('') + const [braille, setBraille] = useState('') + const [partners, setPartners] = useState(null) + const [failed, setFailed] = useState(false) + const [visible, setVisible] = useState(60) + const [announcement, setAnnouncement] = useState('') + const focusId = useRef(null) + + useEffect(() => { + let cancelled = false + const timeout = setTimeout(() => { + import('braillify') + .then( + (mod) => + !cancelled && + setBraille( + mod.translateToUnicode(name || '이름을 입력하면 여기에 표시돼요'), + ), + ) + .catch(() => { + if (!cancelled) setBraille('') + }) + }, 200) + return () => { + cancelled = true + clearTimeout(timeout) + } + }, [name]) + + useEffect(() => { + fetch('/together.json') + .then((response) => { + if (!response.ok) throw new Error('Failed to load') + return response.json() + }) + .then((data: Partner[]) => { + setPartners(data) + const id = /^#org-(\d+)$/.exec(window.location.hash)?.[1] + const index = data.findIndex((item) => String(item.issue) === id) + if (index >= 0) { + focusId.current = data[index].issue + setVisible(Math.ceil((index + 1) / 60) * 60) + } + }) + .catch(() => setFailed(true)) + }, []) + + useEffect(() => { + if (focusId.current === null) return + const element = document.getElementById(`org-${focusId.current}`) + if (element) { + element.focus() + element.scrollIntoView({ + block: 'center', + behavior: window.matchMedia('(prefers-reduced-motion: reduce)').matches + ? 'instant' + : 'smooth', + }) + focusId.current = null + } + }, [partners, visible]) + + const register = `/together/register?${new URLSearchParams({ kind, name })}` + return ( + + + + 함께하는 곳 + + + 신청하면 실제 사용을 확인한 뒤 이곳에 함께 소개해 드려요. + + + + + 인증 이미지 미리 보기 + + + 승인되면 이 인증 이미지를 GitHub 답글로 보내 드려요. + + + + + + + + setName(e.target.value)} + value={name} + /> + 이 이름으로 신청하기 + + + + + + + 함께하는 곳 + + {partners && partners.length > 10 && ( + 지금 {partners.length}곳이 함께하고 있어요 + )} + {failed ? ( + + 목록을 불러오지 못했어요. 새로고침해 주세요. + + ) : !partners ? ( + 목록을 불러오는 중이에요. + ) : partners.length === 0 ? ( + 첫 번째로 함께해 주세요. + ) : ( + + {partners.slice(0, visible).map((item) => ( + + {item.kind} + + {item.name} + + ))} + + )} + {announcement} + {partners && visible < partners.length && ( + + )} + + + 게시를 멈추고 싶으면 contact@devfive.kr로 알려 주세요. + + + ) +} diff --git a/apps/landing/src/app/together/page.tsx b/apps/landing/src/app/together/page.tsx new file mode 100644 index 00000000..f58c1599 --- /dev/null +++ b/apps/landing/src/app/together/page.tsx @@ -0,0 +1,9 @@ +import type { Metadata } from 'next' + +import Together from './Together' + +export const metadata: Metadata = { title: '함께하는 곳' } + +export default function TogetherPage() { + return +} diff --git a/apps/landing/src/app/together/register/Register.tsx b/apps/landing/src/app/together/register/Register.tsx new file mode 100644 index 00000000..75b1c03f --- /dev/null +++ b/apps/landing/src/app/together/register/Register.tsx @@ -0,0 +1,269 @@ +'use client' + +import { Box, Flex, Text, VStack } from '@devup-ui/react' +import Link from 'next/link' +import { useEffect, useRef, useState } from 'react' + +import { applicationIssue } from '@/lib/together-application' + +const kinds = ['기업', '기관', '학교', '단체'] +const methods = [ + 'Node.js', + 'Python', + 'Rust', + '.NET', + 'C', + 'Go', + 'JVM', + 'Ruby', + 'HTTP API', + '기타', +] + +export default function Register() { + const [kind, setKind] = useState('기업') + const [name, setName] = useState('') + const [selected, setSelected] = useState([]) + const [issue, setIssue] = useState | null>(null) + const [copied, setCopied] = useState(false) + const [error, setError] = useState('') + const dialog = useRef(null) + useEffect(() => { + const params = new URLSearchParams(window.location.search) + const initialKind = params.get('kind') + if (initialKind && kinds.includes(initialKind)) setKind(initialKind) + setName((params.get('name') || '').slice(0, 20)) + }, []) + useEffect(() => { + if (issue) dialog.current?.showModal() + }, [issue]) + + function submit(event: React.FormEvent) { + event.preventDefault() + const data = new FormData(event.currentTarget) + if ( + !name.trim() || + !String(data.get('product')).trim() || + !String(data.get('purpose')).trim() + ) { + setError('필수 항목을 입력해 주세요.') + return + } + if (!selected.length) { + setError('사용 방식을 하나 이상 선택해 주세요.') + document.getElementById('methods')?.focus() + return + } + setError('') + setIssue( + applicationIssue({ + kind, + name, + status: String(data.get('status')), + product: String(data.get('product')), + url: String(data.get('url')), + purpose: String(data.get('purpose')), + methods: selected, + since: String(data.get('since')), + consent: data.has('consent'), + }), + ) + } + return ( + + + + 함께하는 곳 신청 + + + Braillify를 실제로 쓰고 있는 곳을 확인해 ‘함께하는 곳’에 소개합니다. + 신청은 GitHub 이슈로 받고, 매주 한 번 확인해요. + + + + + +
+ 함께할 곳 +

구분 *

+ {kinds.map((value) => ( + + ))} +

+ +

+

+ 로고 파일은 다음 단계 GitHub 화면에서 올려요. PNG·JPG 1개, 2MB + 이하. +

+
+
+ 사용 내용 +

사용 상태 *

+ {['사용 중', '도입 준비 중'].map((value, index) => ( + + ))} +

+ +

+

+ +

+

+