diff --git a/002_source/cms/.env.example b/002_source/cms/.env.example index f72d9d8..95da3b6 100644 --- a/002_source/cms/.env.example +++ b/002_source/cms/.env.example @@ -36,5 +36,5 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY= # Mapbox NEXT_PUBLIC_MAPBOX_API_KEY= -# Google Tag Manager -NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID= \ No newline at end of file +# Google Tag Manager +NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID= diff --git a/002_source/cms/.eslintrc.js b/002_source/cms/.eslintrc.js index 4bfd700..216a6b4 100644 --- a/002_source/cms/.eslintrc.js +++ b/002_source/cms/.eslintrc.js @@ -71,6 +71,16 @@ module.exports = { 'react/jsx-fragments': 'off', // personal style 'react/prop-types': 'off', // TypeScript is used for type checking '@next/next/no-img-element': 'off', // Temporary disabled + // customized + '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-unsafe-argument': 'warn', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-unused-vars': 'warn', + 'no-unused-vars': 'warn', + 'no-console': 'warn', + '@typescript-eslint/no-empty-function': 'warn', + 'eslint-comments/require-description': 'off', + 'eslintreact/jsx-sort-props': 'off', }, ignorePatterns: ['**/*del', '**/*bak'], }; diff --git a/002_source/cms/README.md b/002_source/cms/README.md index 3391235..cc7a6bc 100644 --- a/002_source/cms/README.md +++ b/002_source/cms/README.md @@ -1,34 +1,26 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +# README -## Getting Started +## Develop -First, run the development server: +### Technical Stack -```bash -npm run dev -# or -yarn dev -``` +tools included and configured: -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +- [TypeScript][typescript] [5.7][typescript-5-7] +- [Prettier][prettier] to enforce consistent code style +- [EditorConfig][editorconfig] for consistent coding style +- [nextjs] -You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. +### Directory structure -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. + +- `src`: source code of the project +- `public`: source code of the project, managed by nextjs +- `scripts`: utilities script -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. +--- -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. +[typescript]: https://www.typescriptlang.org/ +[typescript-5-7]: https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/ +[prettier]: https://prettier.io +[editorconfig]: https://editorconfig.org diff --git a/002_source/cms/README.original b/002_source/cms/README.original new file mode 100644 index 0000000..c87e042 --- /dev/null +++ b/002_source/cms/README.original @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/002_source/cms/TODO.md b/002_source/cms/TODO.md new file mode 100644 index 0000000..c2eb479 --- /dev/null +++ b/002_source/cms/TODO.md @@ -0,0 +1 @@ +need to fix local storage error diff --git a/002_source/cms/public/locales/dev/translation.json b/002_source/cms/public/locales/dev/translation.json new file mode 100644 index 0000000..d03a5fc --- /dev/null +++ b/002_source/cms/public/locales/dev/translation.json @@ -0,0 +1,190 @@ +{ + "languageChanged": "語言已更改", + "type": "類型", + "helloworld": "你好,世界", + "Add": "新增項目", + "visible": "可視", + "hidden": "屏閉", + "Hidden": "屏閉", + "Newest": "最新", + "Oldest": "最舊", + "Lesson position": "位置", + "Lesson type": "種類", + "Type": "種類", + "Name": "名稱", + "Filter by name": "依名稱過濾", + "Filter by type": "依類型過濾", + "dashboard.lessonTypes.add": "新增課程類型", + "dashboard.lessonTypes.title": "課程類型", + "dashboard.lessonTypes.type": "類型", + "dashboard.lessonTypes.create.title": "建立課程類型", + "dashboard.lessonTypes.create.createButton": "建立", + "dashboard.lessonTypes.create.cancelButton": "取消", + "dashboard.lessonTypes.edit.title": "編輯課程類型", + "Actions": "動作", + "Created at": "建立時間", + "Updated at": "更新時間", + "dashboard.lessonTypes.edit": "編輯課程類型", + "dashboard.lessonTypes.delete": "刪除課程類型", + "dashboard.lessonTypes.delete.title": "刪除課程類型", + "dashboard.lessonTypes.delete.message": "確定要刪除課程類型嗎?", + "Lesson Type": "課程類型", + "dashboard.lessonTypes.create": "建立課程類型", + "dashboard.lessonTypes.create.message": "請輸入課程類型名稱", + "dashboard.lessonTypes.create.success": "課程類型建立成功", + "dashboard.lessonTypes.create.error": "課程類型建立失敗", + "dashboard.lessonTypes.edit.success": "課程類型更新成功", + "dashboard.lessonTypes.edit.error": "課程類型更新失敗", + "dashboard.lessonTypes.delete.success": "課程類型刪除成功", + "dashboard.lessonTypes.delete.error": "課程類型刪除失敗", + "dashboard.lessonTypes.list": "課程類型列表", + "dashboard.lessonTypes.list.title": "課程類型列表", + "dashboard.lessonTypes.list.message": "請選擇課程類型", + "dashboard.lessonTypes.list.empty": "目前沒有課程類型", + "dashboard.lessonTypes.list.empty.title": "目前沒有課程類型", + "dashboard.lessonTypes.list.empty.message": "請建立課程類型", + "dashboard.lessonTypes.list.empty.create": "建立課程類型", + "Lesson Name": "課程名稱", + "dashboard.lessonTypes.list.empty.create.title": "建立課程類型", + "dashboard.lessonTypes.list.empty.create.message": "請輸入課程名稱", + "dashboard.lessonTypes.list.empty.create.success": "課程建立成功", + "dashboard.lessonTypes.list.empty.create.error": "課程建立失敗", + "dashboard.lessonTypes.list.empty.create.name": "課程名稱", + "dashboard.lessonTypes.list.empty.create.type": "課程類型", + "dashboard.lessonTypes.list.empty.create.type.placeholder": "請選擇課程類型", + "dashboard.lessonTypes.list.empty.create.type.title": "課程類型", + "dashboard.lessonTypes.list.empty.create.type.message": "請選擇課程類型", + "dashboard.lessonTypes.list.empty.create.type.empty": "目前沒有課程類型", + "dashboard.lessonTypes.list.empty.create.type.empty.title": "目前沒有課程類型", + "dashboard.lessonTypes.list.empty.create.type.empty.message": "請建立課程類型", + "dashboard.lessonTypes.list.empty.create.type.empty.create": "建立課程類型", + "Position": "位置", + "Visible": "顯示", + "Lesson Types": "課程類型", + "Apply": "套用", + "Overview": "概觀", + "Dashboard": "儀表板", + "Tickets": "票券", + "Sign ups": "註冊", + "Open issues": "開啟問題", + "Closed issues": "關閉問題", + "increase": "增加", + "decrease": "減少", + "common.loading": "載入中", + "vs last month": "與上個月相比", + "Dashboards": "儀表板", + "App usage": "應用程式使用情況", + "Find your dream job": "找到你的夢想工作", + "Need help figuring things out?": "需要幫助嗎?", + "Search for jobs that match your skills and apply to them directly": "搜索符合你技能的工作,直接申請", + "Find answers to your questions and get in touch with our team.": "找到你的問題並與我們的團隊聯繫", + "Explore documentation": "探索文件", + "Learn how to get started with our product and make the most of it.": "學習如何開始使用我們的產品並充分利用它", + "Search Jobs": "搜索工作", + "Help Center": "幫助中心", + "Documentation": "文件", + "increase_in_app_usage_with": "使用者量增加", + "new_products_purchased": "新產品購買", + "Our subscriptions": "我們的訂閱", + "this_year": "今年", + "is_forecasted_to_increase_in_your_traffic_by_the_end_of_the_current_month": "今年預計增加你的流量", + "Jan": "一月", + "Feb": "二月", + "Mar": "三月", + "Apr": "四月", + "May": "五月", + "Jun": "六月", + "Jul": "七月", + "Aug": "八月", + "Sep": "九月", + "Oct": "十月", + "Nov": "十一月", + "Dec": "十二月", + "See all subscriptions": "查看所有訂閱", + "app_chat": "應用程式聊天", + "Upcoming events": "即將發生的事件", + "Based on the linked bank accounts": "基於連結的銀行帳戶", + "App limits": "應用程式限制", + "You have used {percentage} of your available spots.": "您已使用 {percentage} 的可用座位。升級計劃以建立更多專案", + "userMessagesUnread": "hello userMessagesUnread", + "Upgrade plan to create more projects": "升級計劃以建立更多專案", + "You have almost reached your limit": "您已接近您的限制", + "Upgrade plan": "升級計劃", + "Help center": "幫助中心", + "Jobs": "工作", + "go_to_chat": "前往聊天", + "See all events": "查看所有事件", + "You have used": "您已使用", + "of your available spots": "的可用座位", + "Paid": "已付款", + "Canceled": "已取消", + "Pending": "待付款", + "Expiring": "已過期", + "Refunded": "已退款", + "Total": "總計", + "Total paid": "已付款", + "Total cancelled": "已取消", + "Total pending": "待付款", + "year": "年", + "month": "月", + "week": "週", + "day": "日", + "hour": "小時", + "minute": "分鐘", + "second": "秒", + "ago": "前", + "remaining": "剩下", + "days": "天", + "hours": "小時", + "minutes": "分鐘", + "seconds": "秒", + "Clear filters": "清除篩選", + "Type information": "輸入資訊", + "dashboard.lessonTypes.create.typeInformation": "輸入課程類型資訊", + "dashboard.lessonTypes.create.avatar": "上傳課程類型圖片", + "dashboard.lessonTypes.create.avatarRequirements": "上傳課程類型圖片", + "dashboard.lessonTypes.create.select": "請選擇", + "dashboard.lessonTypes.create.name": "課程類型名稱", + "dashboard.lessonTypes.create.type": "課程類型", + "dashboard.lessonTypes.create.position": "課程類型順序", + "dashboard.lessonTypes.create.visibleToUser": "顯示給使用者", + "dashboard.lessonTypes.edit.typeInformation": "輸入課程類型資訊", + "dashboard.lessonTypes.edit.avatar": "上傳課程類型圖片", + "dashboard.lessonTypes.edit.avatarRequirements": "上傳課程類型圖片", + "dashboard.lessonTypes.edit.select": "請選擇", + "dashboard.lessonTypes.edit.name": "課程類型名稱", + "dashboard.lessonTypes.edit.type": "課程類型", + "dashboard.lessonTypes.edit.position": "課程類型順序", + "dashboard.lessonTypes.edit.visibleToUser": "顯示給使用者", + "dashboard.lessonTypes.edit.visible": "顯示", + "dashboard.lessonTypes.edit.hidden": "隱藏", + "dashboard.lessonTypes.edit.cancelButton": "取消", + "dashboard.lessonTypes.edit.updateButton": "更新", + "Delete Lesson Type ?": "刪除課程類型?", + "Are you sure you want to delete lesson type ?": "確定要刪除課程類型嗎?", + "Cancel": "取消", + "Delete": "刪除", + "All": "全部", + "categories": "課程分類", + "loading": "載入中", + "Notifications": "通知", + "Mark all as read": "標記所有為已讀", + "There are no notifications": "沒有通知", + "listenings": "聽講 (Listenings)", + "question_category": "問題分類", + "question_list": "問題", + "matching_frenzy": "配對 (Matching Frenzy)", + "connective_revision": "連接詞 (Connective Revision)", + "settings": "設定", + "students": "學生", + "dashboard.lessonCategories.add": "新增課程分類", + "dashboard.lessonCategories.title": "課程分類", + "dashboard.lessonCategorys.edit.name": "課程分類名稱", + "dashboard.lessonCategorys.edit.position": "課程分類順序", + "dashboard.lessonCategorys.edit.title": "編輯課程分類", + "dashboard.lessonCategorys.edit.visibleToUser": "顯示給使用者", + "dashboard.lessonCategorys.edit.visible": "顯示", + "dashboard.lessonCategorys.edit.hidden": "隱藏", + "dashboard.lessonCategorys.edit.cancelButton": "取消", + "dashboard.lessonCategorys.edit.updateButton": "更新" +} \ No newline at end of file