Skip to content

Repository files navigation

🗓️ 農曆日期提醒 Lunar Calendar Reminder

🔗 Live Demo: https://lunar-reminder.tinglin.ovh/

自動轉換農曆日期為陽曆,整合 Google Calendar 提供智能提醒功能。

功能特色

  • 農曆轉陽曆自動轉換(支援閏月)
  • Google 帳號登入(Firebase Auth)
  • Google Calendar 整合與同步
  • 多筆農曆日期管理(生日、紀念日、節日等)
  • 初一、十五自動提醒
  • 佛道教神明生日提醒
  • 天赦日提醒(根據節氣與日柱干支自動計算)
  • 可自訂提前提醒天數(1-30天)
  • 每年/每月自動重複提醒
  • 中文/英文語言切換
  • 今日行程面板

技術架構

層級 技術
前端 React 19 + Vite 6 + Ant Design 5
認證 Firebase Auth (Google OAuth)
資料庫 Cloud Firestore
後端 Firebase Cloud Functions v2
託管 Firebase Hosting
農曆轉換 lunar-javascript(前端)

快速開始

前置需求

  • Node.js 20+
  • Firebase CLI: npm install -g firebase-tools
  • Firebase 專案(啟用 Firestore + Auth)

1. 設定 Firebase 專案

  1. 前往 Firebase Console 建立專案
  2. 啟用 Authentication > Google 登入
  3. 啟用 Cloud Firestore
  4. 在 Project Settings 取得 Web App 設定值

2. 設定環境變數

cp .env.example .env

編輯 .env,填入 Firebase 設定:

VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id

3. 設定 Firebase 專案連結

編輯 .firebaserc,填入你的專案 ID:

{
  "projects": {
    "default": "your-firebase-project-id"
  }
}

4. 安裝依賴

npm run install-all

5. 本地開發

npm run dev

瀏覽器開啟 http://localhost:5173

6. 部署

firebase login
npm run deploy

Google Calendar 整合(選用)

如需 Google Calendar 同步功能:

  1. 在 Google Cloud Console 啟用 Calendar API
  2. 設定 Cloud Functions 環境變數:
firebase functions:config:set google.client_id="YOUR_CLIENT_ID" google.client_secret="YOUR_CLIENT_SECRET"
  1. 部署 Cloud Functions:
npm run deploy:functions

Firestore 資料結構

users/{uid}
  ├── email, name, photoURL
  ├── settings: { remindFirstDay, remindFifteenthDay, remindTianSheDay, defaultRemindDays, notificationEnabled }
  └── reminders/{reminderId}
      ├── name, category, notes
      ├── lunarYear, lunarMonth, lunarDay
      ├── isLeapMonth, isRecurring, remindDaysBefore
      ├── googleCalendarEventId
      └── isActive

常用指令

npm run dev              # 啟動開發伺服器
npm run build            # 建置前端
npm run deploy           # 建置並部署全部
npm run deploy:hosting   # 只部署前端
npm run deploy:functions # 只部署 Cloud Functions
npm run deploy:rules     # 只部署 Firestore 規則
npm run emulators        # 啟動 Firebase 模擬器

費用

使用 Firebase Spark(免費)方案,包含:

  • Firestore: 1GB 儲存 + 50K 讀/20K 寫/日
  • Auth: 無限制
  • Hosting: 10GB 儲存 + 360MB/日傳輸
  • Cloud Functions: 2M 呼叫/月(需升級 Blaze 方案)

對於個人使用,免費額度綽綽有餘。

About

Auto-convert lunar dates and sync with Google Calendar

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

Contributors

Languages