Skip to content

Commit 3822f20

Browse files
committed
Merge branch 'develop'
2 parents 654c048 + 80cbc4f commit 3822f20

11 files changed

Lines changed: 366 additions & 2088 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy to AWS S3 and CloudFront
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
cache: 'npm'
19+
20+
- name: Install and build
21+
run: |
22+
npm ci
23+
npm run build
24+
env:
25+
VITE_DEPLOY_ENV: prod
26+
VITE_SERVER_URL: ${{ vars.VITE_SERVER_URL }}
27+
VITE_KAKAO_KEY: ${{ vars.VITE_KAKAO_KEY }}
28+
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
29+
VITE_HOTJAR_SITE_ID: ${{ vars.VITE_HOTJAR_SITE_ID }}
30+
31+
- name: Configure AWS
32+
uses: aws-actions/configure-aws-credentials@v4
33+
with:
34+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
35+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36+
aws-region: ap-northeast-2
37+
38+
- name: Deploy to S3 and invalidate CloudFront
39+
run: |
40+
BUILD_HASH=$(git rev-parse --short HEAD)-$(date +%Y%m%d-%H%M%S)
41+
42+
# NOTE: index.html은 no-cache를 두어 매번 서버에 확인 요청 보내게
43+
aws s3 sync dist/ "s3://${{ secrets.S3_BUCKET_NAME }}/frontend/${BUILD_HASH}/" --cache-control "public, max-age=31536000" --exclude "*.html"
44+
aws s3 sync dist/ "s3://${{ secrets.S3_BUCKET_NAME }}/frontend/${BUILD_HASH}/" --cache-control "no-cache" --include "*.html"
45+
aws s3 sync "s3://${{ secrets.S3_BUCKET_NAME }}/frontend/${BUILD_HASH}/" "s3://${{ secrets.S3_BUCKET_NAME }}/frontend/current/" --delete
46+
47+
# NOTE: asterisk를 사용해도 경로 패턴 당 계산하므로 전체 invalidation 수행
48+
aws cloudfront create-invalidation --distribution-id "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" --paths "/*"

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"source.fixAll.eslint": "explicit",
1414
"source.fixAll.stylelint": "explicit"
1515
},
16-
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
16+
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
17+
"[yaml]": {
18+
"editor.defaultFormatter": "esbenp.prettier-vscode"
19+
}
1720
}

CLAUDE.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Development Commands
6+
7+
- `npm run dev` - Start development server
8+
- `npm run build` - Build for production
9+
- `npm run lint` - Run ESLint and Stylelint
10+
- `npm run lint:fix` - Auto-fix linting issues
11+
- `npm run typecheck` - Run TypeScript type checking
12+
- `npm run storybook` - Start Storybook development server
13+
14+
## Architecture Overview
15+
16+
This is a React + TypeScript application built with Vite for a collaborative letter-writing platform called "Ittory".
17+
18+
### State Management
19+
- **Redux Toolkit** with persistence for letter writing data and order management
20+
- **React Query (TanStack Query)** for server state management and API calls
21+
- **Redux Persist** for maintaining write/order data across sessions
22+
23+
### Key Application Flow
24+
The app follows a collaborative letter-writing workflow:
25+
1. **Create** - User creates a letter and invites participants
26+
2. **Invite/Join** - Other users join the letter creation process
27+
3. **Write** - Participants write in a predetermined order
28+
4. **Share/Receive** - Final letter is shared and received
29+
30+
### WebSocket Integration
31+
- Custom type-safe WebSocket wrapper (`SharedTypeSafeWebSocket`) built on STOMP
32+
- Real-time collaboration features for letter writing
33+
- Automatic reconnection and subscription management
34+
- Queue-based message handling for connection reliability
35+
36+
### API Layer Structure
37+
- **Services** - Business logic layer (AuthService, LetterService, etc.)
38+
- **Models** - TypeScript interfaces for API data
39+
- **Queries** - React Query hooks organized by domain
40+
- **Config** - API configuration, interceptors, and token management
41+
42+
### Mobile-First Design
43+
- Built as a web app designed for mobile webview integration
44+
- iOS SafeArea handling
45+
- React Native WebView console logging integration
46+
- Responsive design with viewport height calculations
47+
48+
### Development Tools
49+
- **MSW (Mock Service Worker)** for API mocking during development
50+
- **Storybook** for component development and documentation
51+
- **Sentry** for error tracking
52+
- **Hotjar** for user analytics (production only)
53+
- **Lefthook** for git hooks with commitlint
54+
55+
### Environment Configuration
56+
Required environment variables:
57+
- `VITE_DEPLOY_ENV` - Deployment environment
58+
- `VITE_KAKAO_KEY` - Kakao OAuth key
59+
- `VITE_SERVER_URL` - Backend API URL
60+
- `VITE_SENTRY_DSN` - Sentry DSN (optional)
61+
- `VITE_HOTJAR_SITE_ID` - Hotjar site ID (optional)
62+
63+
### Key Directories
64+
- `src/pages/` - Top-level route components
65+
- `src/components/` - Reusable UI components organized by page
66+
- `src/api/` - API layer (services, models, queries, websockets)
67+
- `src/utils/SessionLogger/` - Custom logging system for debugging
68+
- `src/layout/` - App layout components with mobile-specific features

0 commit comments

Comments
 (0)