Skip to content
Merged

Test #122

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6de89e6
장바구니_메뉴_담기_기능_추가 : feat : npm 취약점 버전 수정 및 tanstack react-query 의존성 추가…
Chuseok22 Dec 29, 2025
27c9101
장바구니_메뉴_담기_기능_추가 : feat : cicd 수정 https://github.com/CampusTable/camp…
Chuseok22 Dec 29, 2025
574ac75
장바구니_메뉴_담기_기능_추가 : feat : SSR apiServer.ts 중 인증 오류 발생 시 쿠키 삭제 및 로그인 페…
Chuseok22 Dec 29, 2025
5107f6c
장바구니_메뉴_담기_기능_추가 : feat : SSR 요청 중 인증 만료 시 쿠키 삭제를 위한 session-expired …
Chuseok22 Dec 31, 2025
a01b8e0
장바구니_메뉴_담기_기능_추가 : feat : fetchServer.ts 편의 메서드 명 수정 https://github.c…
Chuseok22 Dec 31, 2025
9015245
장바구니_메뉴_담기_기능_추가 : feat : 장바구니 메뉴 추가 및 삭제를 위한 커스텀 hook useCart.ts 추가 …
Chuseok22 Dec 31, 2025
9a17d31
장바구니_메뉴_담기_기능_추가 : feat : useCart getMenuQuantity 메서드 반환값 타입 오류 수정 ht…
Chuseok22 Dec 31, 2025
7fabe31
장바구니_메뉴_담기_기능_추가 : feat : 장바구니 총 메뉴 개수 9개 제한을 위한 useCart.ts 훅 내부 개수제한…
Chuseok22 Jan 2, 2026
faa8423
장바구니_메뉴_담기_기능_추가 : feat : TanstackQuery 사용을 위한 QueryClientProvider.ts…
Chuseok22 Jan 2, 2026
4e13b42
장바구니_메뉴_담기_기능_추가 : feat : 주문 요약 하단 바 height 전역 사용을 위한 변수 분리 https://g…
Chuseok22 Jan 2, 2026
c814114
장바구니_메뉴_담기_기능_추가 : feat : 전역 layout.tsx QueryClientProvider 추가 https:…
Chuseok22 Jan 2, 2026
693eb5d
장바구니_메뉴_담기_기능_추가 : feat : 장바구니 api 요청 및 응답 타입 선언 https://github.com/C…
Chuseok22 Jan 2, 2026
5fbda08
장바구니_메뉴_담기_기능_추가 : feat : 장바구니 관련 백엔드 api 호출 로직 추가 https://github.com…
Chuseok22 Jan 2, 2026
51722e6
장바구니_메뉴_담기_기능_추가 : feat : BFF 패턴을 위한 백엔드 api -> 프론트 types 형 변환 매퍼 및 s…
Chuseok22 Jan 2, 2026
f338cbf
장바구니_메뉴_담기_기능_추가 : feat : 메뉴 + 버튼 클릭 시 콜백함수 props 추가 https://github.c…
Chuseok22 Jan 2, 2026
71b52d9
장바구니_메뉴_담기_기능_추가 : feat : 학생회관 페이지 MenuPageContainer 개발 https://githu…
Chuseok22 Jan 2, 2026
dd0c7dd
장바구니_메뉴_담기_기능_추가 : feat : useCart.ts updateMenuQuantity, removeFromCa…
Chuseok22 Jan 2, 2026
8f7ce1e
장바구니_메뉴_담기_기능_추가 : feat : nextRedirect import 수정 https://github.com/C…
Chuseok22 Jan 2, 2026
89116cc
Merge pull request #119 from CampusTable/20251229_#118_장바구니_메뉴_담기_기능_추가
Chuseok22 Jan 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 1 addition & 38 deletions .github/workflows/campus-table-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,44 +32,6 @@ jobs:
printf '%s\n' "${{ secrets.ENV_MAIN }}" > .env.production
fi

# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version: "20.15.0"
# cache: "npm"
#
# - name: Cache npm dependencies
# uses: actions/cache@v4
# with:
# path: ~/.npm
# key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-npm-
#
# - name: Cache node_modules
# id: node-modules-cache
# uses: actions/cache@v4
# with:
# path: "**/node_modules"
# key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-modules-
#
# - name: Install dependencies
# if: steps.node-modules-cache.outputs.cache-hit != 'true'
# run: npm ci
#
# - name: Cache Next.js build
# uses: actions/cache@v4
# with:
# path: .next/cache
# key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# restore-keys: |
# ${{ runner.os }}-nextjs-
#
# - name: Build project
# run: npm run build

- name: Docker setup
uses: docker/setup-buildx-action@v3

Expand Down Expand Up @@ -148,6 +110,7 @@ jobs:

echo "새로운 컨테이너 $CONTAINER_NAME 실행 중..."
echo $PW | sudo -S docker run -d -p ${PORT}:3000 --name $CONTAINER_NAME \
--restart unless-stopped
--env-file .env.production \
${IMAGE}

Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 빌드 단계
FROM node:20.15.0 AS builder
FROM node:20.15.0-slim AS builder
WORKDIR /app

# 패키지 설치
Expand All @@ -13,9 +13,11 @@ COPY . .
RUN npm run build

# 실행 단계
FROM node:20.15.0-alpine
FROM node:20.15.0-slim AS runner
WORKDIR /app

ENV NODE_ENV=production

# 빌드 아티팩트 및 의존성만 복사
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
Expand Down
115 changes: 71 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"lint": "eslint"
},
"dependencies": {
"@tanstack/react-query": "^5.90.14",
"ioredis": "^5.8.2",
"next": "16.0.6",
"next": "16.1.1",
"react": "19.2.0",
"react-dom": "19.2.0"
},
Expand Down
17 changes: 17 additions & 0 deletions src/app/api/auth/session-expired/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NextRequest, NextResponse } from "next/server";
import { SESSION_COOKIE_NAME } from "@/shared/lib/session/sessionStore";

/**
* SSR에서 세션 만료 시 쿠키 삭제를 위한 Route Handler
* - apiServer에서 인증 실패 시 여기로 리다이렉트
* - sid 쿠키 삭제 후 로그인 페이지 리다이렉트
*/
export async function GET(request: NextRequest) {
const loginUrl = new URL("/login", request.url);
const response = NextResponse.redirect(loginUrl);

// sid 세션 쿠키 삭제
response.cookies.delete(SESSION_COOKIE_NAME);

return response;
}
6 changes: 5 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "./globals.css";
import { kccHanbit, pretendard } from "@/styles/system/fonts";
import ServiceWorkerRegister from "@/shared/components/service-worker/ServiceWorkerRegister";
import QueryClientProvider from "@/shared/providers/QueryClientProvider";

export { metadata } from "./metadata";

Expand All @@ -14,8 +15,11 @@ export default function RootLayout({
lang="ko"
className={`${pretendard.variable} ${kccHanbit.variable}`}
>
{/* TODO: 추후 module.css 분리 */}
<body className="min-h-screen antialiased font-sans">
{children}
<QueryClientProvider>
{children}
</QueryClientProvider>
<ServiceWorkerRegister />
</body>
</html>
Expand Down
18 changes: 18 additions & 0 deletions src/features/cart/api/cartApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { CartApiResponse, CartRequest } from "@/features/cart/types/cartType";
import { apiClient } from "@/shared/lib/api/apiClient";

/**
* 장바구니 조회
* GET /api/cart
*/
export async function getCart(): Promise<CartApiResponse> {
return await apiClient.get<CartApiResponse>("/api/cart");
}

/**
* 장바구니 메뉴 추가 or 수량 변경
* POST /api/cart/items
*/
export async function upsertCart(request: CartRequest): Promise<CartApiResponse> {
return await apiClient.post<CartApiResponse>("/api/cart/items", request);
}
Loading