Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0806401
chore : project migration(CRA PWA => VITE PWA with monorepo)
chucoding Oct 5, 2025
c394aca
chore : [TSK-18] pnpm version update
chucoding Oct 5, 2025
a9c529e
refactor : [TSK-18] 모노레포로 변경하면서 폴더 이동
chucoding Oct 5, 2025
808b404
refactor : [TSK-20] firebase app 초기화(CRA=>vite 마이그레이션)
chucoding Oct 5, 2025
a439d8c
chore : [TSK-22] firebase hosting CI/CD 구축
chucoding Oct 5, 2025
36ba3fd
chore : [TSK-23] pnpm 명령어 수정(DX)
chucoding Oct 6, 2025
704af74
refactor : [TSK-24] remove supabase
chucoding Oct 6, 2025
0021baf
refactor : [TSK-25, TSK-26] favicon 변경 및 web-vitals 제거(CRA PWA기본 모듈..…
chucoding Oct 6, 2025
f2b1b01
refactor : [TSK-19] 필요없는 리소스 제거 및 PWA Vite 플러그인 추가
chucoding Oct 6, 2025
d49041f
chore : [TSK-17] github action pnpm 추가
chucoding Oct 6, 2025
3ee3386
Merge pull request #4 from chucoding/feature/TSK-17_project_migration
chucoding Oct 6, 2025
30818e9
feat : [TSK-27] github 로그인 추가
chucoding Oct 6, 2025
468bf7e
chore : [TSK-27] 개발서버 브라우저 자동 실행 추가
chucoding Oct 6, 2025
81473eb
Merge pull request #5 from chucoding/feature/TSK-27_firebase_github_l…
chucoding Oct 6, 2025
906f3fd
feat : [TSK-28] axios 및 proxy 셋팅 구현
chucoding Oct 6, 2025
c396140
feat : [TSK-30] firebase functions 배포 및 emulator 구성
chucoding Oct 7, 2025
272d9a4
fix : [TSK-31] github API 변경(personal => OAuth APP 인증 방식)
chucoding Oct 7, 2025
88bd161
feat : [TSK-9, TSK-31] firestore에 github 유저 정보 저장(레포, 토큰) 및 github AP…
chucoding Oct 7, 2025
9521358
Merge pull request #6 from chucoding/feature/TSK-11_github_api
chucoding Oct 8, 2025
b660388
feat : [TSK-37] 레포지토리 선택 Selectbox 구현
chucoding Oct 8, 2025
a7717df
feat : [TSK-38] UserDropdown 및 로그아웃 기능 추가
chucoding Oct 8, 2025
f6b8daa
feat : [TSK-39] 레포지토리 목록 indexed DB에 저장. (여러번 호출되지 않도록)
chucoding Oct 8, 2025
836ed07
Merge pull request #7 from chucoding/feature/TSK-32_setting_page
chucoding Oct 8, 2025
5308c97
feat : [TSK-12] HCX-007 API로 업데이트
chucoding Oct 8, 2025
0b78de2
fix : [TSK-49] HCX-007 응답포맷 안맞는 부분 조정
chucoding Oct 8, 2025
e89cf51
feat : [TSK-50] github diff 보기기능 추가 및 브랜치 설정 추가
chucoding Oct 8, 2025
5444d99
Merge pull request #8 from chucoding/feature/TSK-12_hcx_api
chucoding Oct 8, 2025
fe39663
feat : TSK-52 플래시카드 디자인 변경(+ github 마크다운 적용)
chucoding Oct 8, 2025
99d1e56
Merge pull request #9 from chucoding/feature/TSK-52_flashcard
chucoding Oct 8, 2025
058f68a
feat : [TSK-53] 브랜치 Select 캐싱
chucoding Oct 8, 2025
f44501b
feat : [TSK-54] 회원탈퇴 인증 버그 수정 및 UI 문구 부드럽게 수정
chucoding Oct 8, 2025
dae96e8
feat : [TSK-54] 회원탈퇴시 DB삭제 및 24시간 이내 재가입 불가능
chucoding Oct 8, 2025
711b007
feat : [TSK-53] 설정 변경시 플래시카드 리로드
chucoding Oct 8, 2025
a8c3c71
feat : [TSK-53] 로딩화면 문구 수정
chucoding Oct 9, 2025
7141901
fix : [TSK-53] 브랜치 Select UI 수정
chucoding Oct 9, 2025
825003f
feat : [TSK-42] 이용약관 추가
chucoding Oct 9, 2025
6e822aa
style : [TSK-25] 로그인 화면 캐릭터 추가
chucoding Oct 9, 2025
bb9ac6b
chore : [TSK-41] 서비스명 변경(today-i-learned => recall buddy)
chucoding Oct 9, 2025
919fc12
feat : [TSK-44] 온보딩 화면 추가
chucoding Oct 9, 2025
483aac9
feat : [TSK-43] 문의하기 기능 추가
chucoding Oct 9, 2025
8c55f21
fix : [TSK-32] 설정 새로고침 안되는 버그 수정 및 리팩토링(디자인 통일)
chucoding Oct 9, 2025
1e24fca
feat : [TSK-55] 릴리즈 노트 추가(문의하기 제거. 노션 페이지에서 문의가능)
chucoding Oct 9, 2025
040a35e
feat : [TSK-32] 유저 드롭다운 제거(로그아웃 버튼 설정으로 이동) 및 카드 컴포넌트 모듈화
chucoding Oct 9, 2025
e7c1cb3
feat : [TSK-56] 공지사항 배너 추가(firestore에 메시지 저장)
chucoding Oct 9, 2025
9458fa9
Merge pull request #10 from chucoding/feature/TSK-32_setting
chucoding Oct 9, 2025
2b8a7cd
chore : [TSK-41] 프로젝트명 변경(til-alarm=>recall-buddy)
chucoding Oct 9, 2025
d9f20e8
chore : [TSK-48] 서버 배포 리전 변경(US => seoul)
chucoding Oct 9, 2025
60fc0f7
Merge pull request #11 from chucoding/feature/TSK-41_project_name_change
chucoding Oct 9, 2025
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
27 changes: 27 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- run: "pnpm install --frozen-lockfile && pnpm -r run build "
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TIL_ALARM }}
channelId: live
projectId: til-alarm
28 changes: 28 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
on: pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- run: "pnpm install --frozen-lockfile && pnpm -r run build "
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TIL_ALARM }}
projectId: til-alarm
17 changes: 10 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
node_modules

# testing
/coverage

# production
/build
app/dist
functions/dist
packages/shared/dist

# misc
.DS_Store
Expand All @@ -19,6 +19,9 @@
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
.env
.env
!.env.example

# firebase
.firebase/
firebase-debug.log*
215 changes: 192 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,201 @@
# today-i-learned-alarm
에빙하우스 망각곡선(1일, 7일, 30일)에 의거하여 공부한 내용을 매일 아침 PUSH 알림을 받을 수 있도록 해주는 프로그램
<br><br>
<div align=center>
<img src="./public/til-alram.gif" width=200>
</div>
# RecallBuddy

<br/>
매일 학습한 내용을 정리하고 알림을 받는 앱입니다.

## 기술 스택
## 🚀 빠른 시작

<div align=left>
<img src="https://img.shields.io/badge/react v18-61DAFB?style=for-the-badge&logo=React&logoColor=white">
<img src="https://img.shields.io/badge/PWA-5A0FC8?style=for-the-badge&logo=PWA&logoColor=white">
<img src="https://img.shields.io/badge/Firebase-FFCA28?style=for-the-badge&logo=Firebase&logoColor=black">
<img src="https://img.shields.io/badge/GitHub-181717?style=for-the-badge&logo=GitHub&logoColor=white">
<img src="https://img.shields.io/badge/Markdown-000000?style=for-the-badge&logo=Markdown&logoColor=white">
</div>
<br>
### 1. 환경 설정
```bash
# Firebase 프로젝트 정보를 사용해 app/.env에 Functions 프록시 주소 생성/추가
pnpm env:setup

## 기술 블로그
# (옵션) 수동 설정 시 app/.env에 다음 키들을 추가하세요
# Firebase Web 설정 (Console > 프로젝트 설정 > 일반 > 웹 앱 구성에서 복사)
VITE_API_KEY=...
VITE_AUTH_DOMAIN=...
VITE_PROJECT_ID=...
VITE_STORAGE_BUCKET=...
VITE_MESSAGING_SENDER_ID=...
VITE_APP_ID=...
VITE_MEASUREMENT_ID=...

- [안드로이드, IOS 지식 없이 SENS로 알림(PUSH) 서비스 개발하기](https://chucoding.tistory.com/129)
- [네이버클라우드 서비스를 활용한 알림(PUSH) 앱 배포하기](https://chucoding.tistory.com/130)
# Functions 호출용 (`pnpm proxy`로 자동 추가)
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_REGION=
VITE_FUNCTIONS_URL_LOCAL=
VITE_FUNCTIONS_URL_PROD=
```

### 2. 개발 서버 시작
```bash
pnpm dev
```

<br>
### 3. Firebase Functions 설정
```bash
cd functions

## 라이센스
# 환경변수 설정 (로컬 개발용)
echo "GITHUB_TOKEN=your_github_token_here" > .env

<a href="https://www.linkedin.com/in/chucoding/" target="_blank">Prod By. 외계공룡</a><br/>
Copyright &copy; today-i-learned-alarm<br/>All Rights Reserved.</p>
# Functions 실행
pnpm serve
```

## 📁 프로젝트 구조

```
├── app/ # React 앱 (프론트엔드)
│ ├── src/
│ │ ├── api/ # API 호출 함수들
│ │ ├── modules/ # 유틸리티 (axios 등)
│ │ └── pages/ # 페이지 컴포넌트들
│ └── vite.config.ts # Vite 설정 (프록시 포함)
├── functions/ # Firebase Functions (백엔드)
│ ├── src/
│ │ ├── github.ts # GitHub API Functions
│ │ ├── schedule.ts # 스케줄러 Functions
│ │ └── hypercloax.ts # Hypercloax API Functions
│ └── package.json
└── scripts/
└── setup-proxy.js # app/.env에 Functions URL 자동 추가/보강 스크립트
```

## 🔧 환경변수

### 앱 환경변수 (app/.env)
```bash
# Firebase Web 설정 (콘솔에서 복사)
VITE_API_KEY=...
VITE_AUTH_DOMAIN=...
VITE_PROJECT_ID=...
VITE_STORAGE_BUCKET=...
VITE_MESSAGING_SENDER_ID=...
VITE_APP_ID=...
VITE_MEASUREMENT_ID=...

# Functions 호출 설정 (`pnpm proxy` 실행 시 자동 추가)
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_REGION=
VITE_FUNCTIONS_URL_LOCAL=
VITE_FUNCTIONS_URL_PROD=
```

### Functions 환경변수 (functions/.env)
```bash
CLOVA_API_KEY=your_clova_api_key
```

## 🌏 리전 설정

이 프로젝트는 기본적으로 **Seoul (asia-northeast3)** 리전에 배포됩니다.

### 사용 가능한 Firebase Functions 리전
- `asia-northeast3` - Seoul (서울) ⭐ 기본값
- `asia-northeast1` - Tokyo (도쿄)
- `us-central1` - Iowa (아이오와)
- `us-west1` - Oregon (오레곤)
- `europe-west1` - Belgium (벨기에)
- [전체 리전 목록](https://firebase.google.com/docs/functions/locations)

### 리전 변경 방법

다른 리전으로 변경하려면 다음 파일들을 수정하세요:

#### 1. Functions 코드 (모든 함수의 region 옵션 수정)

**`functions/src/github.ts`**
```typescript
export const getCommits = onRequest(
{ cors: true, region: 'your-region' }, // 변경
async (req, res) => { ... }
);
// getFilename, getMarkdown, getRepositories, getBranches도 동일하게 수정
```

**`functions/src/hyperclovax.ts`**
```typescript
export const chatCompletions = onRequest(
{ cors: true, region: 'your-region' }, // 변경
async (req, res) => { ... }
);
```

**`functions/src/schedule.ts`**
```typescript
export const sendDaily8amPush = onSchedule(
{
schedule: '0 23 * * *',
timeZone: 'Asia/Seoul',
region: 'your-region' // 변경
},
async () => { ... }
);
```

#### 2. Setup 스크립트 (환경변수 자동 생성용)

**`scripts/setup-proxy.js`**
```javascript
const envVars = {
VITE_FIREBASE_PROJECT_ID: projectId,
VITE_FIREBASE_REGION: 'your-region', // 변경
VITE_FUNCTIONS_URL_LOCAL: `http://localhost:5001/${projectId}/your-region`, // 변경
VITE_FUNCTIONS_URL_PROD: `https://your-region-${projectId}.cloudfunctions.net` // 변경
};
```

#### 3. 환경변수 재생성

```bash
# setup 스크립트 재실행하여 app/.env 업데이트
pnpm env:setup
```

## 🚀 배포

### Functions 개별 배포
```bash
cd functions

# GitHub API만 배포
pnpm deploy:github

# Schedule만 배포
pnpm deploy:schedule

# Hypercloax만 배포
pnpm deploy:hypercloax

# 전체 배포
pnpm deploy
```

### 앱 배포
```bash
# 루트에서 전체 배포
pnpm deploy
```

## 🔄 API 구조

### GitHub API
- `GET /api/getCommits?since={date}&until={date}` - 커밋 목록
- `GET /api/getFilename?commit_sha={sha}` - 커밋 상세
- `GET /api/getMarkdown?filename={filename}` - 마크다운 내용

### Hypercloax API
- `POST /api/chatCompletions` - CLOVA Studio 질문 생성
- `POST /api/registerDeviceToken` - FCM 토큰 등록
- `POST /api/removeDeviceToken` - FCM 토큰 삭제
- `POST /api/registerSchedule` - 스케줄 등록

### Schedule
- 자동 실행 (매일 오전 8시 KST)

## 🛠️ 개발 도구

- **프론트엔드**: React + TypeScript + Vite
- **백엔드**: Firebase Functions + TypeScript
- **API 통신**: Axios
- **배포**: Firebase Hosting + Functions
19 changes: 19 additions & 0 deletions app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Firebase auth
VITE_API_KEY=your_firebase_api_key_here
VITE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_PROJECT_ID=your_project_id
VITE_STORAGE_BUCKET=your_project.appspot.com
VITE_MESSAGING_SENDER_ID=your_sender_id
VITE_APP_ID=your_app_id
VITE_MEASUREMENT_ID=your_measurement_id
VITE_VAPID_KEY=your_vapid_key_here

# Firebase Functions (pnpm proxy 실행시 자동 생성)
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_REGION=
VITE_FUNCTIONS_URL_LOCAL=
VITE_FUNCTIONS_URL_PROD=

# 사용자 설정
VITE_USER_ID=your_user_id_here
VITE_SCHEDULE_CODE=your_schedule_code_here
13 changes: 13 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RecallBuddy</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
35 changes: 35 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "app",
"private": true,
"version": "2.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build"
},
"dependencies": {
"@recall-buddy/shared": "workspace:*",
"axios": "^1.12.2",
"firebase": "^10.4.0",
"github-markdown-css": "^5.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-indexed-db-hook": "^1.0.14",
"react-markdown": "^9.0.0",
"react-slick": "^0.30.2",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^4.0.0",
"slick-carousel": "^1.8.1",
"zustand": "^5.0.8"
},
"devDependencies": {
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/react-slick": "^0.23.13",
"@types/react-syntax-highlighter": "^15.5.11",
"@vitejs/plugin-react": "^4.0.0",
"typescript": "^5.0.0",
"vite": "^5.0.0",
"vite-plugin-pwa": "^0.17.0"
}
}
Binary file added app/public/character.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/favicon.ico
Binary file not shown.
Loading