Skip to content

Commit 7086cdc

Browse files
authored
Merge pull request #543 from solid-connection/feat/university-ssg-multizone
feat: 대학 정보 멀티존 분리
2 parents 071430a + c0da730 commit 7086cdc

533 files changed

Lines changed: 16389 additions & 769 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
outputs:
1515
web: ${{ steps.filter.outputs.web }}
16+
university-web: ${{ steps.filter.outputs.university-web }}
1617
admin: ${{ steps.filter.outputs.admin }}
1718
root: ${{ steps.filter.outputs.root }}
1819
steps:
@@ -26,12 +27,15 @@ jobs:
2627
filters: |
2728
web:
2829
- 'apps/web/**'
30+
university-web:
31+
- 'apps/university-web/**'
2932
admin:
3033
- 'apps/admin/**'
3134
root:
3235
- 'package.json'
3336
- 'pnpm-lock.yaml'
3437
- 'pnpm-workspace.yaml'
38+
- 'scripts/**'
3539
- 'turbo.json'
3640
- '.github/workflows/**'
3741
@@ -62,6 +66,33 @@ jobs:
6266
- name: Run checks (lint & typecheck)
6367
run: pnpm --filter @solid-connect/web run ci:check
6468

69+
# University Web 앱 품질 체크
70+
university-web-quality-check:
71+
name: University Web - Quality Check
72+
runs-on: ubuntu-latest
73+
needs: detect-changes
74+
if: needs.detect-changes.outputs.university-web == 'true' || needs.detect-changes.outputs.root == 'true'
75+
steps:
76+
- name: Checkout repository
77+
uses: actions/checkout@v4
78+
79+
- name: Install pnpm
80+
uses: pnpm/action-setup@v3
81+
with:
82+
version: 9
83+
84+
- name: Setup Node.js
85+
uses: actions/setup-node@v4
86+
with:
87+
node-version: "22.x"
88+
cache: "pnpm"
89+
90+
- name: Install dependencies
91+
run: pnpm install --frozen-lockfile
92+
93+
- name: Run checks (lint & typecheck)
94+
run: pnpm --filter @solid-connect/university-web run ci:check
95+
6596
# Admin 앱 품질 체크
6697
admin-quality-check:
6798
name: Admin - Quality Check
@@ -120,6 +151,39 @@ jobs:
120151
run: pnpm --filter @solid-connect/web run build
121152
env:
122153
NODE_ENV: production
154+
UNIVERSITY_WEB_DOMAIN: https://university-web.ci.local
155+
156+
# University Web 앱 빌드
157+
university-web-build:
158+
name: University Web - Build
159+
runs-on: ubuntu-latest
160+
needs: [detect-changes, university-web-quality-check]
161+
if: |
162+
always() &&
163+
(needs.detect-changes.outputs.university-web == 'true' || needs.detect-changes.outputs.root == 'true') &&
164+
needs.university-web-quality-check.result == 'success'
165+
steps:
166+
- name: Checkout repository
167+
uses: actions/checkout@v4
168+
169+
- name: Install pnpm
170+
uses: pnpm/action-setup@v3
171+
with:
172+
version: 9
173+
174+
- name: Setup Node.js
175+
uses: actions/setup-node@v4
176+
with:
177+
node-version: "22.x"
178+
cache: "pnpm"
179+
180+
- name: Install dependencies
181+
run: pnpm install --frozen-lockfile
182+
183+
- name: Build university web application
184+
run: pnpm --filter @solid-connect/university-web run build
185+
env:
186+
NODE_ENV: production
123187

124188
# Admin 앱 빌드
125189
admin-build:

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ on:
77
workflow_dispatch:
88
inputs:
99
target:
10-
description: "Promote target"
10+
description: "Promote target (both keeps the legacy web+admin selection)"
1111
required: true
1212
default: "both"
1313
type: choice
1414
options:
15+
- all
1516
- both
1617
- web
1718
- admin
19+
- university
1820
force_redeploy:
1921
description: "When up to date, skip divergence and print manual redeploy guidance"
2022
required: true
@@ -71,6 +73,12 @@ jobs:
7173
admin)
7274
RELEASE_BRANCHES="release-admin"
7375
;;
76+
university)
77+
RELEASE_BRANCHES="release-university"
78+
;;
79+
all)
80+
RELEASE_BRANCHES="release-web release-admin release-university"
81+
;;
7482
both)
7583
RELEASE_BRANCHES="release-web release-admin"
7684
;;

.husky/pre-commit

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@ echo "🔍 Running CI parity checks before commit..."
22

33
CHANGED_FILES=$(git diff --cached --name-only)
44
RUN_WEB=0
5+
RUN_UNIVERSITY_WEB=0
56
RUN_ADMIN=0
67

78
for FILE in $CHANGED_FILES; do
89
case "$FILE" in
910
apps/web/*)
1011
RUN_WEB=1
1112
;;
13+
apps/university-web/*)
14+
RUN_UNIVERSITY_WEB=1
15+
;;
1216
apps/admin/*)
1317
RUN_ADMIN=1
1418
;;
15-
package.json|pnpm-lock.yaml|pnpm-workspace.yaml|turbo.json|.github/workflows/*)
19+
package.json|pnpm-lock.yaml|pnpm-workspace.yaml|scripts/*|turbo.json|.github/workflows/*)
1620
RUN_WEB=1
21+
RUN_UNIVERSITY_WEB=1
1722
RUN_ADMIN=1
1823
;;
1924
esac
@@ -23,11 +28,15 @@ if [ "$RUN_WEB" -eq 1 ]; then
2328
pnpm --filter @solid-connect/web run ci:check
2429
fi
2530

31+
if [ "$RUN_UNIVERSITY_WEB" -eq 1 ]; then
32+
pnpm --filter @solid-connect/university-web run ci:check
33+
fi
34+
2635
if [ "$RUN_ADMIN" -eq 1 ]; then
2736
pnpm --filter @solid-connect/admin run ci:check
2837
fi
2938

30-
if [ "$RUN_WEB" -eq 0 ] && [ "$RUN_ADMIN" -eq 0 ]; then
39+
if [ "$RUN_WEB" -eq 0 ] && [ "$RUN_UNIVERSITY_WEB" -eq 0 ] && [ "$RUN_ADMIN" -eq 0 ]; then
3140
echo "ℹ️ No CI-targeted changes detected; skipping parity checks."
3241
fi
3342

.husky/pre-push

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,44 @@ else
1515
fi
1616

1717
RUN_WEB=0
18+
RUN_UNIVERSITY_WEB=0
1819
RUN_ADMIN=0
1920

2021
for FILE in $CHANGED_FILES; do
2122
case "$FILE" in
2223
apps/web/*)
2324
RUN_WEB=1
2425
;;
26+
apps/university-web/*)
27+
RUN_UNIVERSITY_WEB=1
28+
;;
2529
apps/admin/*)
2630
RUN_ADMIN=1
2731
;;
28-
package.json|pnpm-lock.yaml|pnpm-workspace.yaml|turbo.json|.github/workflows/*)
32+
package.json|pnpm-lock.yaml|pnpm-workspace.yaml|scripts/*|turbo.json|.github/workflows/*)
2933
RUN_WEB=1
34+
RUN_UNIVERSITY_WEB=1
3035
RUN_ADMIN=1
3136
;;
3237
esac
3338
done
3439

3540
if [ "$RUN_WEB" -eq 1 ]; then
3641
pnpm --filter @solid-connect/web run ci:check
37-
NODE_ENV=production pnpm --filter @solid-connect/web run build
42+
NODE_ENV=production UNIVERSITY_WEB_DOMAIN=https://university-web.ci.local pnpm --filter @solid-connect/web run build
43+
fi
44+
45+
if [ "$RUN_UNIVERSITY_WEB" -eq 1 ]; then
46+
pnpm --filter @solid-connect/university-web run ci:check
47+
NODE_ENV=production pnpm --filter @solid-connect/university-web run build
3848
fi
3949

4050
if [ "$RUN_ADMIN" -eq 1 ]; then
4151
pnpm --filter @solid-connect/admin run ci:check
4252
NODE_ENV=production pnpm --filter @solid-connect/admin run build
4353
fi
4454

45-
if [ "$RUN_WEB" -eq 0 ] && [ "$RUN_ADMIN" -eq 0 ]; then
55+
if [ "$RUN_WEB" -eq 0 ] && [ "$RUN_UNIVERSITY_WEB" -eq 0 ] && [ "$RUN_ADMIN" -eq 0 ]; then
4656
echo "ℹ️ No CI-targeted changes detected; skipping parity builds."
4757
fi
4858

apps/university-web/.env

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Shared configuration across all environments
2+
# Environment-specific values are in .env.development, .env.preview, .env.production
3+
4+
NEXT_PUBLIC_IMAGE_URL=https://cdn.default.solid-connection.com
5+
NEXT_PUBLIC_UPLOADED_IMAGE_URL=https://cdn.upload.solid-connection.com
6+
7+
# google maps
8+
NEXT_PUBLIC_GOOGLE_MAP_API_KEY=
9+
10+
# google analytics
11+
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=G-V1KLYZC1DS
12+
13+
# apple
14+
NEXT_PUBLIC_APPLE_CLIENT_ID=com.basakcrispy.solidconnection.auth
15+
NEXT_PUBLIC_APPLE_SCOPE="email"
16+
17+
NEXT_PUBLIC_CONTACT_LINK=https://open.kakao.com/o/grTrKWdg
18+
19+
# AI Inspector (server-only)
20+
# Set these values in .env.local or deployment environment variables.
21+
# AI_INSPECTOR_FIREBASE_PROJECT_ID=
22+
# AI_INSPECTOR_FIREBASE_CLIENT_EMAIL=
23+
# AI_INSPECTOR_FIREBASE_PRIVATE_KEY=
24+
# AI_INSPECTOR_FIRESTORE_COLLECTION=aiInspectorTasks
25+
26+
# BELOW IS EXAMPLE FOR .env.local
27+
28+
# firebase private
29+
# FIREBASE_PROJECT_ID=
30+
# FIREBASE_PRIVATE_KEY_ID=
31+
# FIREBASE_PRIVATE_KEY=
32+
# FIREBASE_CLIENT_EMAIL=
33+
# FIREBASE_CLIENT_ID=
34+
# FIREBASE_CLIENT_X509_CERT_URL=
35+
36+
# sentry
37+
# SENTRY_PROJECT=
38+
# SENTRY_ORG=
39+
# SENTRY_DSN=
40+
# SENTRY_ENVIRONMENT=
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SENTRY_ENVIRONMENT=development
2+
3+
# web page
4+
NEXT_PUBLIC_WEB_URL=http://localhost:3000
5+
6+
# api server
7+
NEXT_PUBLIC_API_SERVER_URL=https://api.stage.solid-connection.com
8+
9+
# kakao
10+
NEXT_PUBLIC_KAKAO_JS_KEY=
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SENTRY_ENVIRONMENT=production
2+
3+
# web page
4+
NEXT_PUBLIC_WEB_URL=https://www.solid-connection.com
5+
6+
# api server
7+
NEXT_PUBLIC_API_SERVER_URL=https://api.solid-connection.com
8+
9+
# kakao
10+
NEXT_PUBLIC_KAKAO_JS_KEY=
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Authentication & Authorization
2+
3+
## Overview
4+
5+
웹 인증은 **클라이언트 재발급/인터셉터 중심**으로 동작합니다.
6+
7+
- 서버 진입 시 middleware에서 보호 경로를 `/login`으로 선리다이렉트하지 않습니다.
8+
- 인증 실패 시점은 페이지 렌더/데이터 요청 단계에서 결정됩니다.
9+
10+
## Current Flow
11+
12+
### 1. App Initialization
13+
14+
- `ReissueProvider`에서 앱 최초 진입 시 `/auth/reissue`를 시도합니다.
15+
- 성공 시 access token이 스토어에 반영되고, 실패 시 비로그인 상태를 유지합니다.
16+
17+
### 2. Request Interceptor
18+
19+
- `axiosInstance` 요청 인터셉터가 access token 만료 여부를 검사합니다.
20+
- 토큰이 없거나 만료된 경우 재발급을 시도하고, 실패하면 로그인 이동을 유도합니다.
21+
22+
### 3. Response Interceptor
23+
24+
- API 응답이 401이면 재발급 1회 후 원요청을 재시도합니다.
25+
- 재시도 실패 시 로그인 페이지로 이동합니다.
26+
27+
### 4. Page-level Guards
28+
29+
- 인증이 필요한 UI(예: 멘토 페이지)는 클라이언트에서 재발급/토큰 상태를 확인합니다.
30+
- 필요한 경우 페이지 내부 로직에서 `/login`으로 이동합니다.
31+
32+
## Middleware Responsibility
33+
34+
`apps/web/src/middleware.ts`는 현재 아래만 담당합니다.
35+
36+
- stage 환경 `robots.txt` 제어
37+
- 스캐너/프로브 경로 차단 (`.php`, `/.git`, `/wp-admin` 등)
38+
- 정적 리소스 경로 제외 matcher 유지
39+
40+
즉, middleware는 더 이상 인증 선검증(보호 경로 강제 로그인 리다이렉트)을 수행하지 않습니다.
41+
42+
## Tokens
43+
44+
### Refresh Token
45+
46+
- HTTP-only 쿠키로 관리
47+
- 재발급 API 호출 시 서버가 검증
48+
49+
### Access Token
50+
51+
- Zustand store 기반으로 관리
52+
- API 인증 헤더에 사용
53+
- 만료 시 재발급을 통해 갱신
54+
55+
## Related Files
56+
57+
- `apps/web/src/lib/zustand/useAuthStore.ts`
58+
- `apps/web/src/utils/axiosInstance.ts`
59+
- `apps/web/src/components/layout/ReissueProvider/index.tsx`
60+
- `apps/web/src/middleware.ts`

0 commit comments

Comments
 (0)