Jiseoup/showmycodePublic
EN|KO
  • 코드
  • 커밋
  • 풀 리퀘스트
← 목록으로

feat: add Vercel Web Analytics and update README (#59)

JiseoupJISUB LIM · 2026년 7월 20일c017084

변경된 파일7개+81 -10

변경된 파일

+81 -10 · 7개

@@ -1,5 +1,6 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
+import { Analytics } from "@vercel/analytics/next";
import "./globals.css";
const inter = Inter({ subsets: ["latin"] });
@@ -28,7 +29,11 @@ export default function RootLayout({ children }: { children: React.ReactNode })
}}
/>
</head>
- <body className={inter.className}>{children}</body>
+ <body className={inter.className}>
+ {children}
+ {/* Vercel Web Analytics — disabled by default so self-hosted deployments ship no tracking script. */}
+ {process.env.ENABLE_ANALYTICS === "true" && <Analytics />}
+ </body>
</html>
);
}
@@ -21,3 +21,8 @@ PULLS_PER_PAGE=10
# Share URL: https://your-domain.com/?token=<SHARE_TOKEN>
# Leave empty to block all access.
SHARE_TOKEN=
+
+# Enable Vercel Web Analytics (set to "true" to load the tracking script).
+# Disabled by default: self-hosted deployments ship no tracking script unless you explicitly enable it.
+# Requires deploying to Vercel with Web Analytics enabled for the project.
+ENABLE_ANALYTICS=
@@ -45,6 +45,7 @@ Copy `.env.example` to `.env.local` and fill in:
- `FILE_TREE_DEPTH` — (optional) File tree default expansion depth (`0` = all collapsed, default `0`)
- `COMMITS_PER_PAGE` — (optional) Commits per page (default `20`, max `100`)
- `PULLS_PER_PAGE` — (optional) Pull requests per page (default `10`, max `100`)
+- `ENABLE_ANALYTICS` — (optional) Set to `true` to load Vercel Web Analytics in the root layout; off by default so self-hosted/forked deployments ship no tracking script
## Project Philosophy
@@ -9,6 +9,7 @@
"version": "1.0.0",
"dependencies": {
"@radix-ui/react-select": "^2.3.2",
+ "@vercel/analytics": "^2.0.1",
"clsx": "^2.1.1",
"lucide-react": "^1.23.0",
"next": "16.2.10",
@@ -2930,6 +2931,48 @@
"win32"
]
},
+ "node_modules/@vercel/analytics": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@vercel/analytics/-/analytics-2.0.1.tgz",
+ "integrity": "sha512-MTQG6V9qQrt1tsDeF+2Uoo5aPjqbVPys1xvnIftXSJYG2SrwXRHnqEvVoYID7BTruDz4lCd2Z7rM1BdkUehk2g==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@remix-run/react": "^2",
+ "@sveltejs/kit": "^1 || ^2",
+ "next": ">= 13",
+ "nuxt": ">= 3",
+ "react": "^18 || ^19 || ^19.0.0-rc",
+ "svelte": ">= 4",
+ "vue": "^3",
+ "vue-router": "^4"
+ },
+ "peerDependenciesMeta": {
+ "@remix-run/react": {
+ "optional": true
+ },
+ "@sveltejs/kit": {
+ "optional": true
+ },
+ "next": {
+ "optional": true
+ },
+ "nuxt": {
+ "optional": true
+ },
+ "react": {
+ "optional": true
+ },
+ "svelte": {
+ "optional": true
+ },
+ "vue": {
+ "optional": true
+ },
+ "vue-router": {
+ "optional": true
+ }
+ }
+ },
"node_modules/acorn": {
"version": "8.16.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz",
@@ -15,6 +15,7 @@
},
"dependencies": {
"@radix-ui/react-select": "^2.3.2",
+ "@vercel/analytics": "^2.0.1",
"clsx": "^2.1.1",
"lucide-react": "^1.23.0",
"next": "16.2.10",
@@ -41,15 +41,16 @@
cp .env.example .env.local
```
-| 변수명 | 설명 | 필수 | 기본값 |
-| ------------------ | ------------------------------------------------ | ---- | ------ |
-| `GITHUB_PAT` | Fine-grained GitHub 개인 액세스 토큰 (읽기 전용) | Yes | — |
-| `GITHUB_OWNER` | GitHub 사용자명 또는 조직명 | Yes | — |
-| `GITHUB_REPOS` | 노출할 레포지토리 이름 (쉼표로 구분) | Yes | — |
-| `FILE_TREE_DEPTH` | 파일 트리 기본 펼침 깊이 (`0` = 모두 접힘) | No | `0` |
-| `COMMITS_PER_PAGE` | 페이지당 커밋 수 (최대 `100`) | No | `20` |
-| `PULLS_PER_PAGE` | 페이지당 풀 리퀘스트 수 (최대 `100`) | No | `10` |
-| `SHARE_TOKEN` | 공유 링크 접근 토큰 (비우면 공개 모드) | No | — |
+| 변수명 | 설명 | 필수 | 기본값 |
+| ------------------ | -------------------------------------------------------------- | ---- | ------ |
+| `GITHUB_PAT` | Fine-grained GitHub 개인 액세스 토큰 (읽기 전용) | Yes | — |
+| `GITHUB_OWNER` | GitHub 사용자명 또는 조직명 | Yes | — |
+| `GITHUB_REPOS` | 노출할 레포지토리 이름 (쉼표로 구분) | Yes | — |
+| `FILE_TREE_DEPTH` | 파일 트리 기본 펼침 깊이 (`0` = 모두 접힘) | No | `0` |
+| `COMMITS_PER_PAGE` | 페이지당 커밋 수 (최대 `100`) | No | `20` |
+| `PULLS_PER_PAGE` | 페이지당 풀 리퀘스트 수 (최대 `100`) | No | `10` |
+| `SHARE_TOKEN` | 공유 링크 접근 토큰 (비우면 공개 모드) | No | — |
+| `ENABLE_ANALYTICS` | Vercel Web Analytics를 불러오려면 `true`로 설정 (기본: 비활성) | No | — |
### 🔑 GitHub PAT 발급 방법
@@ -132,6 +133,13 @@ npm run typecheck # tsc --noEmit 실행
GitHub 응답은 60초 동안 캐시되므로, 뷰어에게 표시되는 데이터는 최대 1분까지 지연될 수 있습니다.
+## 📊 애널리틱스
+
+[라이브 데모](https://showmycode.vercel.app)는 트래픽 측정을 위해 [Vercel Web Analytics](https://vercel.com/docs/analytics)를 사용합니다.
+이는 익명이며 쿠키를 사용하지 않습니다 — 개인정보를 수집하지 않고, 사이트 간 추적도 하지 않습니다.
+
+**애널리틱스는 기본적으로 비활성화되어 있습니다.** 트래킹 스크립트는 `ENABLE_ANALYTICS=true`가 설정된 경우에만 로드되므로, 직접 호스팅하거나 포크한 배포에서는 명시적으로 켜지 않는 한 어떤 트래킹 스크립트도 실리지 않습니다. 본인 배포에서 사용하려면 이 변수를 설정하고 Vercel 대시보드에서 프로젝트의 Web Analytics를 활성화하세요. 메인테이너에게는 어떤 트래픽 데이터도 전송되지 않습니다.
+
## 🤝 기여하기
기여를 환영합니다!
@@ -51,6 +51,7 @@ cp .env.example .env.local
| `COMMITS_PER_PAGE` | Commits per page (max `100`) | No | `20` |
| `PULLS_PER_PAGE` | Pull requests per page (max `100`) | No | `10` |
| `SHARE_TOKEN` | Access token for the share link (leave empty for public mode) | No | — |
+| `ENABLE_ANALYTICS` | Set to `true` to load Vercel Web Analytics (off by default) | No | — |
### 🔑 Creating a GitHub PAT
@@ -133,6 +134,13 @@ Repository access is restricted to the repos listed in `GITHUB_REPOS` — any un
GitHub responses are cached for 60 seconds, so data shown to viewers may be up to one minute stale.
+## 📊 Analytics
+
+The [Live Demo](https://showmycode.vercel.app) uses [Vercel Web Analytics](https://vercel.com/docs/analytics) to measure traffic.
+It is anonymous and cookieless — no personal data is collected and no cross-site tracking is performed.
+
+**Analytics is disabled by default.** The tracking script is only loaded when `ENABLE_ANALYTICS=true` is set, so self-hosted and forked deployments ship no tracking script unless you explicitly enable it. To use it on your own deployment, set the variable and enable Web Analytics for your project in the Vercel dashboard. No traffic data is ever sent to the maintainers.
+
## 🤝 Contributing
Contributions are welcome!