Compare commits

...

1025 Commits

Author SHA1 Message Date
javayhu
2a6e322c0a Merge remote-tracking branch 'origin/main' into cloudflare 2025-09-05 22:23:04 +08:00
javayhu
37f011cf74 refactor: rename getSocialLinks to useSocialLinks for improved clarity and consistency 2025-09-05 00:07:07 +08:00
javayhu
35d0ca9e12 refactor: rename getSidebarLinks to useSidebarLinks for improved clarity and consistency 2025-09-05 00:06:40 +08:00
javayhu
34baf20b31 refactor: rename getNavbarLinks to useNavbarLinks for improved clarity and consistency 2025-09-05 00:06:19 +08:00
javayhu
28fcbae6a2 refactor: rename getFooterLinks to useFooterLinks for improved clarity and consistency 2025-09-05 00:06:00 +08:00
javayhu
fc8cea13cd refactor: rename getAvatarLinks to useAvatarLinks for improved clarity and consistency 2025-09-05 00:05:41 +08:00
javayhu
6065c4af06 refactor: rename getPricePlans to usePricePlans for improved clarity and consistency 2025-09-05 00:05:10 +08:00
javayhu
ba7b950c01 refactor: rename getCreditPackages to useCreditPackages for improved clarity and consistency 2025-09-05 00:04:29 +08:00
javayhu
c94784e711 fix: add conditional rendering for payment data in credit packages 2025-09-05 00:00:16 +08:00
javayhu
48c045fb73 fix: add loading state handling in credit packages 2025-09-04 23:46:32 +08:00
javayhu
3fd47869a2 chore: update VSCode settings to exclude additional file types 2025-09-04 23:00:53 +08:00
javayhu
e3ac4a0a29 Merge remote-tracking branch 'origin/main' into cloudflare 2025-09-03 01:19:48 +08:00
javayhu
47adbcfd06 refactor: move premium related components to new folder 2025-09-03 01:10:03 +08:00
javayhu
5d5eb82013 feat: docs support premium content 2025-09-03 01:09:01 +08:00
javayhu
b0a065ced9 Merge remote-tracking branch 'origin/main' into cloudflare 2025-09-03 00:08:21 +08:00
javayhu
794c18a7e6 fix: fix localized callback url after login 2025-09-02 23:51:29 +08:00
javayhu
9899e1d164 fix: update billing card to reflect period end date and adjust related translations 2025-09-02 23:08:37 +08:00
javayhu
ad1cbedb56 Merge remote-tracking branch 'origin/main' into cloudflare 2025-09-02 00:18:06 +08:00
javayhu
3707500ed8 feat: optimize fetching subscription period start and end time 2025-09-02 00:16:10 +08:00
javayhu
f36018945d fix: change message component background color 2025-09-01 23:47:31 +08:00
javayhu
9f5d4aec59 chore: update ai elements 2025-09-01 23:44:18 +08:00
javayhu
e3f44a85a5 Merge remote-tracking branch 'origin/main' into cloudflare 2025-09-01 00:14:08 +08:00
javayhu
1f9a7c2621
Merge pull request #86 from MkSaaSHQ/dev/blog-premium
feat: premium content in blog posts
2025-08-31 22:03:43 +08:00
javayhu
a92ef86a71 fix: clarify test card number format and clean up imports in page component 2025-08-31 21:58:05 +08:00
javayhu
e2dfab2ca7 fix: update categories from "development" to "product" in premium blog post files 2025-08-31 21:44:14 +08:00
javayhu
e5061b3b67 custom: correct typo in source.config.ts and add premium content translations 2025-08-31 21:40:30 +08:00
javayhu
4faa89c0ee custom: replace premium Fumadocs blog post and integrate premium badge display 2025-08-31 21:40:09 +08:00
javayhu
481f3268db feat: implement premium access checks and enhance premium content handling in blog posts 2025-08-31 21:39:52 +08:00
javayhu
66d7dd3259 feat: add premium content feature with related components and configuration 2025-08-31 21:39:40 +08:00
javayhu
9aeb59dff2 chore: update .dockerignore, .gitignore, and biome.json to include .conductor directory 2025-08-31 16:50:13 +08:00
javayhu
2faedc2043 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-30 22:30:44 +08:00
javayhu
c0aa979382 chore: clean up imports and improve formatting in CreditsPageClient component 2025-08-30 00:24:12 +08:00
javayhu
fa2e981c16 fix: fix URL params when switch to balance from transactions 2025-08-28 23:23:52 +08:00
javayhu
0c415ee24b Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-28 10:09:34 +08:00
javayhu
21eee041ab
Merge pull request #85 from MkSaaSHQ/dev/nuqs
feat: integrate with nuqs for users and credit transaction tables
2025-08-28 01:10:48 +08:00
javayhu
6c584c75e2 feat: enhance CreditTransactions component with loading skeleton and refactor state management using useQueryStates 2025-08-28 01:08:48 +08:00
javayhu
797ee9b7e5 feat: add nuqs package and integrate NuqsAdapter in layout and users page components 2025-08-28 00:47:37 +08:00
javayhu
658409cfbd Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-27 00:53:02 +08:00
javayhu
422c323467 chore: replace Image component with BlogImage for improved loading handling in BlogCard 2025-08-27 00:45:09 +08:00
javayhu
de7e87e5b8 chore: update Skeleton component styles 2025-08-27 00:35:00 +08:00
javayhu
613bbd0d78 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-26 00:50:03 +08:00
javayhu
4434f1900d chore: remove deprecated Discord widget and related configurations 2025-08-26 00:48:39 +08:00
javayhu
895e02bfdd chore: update .dockerignore and biome.json to include new directories and remove unused object-values type 2025-08-26 00:20:27 +08:00
javayhu
7cc1fd5835 refactor: update website configuration structure to use 'ui' instead of 'metadata' for theme and mode settings 2025-08-26 00:16:55 +08:00
javayhu
4bad9714fa refactor: remove BlockCategory pages, and BlockPreview components 2025-08-25 23:43:45 +08:00
javayhu
fa4b9a19a1 refactor: remove service worker and related registration utilities 2025-08-25 23:39:10 +08:00
javayhu
1c0c46fa34 Revert "feat: enhance credit hooks to trigger updates on store changes"
This reverts commit 7851a715a3.
2025-08-25 10:01:54 +08:00
javayhu
0ae3f27c78 refactor: change default website mode from 'system' to 'dark' in website configuration 2025-08-25 10:00:45 +08:00
javayhu
fc024ea0da refactor: simplify layout of ChatBot and ImagePlayground components, update model configuration in web content analyzer 2025-08-25 10:00:28 +08:00
javayhu
80851fcf44 refactor: remove credit-related functionality and components from the web content analysis module 2025-08-25 09:48:20 +08:00
javayhu
31829ce17b feat: add ConsumeCreditsCard component for credit consumption functionality 2025-08-25 09:23:27 +08:00
javayhu
7c9b0a2697 refactor: remove ConsumeCreditCard component and integrate its functionality into ConsumeCreditsCard 2025-08-25 09:22:56 +08:00
javayhu
5f14259197 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-24 22:34:35 +08:00
javayhu
15da1ee48a refactor: update global styles with a custom theme inspired by Qoder, adjusting color variables and shadow effects 2025-08-24 21:16:41 +08:00
javayhu
c2d7e51f5b refactor: update HeroSection component styles to use accent color for hover state and simplify layout 2025-08-24 21:15:48 +08:00
javayhu
00405d5335 refactor: update text colors in BlogPostPage, FeaturesSection, and HeaderSection components to use primary color 2025-08-24 21:10:08 +08:00
javayhu
610346055f refactor: update navbar component styles to use accent foreground for active and hover states 2025-08-24 21:01:36 +08:00
javayhu
cb9c3132fd refactor: update CardFooter background color from bg-background to bg-muted across multiple components 2025-08-24 20:34:50 +08:00
javayhu
32fc3d6dc9 chore: simplify BlogCard component by removing unnecessary span styling and enhancing border effects 2025-08-24 20:11:24 +08:00
javayhu
69143ace47 feat: implement error handling in getCreditBalanceAction and add CreditsTest component for credit consumption testing 2025-08-24 19:55:53 +08:00
javayhu
8c3ef9bfaf refactor: remove unused heading elements from AIAudioPage and AIVideoPage components 2025-08-24 19:41:02 +08:00
javayhu
7851a715a3 feat: enhance credit hooks to trigger updates on store changes 2025-08-24 19:26:54 +08:00
javayhu
0fb4ef93d2 chore: add CreditsTest component 2025-08-24 19:26:49 +08:00
javayhu
95a6f3b9d5 feat: update AI Chat, add ChatBot component 2025-08-24 15:36:20 +08:00
javayhu
0794c7d297 feat: add AI Chat route and localization support in English and Chinese 2025-08-24 11:39:04 +08:00
javayhu
395f753025 refactor: remove TypeScript error comments from CodeBlock component 2025-08-24 11:32:43 +08:00
javayhu
fc53045d99
Merge pull request #82 from MkSaaSHQ/dev/ai-elements
feat: AI Chat demo with ai elements
2025-08-24 11:27:58 +08:00
javayhu
64ba2711aa feat: implement AI chat functionality with new API route and chat component 2025-08-24 11:26:06 +08:00
javayhu
3a61c953a4 chore: add ai-elements to biome.json for component inclusion 2025-08-24 10:39:52 +08:00
javayhu
6de7dfebf3 chore: update shadcnui badge and scroll-area components 2025-08-24 10:38:30 +08:00
javayhu
e626bb9af4 feat: add ai-elements components 2025-08-24 10:37:37 +08:00
javayhu
33fe00b8dc chore: mark lastRefreshAt field as deprecated in userCredit schema 2025-08-24 10:22:31 +08:00
javayhu
2d0392db61 refactor: update credit eligibility checks to use canAddCreditsByType function for improved clarity and maintainability 2025-08-24 10:03:35 +08:00
javayhu
afdaeba2be refactor: remove updateUserLastRefreshAt function and its calls to streamline credit update logic 2025-08-24 09:56:19 +08:00
javayhu
258ddad399 refactor: consolidate credit addition logic into a single function to improve maintainability and clarity 2025-08-24 09:24:59 +08:00
javayhu
e6bc1ea9e8 refactor: rename 'credits' to 'amount' in credit-related configurations and components for consistency 2025-08-24 01:16:39 +08:00
javayhu
96d630f3ac chore: add new hostname configuration for service.firecrawl.dev in Next.js config 2025-08-24 00:52:06 +08:00
javayhu
e15d76461f feat: add function to check if subscription credits can be added based on last refresh time 2025-08-23 20:21:54 +08:00
javayhu
1ff42009d8 chore: update function parameters planId instead of priceId 2025-08-23 20:07:32 +08:00
javayhu
669ac94bad chore: update comments to reflect renaming of enableForFreePlan to enablePackagesForFreePlan for clarity 2025-08-23 17:18:37 +08:00
javayhu
d319bd8af2 chore: rename enableForFreePlan to enablePackagesForFreePlan for clarity in credits configuration 2025-08-23 10:20:30 +08:00
javayhu
01f5734dd5 chore: update credit expiration messaging and logic to reflect upcoming expiration in days 2025-08-23 09:52:28 +08:00
javayhu
6837c5a8d4 chore: simplify CreditsBalanceCard layout 2025-08-23 09:05:12 +08:00
javayhu
6927f4b234 chore: adjust skeleton component heights in billing and password cards for improved loading state visibility 2025-08-23 09:00:13 +08:00
javayhu
ffe5bc4ea5 chore: update PasswordCardWrapper to include CardFooter with skeleton loading state 2025-08-23 08:55:02 +08:00
javayhu
1be26638fc chore: update billing card rendering logic to include payment data check 2025-08-23 08:23:54 +08:00
javayhu
c66fedea27 chore: update upgrade card visibility logic to ensure data is loaded before rendering 2025-08-23 07:51:37 +08:00
javayhu
b4dab95c04 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-23 00:14:47 +08:00
javayhu
1e1cafff32 chore: delete loading component for protected routes 2025-08-23 00:08:33 +08:00
javayhu
23ddb90e1f chore: remove loading components for protected routes 2025-08-22 23:52:58 +08:00
javayhu
8221f1753f Merge branch 'cloudflare' of https://github.com/MkSaaSHQ/mksaas-template into cloudflare 2025-08-22 01:17:47 +08:00
javayhu
18691030e7 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-22 01:17:38 +08:00
javayhu
7f4a7a61a2 refactor: enhance captcha handling in login and register forms with reset functionality 2025-08-22 01:12:13 +08:00
javayhu
a6a5d92dc1 refactor: implement batch processing for expired credits in credit cron job 2025-08-22 00:39:17 +08:00
javayhu
63a5e4f328 refactor: remove subscription and lifetime credits logic from credit stats and balance card 2025-08-22 00:04:40 +08:00
javayhu
19120ee7f1 refactor: replace password card logic with useHasCredentialProvider hook 2025-08-21 23:54:28 +08:00
javayhu
7aa7cb5603 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-21 10:04:48 +08:00
javayhu
d644611afd refactor: remove TANSTACK_QUERY_REFACTOR.md 2025-08-21 10:04:27 +08:00
javayhu
ca30f95027 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-21 09:59:28 +08:00
javayhu
8cc16a898c
Merge pull request #81 from MkSaaSHQ/dev/tanstack-query
feat: add tanstack query to optimize performance
2025-08-21 09:55:45 +08:00
javayhu
cf8a7f1242 refactor: optimize credits balance card logic after successful payment 2025-08-21 09:50:40 +08:00
javayhu
1fb89a2a05 refactor: enhance credit balance and stats hooks with improved error handling and logging 2025-08-21 01:48:40 +08:00
javayhu
13c23dab56 refactor: migrate state management from Zustand to TanStack Query for improved data fetching and caching across components 2025-08-21 00:54:40 +08:00
javayhu
ac8d4dee4b refactor: replace usePayment hook and store with useCurrentPlan for improved payment state management 2025-08-21 00:50:12 +08:00
javayhu
ff1e72df13 refactor: replace useCredits hook with custom hooks for credit balance, consumption, and transactions management 2025-08-21 00:27:26 +08:00
javayhu
d153ca655e refactor: implement custom hooks for user management and ban/unban user 2025-08-20 23:52:06 +08:00
javayhu
c00223c79a refactor: replace server actions with custom hooks for newsletter management and improve loading/error handling 2025-08-20 22:39:20 +08:00
javayhu
d59be1044a feat: add QueryProvider to manage React Query client and wrap Providers component 2025-08-20 22:37:52 +08:00
javayhu
5431160d62 chore: add @tanstack/react-query-devtools 2025-08-20 22:37:39 +08:00
javayhu
73baf946bd chore: add @tanstack/react-query and @tanstack/eslint-plugin-query 2025-08-20 22:04:19 +08:00
javayhu
d747683f82 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-20 00:20:22 +08:00
javayhu
978f13a368 refactor: remove unnecessary Skeleton component in billing and credits balance cards 2025-08-20 00:18:02 +08:00
javayhu
779493965c chore: remove images in about page 2025-08-20 00:13:26 +08:00
javayhu
3ae0411a44 chore: remove bg div in features section 2025-08-19 23:25:28 +08:00
javayhu
ccf064b0d5 chore: optimize pricing card badge 2025-08-19 23:09:41 +08:00
javayhu
b55613b471 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-18 00:59:21 +08:00
javayhu
7c0e6a5131 chore: enhance error handling and optimize database queries in user credit functions 2025-08-18 00:58:46 +08:00
javayhu
d86f89e3de fix: update URL routing in credits balance card component after successful payment 2025-08-18 00:45:51 +08:00
javayhu
9800b1d842 refactor: update CardFooter in credits balance card component 2025-08-18 00:42:53 +08:00
javayhu
9db52f352b refactor: adjust spacing in credits page layout and comment out button in credits balance card 2025-08-18 00:36:42 +08:00
javayhu
47679ab91e Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-18 00:32:31 +08:00
javayhu
90757475ac refactor: implement credits page with balance and transactions tabs 2025-08-18 00:29:56 +08:00
javayhu
904dceec44 refactor: update billing and credits pages & move credit balance and packages to credits page 2025-08-18 00:19:35 +08:00
javayhu
f468638f49 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-17 23:27:24 +08:00
javayhu
f1d02720d0 refactor: restructure credit distribution logic and enhance user credit handling 2025-08-17 23:26:10 +08:00
javayhu
35ddf5e08e Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-17 08:45:27 +08:00
javayhu
bade6b620e refactor: enhance error handling in credit balance retrieval 2025-08-16 23:08:16 +08:00
javayhu
d1928575b3 refactor: replace createSafeActionClient with userActionClient for improved session handling across multiple actions 2025-08-16 23:00:21 +08:00
javayhu
262228d6e9 feat: add session validation for admin access in getUsersAction 2025-08-16 22:03:01 +08:00
javayhu
57b92cfe85 feat: add script of listing users emails 2025-08-16 13:51:12 +08:00
javayhu
9f2fd58eb0 feat: optimize loading state in login and register forms 2025-08-16 10:48:58 +08:00
javayhu
1f7c38f9f5 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-16 08:19:56 +08:00
javayhu
9f71c9942a chore: optimize the colors of componnets in home page 2025-08-16 01:39:11 +08:00
javayhu
e99d6da45c chore: update blog card category bg 2025-08-16 00:39:43 +08:00
javayhu
63dd4e52fb Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-15 23:03:55 +08:00
javayhu
debbb5abf5 feat: support disable storage module 2025-08-15 22:51:48 +08:00
javayhu
c5dfaafe61 chore: optimize distributing credits when user sign up 2025-08-15 22:40:59 +08:00
javayhu
df3f3aa895 feat: support disable newsletter module 2025-08-15 22:39:29 +08:00
javayhu
a1ae6ca384 feat: support disable docs module 2025-08-15 22:23:28 +08:00
javayhu
866988d73c feat: support disable blog module 2025-08-15 22:20:15 +08:00
javayhu
46fd529390 refactor: add isDemo function 2025-08-15 22:10:01 +08:00
javayhu
fbb9a1b053 chore: update size of youtube video component 2025-08-15 20:25:37 +08:00
javayhu
200a9963f7 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-15 00:41:00 +08:00
javayhu
f6a2df402e fix: fix rate limit for newsletter subscription when sign up 2025-08-15 00:37:30 +08:00
javayhu
0da8f7d335 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-15 00:10:26 +08:00
javayhu
335c3b46d6 fix: fix build error in newsletter form validation 2025-08-15 00:06:28 +08:00
javayhu
004edeecea Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-14 23:14:32 +08:00
javayhu
f2b5bae866 feat: upgrade react-hook-form & zod & @hookform/resolvers
fix zod validation errors in form submission
2025-08-14 23:12:44 +08:00
javayhu
6bb12a2d86 Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-11 07:41:56 +08:00
javayhu
a1b54d7518 chore: update env example 2025-08-11 07:41:29 +08:00
javayhu
97654d97ea Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-11 07:36:28 +08:00
javayhu
064576f48e refactor: streamline user payment retrieval by utilizing a subquery for latest active payments 2025-08-10 15:54:46 +08:00
javayhu
0be53d3251 feat: optimize credit distribution by batching user processing and enhancing database queries 2025-08-10 14:26:53 +08:00
javayhu
564efbd3e2 feat: increase maxDuration for API functions in vercel.json from 60 to 300 seconds 2025-08-10 14:02:49 +08:00
javayhu
2814f87578 feat: update user last refresh time and refine user selection criteria 2025-08-10 13:53:48 +08:00
javayhu
78f76f35b9 feat: add basic auth to distribute credits cron jobs 2025-08-10 11:48:53 +08:00
javayhu
f50f60443a
Merge pull request #79 from MkSaaSHQ/dev/cron-jobs
support cron jobs
2025-08-10 11:16:48 +08:00
javayhu
346d154604 feat: support cron jobs 2025-08-10 11:13:21 +08:00
javayhu
7985769871 refactor: remove inngest 2025-08-10 11:07:10 +08:00
javayhu
aa2e025270 cf: update cloudflare env types 2025-08-09 13:12:42 +08:00
javayhu
11bfcb731d cf: upgrade version of opennextjs and wrangler 2025-08-09 10:13:32 +08:00
javayhu
62eb4124be Merge remote-tracking branch 'origin/main' into cloudflare 2025-08-03 15:20:14 +08:00
javayhu
2b72570784 feat: support openrouter in ai text (not stable for now) 2025-08-03 11:17:39 +08:00
javayhu
3c3dcd5d2a feat: upgrade zod v4 & use error instead of message
https://zod.dev/v4/changelog?id=deprecates-message
2025-08-03 00:35:22 +08:00
javayhu
89fd7193ac feat: upgrade to zod v4 & fix z.url() and z.email()
https://zod.dev/v4/changelog?id=zstring-updates
2025-08-03 00:32:44 +08:00
javayhu
8b2f1848a8 feat: upgrade zod to v4 2025-08-02 01:00:15 +08:00
javayhu
d0ddc2b1b0 feat: upgrade ai sdk to v5
https://v5.ai-sdk.dev/docs/migration-guides/migration-guide-5-0
2025-08-02 00:54:34 +08:00
javayhu
6d4d316564 chore: remove google vertex ai 2025-08-02 00:22:02 +08:00
javayhu
7a61aa3dff chore: update google api key var name 2025-08-01 21:39:20 +08:00
javayhu
46ec614fd3 refactor: move CreditsProvider 2025-07-28 22:53:31 +08:00
javayhu
abb15de848 fix: reset enable update avatar by default 2025-07-26 22:52:34 +08:00
javayhu
ba2a2b5fb0 feat: support disable update avatar in settings 2025-07-26 22:50:53 +08:00
javayhu
2b8e0b9cb5 feat: add checks for Stripe environment variables in getActiveSubscriptionAction 2025-07-25 23:18:42 +08:00
javayhu
d7cc9b956d Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-24 01:17:23 +08:00
javayhu
0b695cc4b2 feat: add credits configuration checks in hooks and provider 2025-07-24 01:16:55 +08:00
javayhu
3cb0911cf4 fix: ensure current user is only displayed when component is mounted 2025-07-24 01:14:53 +08:00
javayhu
0d04f6914e refactor: optimize credits rendering by memoizing and moving checks before hooks 2025-07-24 00:51:57 +08:00
javayhu
22d68c005a refactor: optimize credits rendering by memoizing and moving checks before hooks 2025-07-24 00:50:23 +08:00
javayhu
70446d10b3 Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-24 00:10:11 +08:00
javayhu
bc4578a3cd chore: remove credits disabled check in credits components 2025-07-24 00:04:42 +08:00
javayhu
971b0d65a0 chore: support google gemini and deepseek in ai text demo 2025-07-23 00:26:58 +08:00
javayhu
313c783dbd Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-20 14:44:58 +08:00
javayhu
4384a1d43f feat: add session id to payment table & fix duplicate one time payment process 2025-07-20 14:38:20 +08:00
javayhu
7b9b7a0dd7 chore: handle internal docs link redirection for internationalization 2025-07-20 13:02:41 +08:00
javayhu
07ad39871f custom: support intl in a/card components of docs page 2025-07-20 12:56:06 +08:00
javayhu
3d4245e8bc feat: add indexes to database tables 2025-07-19 16:40:36 +08:00
javayhu
cc56f9d729 Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-19 15:15:42 +08:00
javayhu
5912849fa7
Merge pull request #71 from MkSaaSHQ/dev/ai-text
feat: add ai text demo
2025-07-19 14:51:03 +08:00
javayhu
3075681dc8 feat: add ai text demo & scraping and analyzing the web content from URL 2025-07-19 14:41:12 +08:00
javayhu
757f1dc4ae feat: support crisp chat 2025-07-18 23:33:07 +08:00
javayhu
1be38e3e8d feat: support disable credential login 2025-07-18 22:04:39 +08:00
javayhu
716eac324f chore: add captcha validation to login form 2025-07-18 21:15:55 +08:00
javayhu
bd029eac2a chore: disable turnstile and credits by default, enable on demo website 2025-07-18 20:41:43 +08:00
javayhu
2c4db1e744 chore: update Captcha component 2025-07-18 20:37:59 +08:00
javayhu
cb7743fe07 refactor: remove scrollbar hiding styles and adjust overflow for scroll-locked state 2025-07-14 22:37:25 +08:00
javayhu
3a81a96316 refactor: add opennext and wrangler folder to the ignore patterns in biome.json 2025-07-14 22:27:22 +08:00
javayhu
d7077cb3d4 refactor: enable useEditorconfig option to biome.json
https://biomejs.dev/reference/configuration/#formatteruseeditorconfig
2025-07-14 22:19:31 +08:00
javayhu
e5569dabd1 Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-13 23:04:14 +08:00
javayhu
0d5185a789 refactor: remove unused env NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY 2025-07-13 23:03:58 +08:00
javayhu
813d8ea0bb Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-13 23:02:55 +08:00
javayhu
a8c76d3249 refactor: integrate useMounted hook to fix hydration error in BillingCard and CreditsBalanceCard 2025-07-13 22:59:26 +08:00
javayhu
49b39ad9dd refactor: update credit checkout session callback param name 2025-07-13 22:40:20 +08:00
javayhu
1adf3d5dc3 refactor: simplify success toast handling and refresh logic in CreditsBalanceCard 2025-07-13 22:39:28 +08:00
javayhu
5e877bf45e refactor: update cache duration to 2 minutes 2025-07-13 21:43:15 +08:00
javayhu
4277970074 refactor: enhance logging in StripeProvider to improve security and clarity by hiding sensitive information 2025-07-13 15:44:03 +08:00
javayhu
b27d8cc505 refactor: add retry functionality for payment and credits data fetching with improved user experience 2025-07-13 15:15:44 +08:00
javayhu
2d2a85cd26 refactor: enhance fetch logic in useCredits and usePayment hooks for improved clarity and consistency 2025-07-13 14:31:35 +08:00
javayhu
c960738133 refactor: streamline session handling in payment and credits providers 2025-07-13 14:25:56 +08:00
javayhu
bf8993ca96 refactor: update payment renewal logic to enhance credit handling 2025-07-13 09:40:46 +08:00
javayhu
a89910489a refactor: rename addSubscriptionRenewalCredits to addSubscriptionCredits for clarity 2025-07-13 09:26:16 +08:00
javayhu
368644b434
Merge pull request #64 from MkSaaSHQ/dev/credits-v2
[feat] support credits v2
2025-07-13 00:57:08 +08:00
javayhu
f5e639bbc7 refactor: improve plan filtering in credits logic 2025-07-13 00:53:31 +08:00
javayhu
52aeb2d61c refactor: rename functions to remove 'IfNeed' suffix for clarity and consistency 2025-07-13 00:37:01 +08:00
javayhu
7af313868c refactor: rename resetState to resetCreditsState and remove unused updateBalanceOptimistically method 2025-07-13 00:36:02 +08:00
javayhu
4313e32471 refactor: conditionally render credits-related components based on configuration 2025-07-13 00:09:05 +08:00
javayhu
31116cbf8b refactor: remove unused Stripe dependency and update credit expiration logic 2025-07-12 23:41:50 +08:00
javayhu
8a08dfdf3b refactor: update feature labels and standardize FAQ component naming in zh.json 2025-07-12 22:42:03 +08:00
javayhu
141b562307 refactor: improve loading state management in billing page 2025-07-12 22:36:17 +08:00
javayhu
9fcfb3bdf7 refactor: update credit and transaction messages 2025-07-12 22:14:04 +08:00
javayhu
8be9f6c775 style: update text colors in billing and credits balance cards for improved visibility 2025-07-12 21:32:29 +08:00
javayhu
ac02ea780a feat: add credit statistics in credits balance card 2025-07-12 21:29:28 +08:00
javayhu
e3aa8eab55 feat: add support for free plan users in credit packages and update billing card layout 2025-07-12 20:23:23 +08:00
javayhu
72e0a14fc9 refactor: improve layout consistency in settings pages by adjusting grid structures 2025-07-12 19:46:27 +08:00
javayhu
0f79ed14f0 refactor: standardize string quotes and improve formatting in components 2025-07-12 19:29:47 +08:00
javayhu
ee341522f5 feat: enhance billing and credits management with new components and improved layout 2025-07-12 19:29:21 +08:00
javayhu
b4e8585929 chore: add credits when subscription renewal and lifetime payment 2025-07-12 17:27:35 +08:00
javayhu
b5997ded4c feat: add payment success message and improve billing card layout 2025-07-12 17:03:16 +08:00
javayhu
367965e41f feat: ensure handler session id only once in credit package 2025-07-12 12:46:57 +08:00
javayhu
c7a1ec69bb feat: add ConsumeCreditCard component for credit consumption 2025-07-12 11:08:28 +08:00
javayhu
4160305a67 chore: update env.example with Inngest keys 2025-07-12 09:59:30 +08:00
javayhu
a5c6c8b493 feat: display user email and customer ID in UserDetailViewer 2025-07-12 08:10:31 +08:00
javayhu
4abca022aa feat: restrict access to current user's transactions 2025-07-12 00:59:06 +08:00
javayhu
765f5e1e39 feat: add register gift and monthly refresh credits to new user 2025-07-12 00:55:27 +08:00
javayhu
9f3c5e80c2 feat: add daily credit distribution function and integrate with existing credits logic 2025-07-12 00:37:49 +08:00
javayhu
997c362ac9 chore: add inngest package and update client initialization 2025-07-11 23:53:46 +08:00
javayhu
bda2571a78 chore: invoke function from code in inngest 2025-07-11 23:31:54 +08:00
javayhu
788fbe2f18 chore: inngest explore 2025-07-11 23:31:45 +08:00
javayhu
f45bcad110 feat: update UsersTable component to enhance column sizing and loading state handling 2025-07-11 22:24:02 +08:00
javayhu
75db5e85a7 feat: enhance sorting functionality in tables by implementing dropdown menus 2025-07-11 22:10:04 +08:00
javayhu
9711d13804 refactor: optimize user fetching logic in UsersPageClient component by using useCallback for fetchUsers function 2025-07-11 01:38:54 +08:00
javayhu
9d4fcbe36d refactor: remove useCreditTransactionStore and related logic from credits components, streamline useCredits integration 2025-07-11 01:35:31 +08:00
javayhu
e6663b013d refactor: replace getCreditBalanceAction with useCredits hook in credits-related components 2025-07-11 01:10:43 +08:00
javayhu
5cb8b0048d feat: add CreditsProvider and credits store for managing user credits 2025-07-11 00:19:20 +08:00
javayhu
0b6f81aca6 refactor: replace useTransactionStore with useCreditTransactionStore in credit-related components 2025-07-10 23:27:43 +08:00
javayhu
6cf9d4db9c refactor: improve credit transaction filtering in processExpiredCredits and consumeCredits functions 2025-07-10 22:53:04 +08:00
javayhu
59c7c807db refactor: rename PURCHASE to PURCHASE_PACKAGE in transaction types 2025-07-10 22:52:26 +08:00
javayhu
de1ccca27b feat: implement consume credits action and get credit balance action, update credits balance references 2025-07-10 22:00:33 +08:00
javayhu
263440742a feat: add CreditDetailViewer component and enhance credit transaction details in English and Chinese 2025-07-10 21:43:43 +08:00
javayhu
b75e9eb282 refactor: initialize sorting state with default value in UsersPage and CreditTransactionsPage components 2025-07-10 19:40:08 +08:00
javayhu
2aeb027e2f feat: add subscription renewal and lifetime monthly messages in English and Chinese 2025-07-10 19:34:06 +08:00
javayhu
0500617803 style: adjust padding in dashboard header actions 2025-07-10 19:21:09 +08:00
javayhu
3872a9d422 refactor: remove session_id from URL parameters in CreditPackages component 2025-07-10 19:20:11 +08:00
javayhu
2e0a195a2a refactor: update URL handling in CreditPackages component 2025-07-10 16:48:29 +08:00
javayhu
95bd256bc7 chore: remove onPaymentIntentSucceeded in stripe 2025-07-10 16:31:57 +08:00
javayhu
6c1a4685cd refactor: add disabled to credits config 2025-07-10 16:30:56 +08:00
javayhu
bbae584c88 fix: update DashboardHeaderand update credits label in CreditsBalanceMenu to use translations 2025-07-10 15:56:15 +08:00
javayhu
f649db26ae feat: add CreditsBalanceButton and CreditsBalanceMenu components 2025-07-10 15:41:11 +08:00
javayhu
1c7848f6b0 refactor: change getAllCreditPackagesInServer to getAllCreditPackages 2025-07-10 15:06:58 +08:00
javayhu
5c213d014a refactor: 'popular' instead of 'recommended' for price plan 2025-07-10 14:54:07 +08:00
javayhu
861502c28f feat: implement credit distribution for all users based on subscription status 2025-07-10 14:52:23 +08:00
javayhu
737bd7f80f feat: enhance credits management with subscription renewal and lifetime monthly credits 2025-07-10 14:42:36 +08:00
javayhu
74d7cf44a1 Merge branch 'dev/credits-v2' of https://github.com/MkSaaSHQ/mksaas-template into dev/credits-v2 2025-07-10 10:54:10 +08:00
javayhu
e011d09803 feat: enhance CreditPackages component with loading indicator 2025-07-10 10:54:07 +08:00
javayhu
50c500deb5 refactor: streamline credit handling in StripeProvider
- Updated StripeProvider to retrieve priceId from session metadata instead of line items.
- Introduced credit package retrieval to include expiration information when adding credits.
- Enhanced logging to reflect credit expiration details during credit addition.
- Removed obsolete code related to priceId retrieval for improved clarity and maintainability.
2025-07-10 10:15:42 +08:00
javayhu
cd710bb9ed feat: support register gift credits 2025-07-10 09:58:48 +08:00
javayhu
04f7f891a4 feat: update credit expiration handling and configuration
- Added expireDays property to credit packages and related configurations in website.tsx for better management of credit expiration.
- Modified addCredits function to handle expireDays more flexibly, allowing for undefined values.
- Updated functions for adding register gift and monthly free credits to utilize the new expireDays configuration.
- Enhanced type definitions for credits to include optional expireDays for improved clarity.
- Removed obsolete creditExpireDays from the credits configuration to streamline the codebase.
2025-07-10 01:12:11 +08:00
javayhu
c67b804f4f Merge branch 'cloudflare' of https://github.com/MkSaaSHQ/mksaas-template into cloudflare 2025-07-10 00:48:21 +08:00
javayhu
a44e4a669c Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-10 00:48:17 +08:00
javayhu
5af1182a58 chore: enhance .gitattributes for consistent line endings across various file types 2025-07-09 23:07:00 +08:00
javayhu
24c0334911 chore: add .gitattributes file and update VSCode extensions 2025-07-09 22:51:50 +08:00
javayhu
3e0861f883 fix: update sidebar rendering logic and enhance credit package success toast
- Updated DashboardSidebar to conditionally render SidebarMain based on loading state.
- Modified CreditPackages to trigger a refresh of credits data and show success toast with a delay to avoid React lifecycle conflicts.
2025-07-09 21:58:35 +08:00
javayhu
da4b018e8d Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-09 19:14:30 +08:00
javayhu
a7738f0cbf feat: implement credit checkout session and enhance credit package management
- Added new credit checkout session functionality to facilitate credit purchases.
- Introduced credit package configurations in env.example for better management.
- Updated English and Chinese JSON files with new messages for checkout processes.
- Refactored existing components to utilize the new credit checkout session and streamline the credit purchasing workflow.
- Removed obsolete payment intent handling to simplify the codebase.
2025-07-09 00:22:07 +08:00
javayhu
adb9b80572 fix: update default expireDays assignment in addCredits function 2025-07-08 00:51:04 +08:00
javayhu
2e8f70dc76 feat: enhance credits management with new configurations
- Added credit expiration days, register gift credits, and free monthly credits options in website configuration.
- Updated credits handling functions to utilize the new configuration settings for improved flexibility and maintainability.
- Removed obsolete constants related to credits from constants.ts to streamline the codebase.
- Enhanced type definitions for credits configuration in index.d.ts for better clarity.
2025-07-08 00:48:17 +08:00
javayhu
b94fd34be5 Merge remote-tracking branch 'origin/main' into dev/credits 2025-07-08 00:32:08 +08:00
javayhu
0d4e8fe899 docs: add CLAUDE.md for project guidance 2025-07-08 00:30:40 +08:00
javayhu
73ce18f564 refactor: update credit package descriptions and improve component structure
- Revised credit package descriptions in the English JSON file for clarity and consistency.
- Refactored CreditPackages component to utilize a more efficient method for retrieving credit packages.
- Removed obsolete functions and streamlined the code for better maintainability and performance.
2025-07-07 01:10:06 +08:00
javayhu
e430a0c319 feat: implement credit packages management with translations and server integration
- Added new credit packages structure in English and Chinese JSON files for better localization.
- Introduced server-side functions to retrieve credit packages and package details.
- Updated client-side components to utilize new credit package retrieval methods.
- Refactored existing code to enhance modularity and maintainability by separating client and server logic.
- Removed obsolete credit package retrieval functions to streamline the codebase.
2025-07-07 00:47:43 +08:00
javayhu
f7f7be2ef0 feat: add credits config in website config
- Added a new credits management system with configurable credit packages in website.tsx.
- Replaced hardcoded credit package definitions with a dynamic retrieval system using getCreditPackages and getCreditPackageById functions.
- Updated CreditPackages and StripePaymentForm components to utilize the new credit package structure.
- Removed obsolete CREDIT_PACKAGES constant from constants.ts to streamline the codebase.
- Enhanced type definitions for credit packages in types.ts for better clarity and maintainability.
- Updated README.md to reflect changes in credit packages configuration.
2025-07-07 00:04:45 +08:00
javayhu
eafb3775e8 Merge remote-tracking branch 'origin/main' into dev/credits 2025-07-06 23:28:31 +08:00
javayhu
0af0aa3b09 refactor: reorganize credit transaction types and update imports
- Moved CREDIT_TRANSACTION_TYPE from constants to a new types.ts file for better modularity.
- Updated import paths in credit-related components to reflect the new structure.
- Removed the old CREDIT_TRANSACTION_TYPE definition from constants.ts to streamline the codebase.
2025-07-06 23:25:38 +08:00
javayhu
04c2b2d7ee refactor: update translations and improve table component structure
- Removed unused translation keys from English and Chinese JSON files.
- Updated UsersTable and CreditTransactionsTable components to utilize a centralized translation function for table-related messages.
- Initialized sorting state in both table components for consistent default behavior.
2025-07-06 18:20:31 +08:00
javayhu
d9cda3e122 feat: enhance credits settings with tabbed interface and improved translations
- Implemented a tabbed interface in the CreditsPage component to separate balance and transactions views.
- Updated CreditPackages and CreditTransactionsPageClient components to utilize the new tab structure.
- Enhanced translation support for credits-related messages in both English and Chinese.
- Improved error handling and user feedback in credit-related components.
- Refactored CreditTransactionsTable to utilize translations for table headers and pagination controls.
2025-07-06 17:17:24 +08:00
javayhu
d8a12343c8 refactor: adjust spacing in layout components for consistency
- Updated spacing from `space-y-10` to `space-y-8` in layout components for Billing, Credits, Notifications, Profile, and Security to ensure uniformity across the settings pages.
2025-07-06 11:30:10 +08:00
javayhu
40af0f6922 feat: add credit transactions table
- Introduced a new CreditTransactionsPageClient component to display credit transactions.
- Implemented getCreditTransactions action for fetching transaction data.
- Added CreditTransactionsTable component for rendering transaction details with pagination and sorting.
- Updated English and Chinese translation files to include credit transaction messages.
- Integrated the credit transactions page into the existing credits settings layout.
2025-07-06 10:44:13 +08:00
javayhu
1740c826c7 feat: add CreditsBalance component and integrate into dashboard and navbar
- Introduced a new CreditsBalance component to display user credits.
- Integrated CreditsBalance into DashboardHeader, Navbar, and NavbarMobile for improved visibility of user credits.
- Enhanced user interaction by allowing navigation to the credits settings page.
2025-07-06 00:41:57 +08:00
javayhu
75083b32e4 refactor: reorganize credit-related imports and enhance user feedback
- Updated import paths for credit-related actions and functions to improve module organization.
- Removed redundant refresh trigger declaration in CreditPackages component.
- Simplified success toast message in CreditPackages and PaymentForm components for clarity.
- Introduced a new credits.ts file to centralize credit management logic and improve maintainability.
2025-07-06 00:15:07 +08:00
javayhu
e933844479 feat: enhance credit management with transaction store and UI updates
- Added a new transaction store to manage refresh triggers for credit-related components.
- Updated CreditPackages and StripePaymentForm components to utilize the transaction store for refreshing UI after credit purchases.
- Modified .gitignore to include certificates.
- Introduced a new script in package.json for running the development server with HTTPS support.
2025-07-05 23:59:30 +08:00
javayhu
13bee49f90 feat: add credits section to avatar configuration and update translations
- Added "Credits" entry to the avatar configuration for navigation.
- Updated English and Chinese translation files to include "Credits" label.
- Refactored error messages in credit payment actions for clarity.
- Enhanced loading state management in CreditPackages component.
- Replaced icons in CreditPackages component for improved UI consistency.
2025-07-05 23:25:37 +08:00
javayhu
fe2b1bbe39 feat: add credit purchase functionality with Stripe integration
- Introduced credit purchase payment intent actions in credits.action.ts.
- Created new components for credit packages and Stripe payment form.
- Added routes and layout for credits settings page.
- Updated sidebar configuration to include credits settings.
- Enhanced constants for credit packages with detailed pricing and descriptions.
- Implemented loading and layout components for credits page.
- Integrated payment confirmation handling in Stripe provider.
2025-07-05 22:30:22 +08:00
javayhu
8a9c76c628 fix: add missing newline at end of index.zh.mdx file 2025-07-05 17:11:07 +08:00
javayhu
98421afab8 Merge remote-tracking branch 'origin/main' into dev/credits 2025-07-05 15:52:40 +08:00
javayhu
6980507c43 chore: update dashboard and setting pages layout 2025-07-05 15:51:36 +08:00
javayhu
8657bf4e84 chore: show theme selector in demo website only 2025-07-05 10:10:39 +08:00
javayhu
bab58e6420 chore: add @stripe/react-stripe-js 2025-07-05 00:25:11 +08:00
javayhu
8d17bd80c5 feat: implement admin access control in UsersLayout 2025-07-04 23:23:25 +08:00
javayhu
c7e3de816c chore: update credit related functions 2025-07-04 01:02:56 +08:00
javayhu
da26c2cf5d Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template into dev/credits 2025-07-02 23:46:20 +08:00
javayhu
b838ddc293 Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-02 22:53:01 +08:00
javayhu
cc9a15db8f chore: make DiscordWidget deprecated 2025-07-02 22:52:32 +08:00
javayhu
8e63af3e7f Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-02 01:15:29 +08:00
javayhu
aaadd7fcf4 fix: add type assertion for image generation response 2025-07-02 01:14:58 +08:00
javayhu
1e2e4d77f7 Merge remote-tracking branch 'origin/main' into cloudflare 2025-07-02 00:54:31 +08:00
javayhu
88bb977c7b Merge branch 'dev/credits' of https://github.com/MkSaaSHQ/mksaas-template into dev/credits 2025-07-01 00:23:25 +08:00
javayhu
abf8b31ec7 chore: optimize the credit functions 2025-07-01 00:23:21 +08:00
javayhu
12fb19e97b chore: add credit related tables 2025-07-01 00:23:21 +08:00
javayhu
d8904750d9 chore: fix db instance 2025-07-01 00:23:21 +08:00
javayhu
b30355dfe5 chore: update credit related functions (2) 2025-07-01 00:23:21 +08:00
javayhu
dae7a3b0e8 chore: update credits related functions (2) 2025-07-01 00:23:21 +08:00
javayhu
e0c0ff9518 chore: update credits related functions 2025-07-01 00:23:21 +08:00
javayhu
e1b0e2f44c feat: support credits 2025-07-01 00:23:21 +08:00
javayhu
6195df2bc5 chore: update readme 2025-07-01 00:02:51 +08:00
javayhu
3fa44f92c7 chore: add config for enableTurnstileCaptcha 2025-06-30 23:50:56 +08:00
javayhu
55ae5ced9e fix: fix ai image default models 2025-06-30 23:50:01 +08:00
javayhu
111568d746 fix: show captcha when turnstile is enabled only 2025-06-30 23:05:38 +08:00
javayhu
45e6a59fe6 chore: optimize the credit functions 2025-06-30 01:10:14 +08:00
javayhu
684bbdff82 chore: add credit related tables 2025-06-30 00:25:26 +08:00
javayhu
181e478bc3 chore: fix db instance 2025-06-30 00:05:25 +08:00
javayhu
82d0fa1061 Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template into dev/credits 2025-06-28 23:12:38 +08:00
javayhu
ba3cbe0724
Merge pull request #58 from MkSaaSHQ/dev/ai-image
feat: ai image generator
2025-06-28 22:57:30 +08:00
javayhu
91614ed6e5 fix: fix build error & remove Spinner 2025-06-28 22:50:40 +08:00
javayhu
0453db5ec6 chore: optimize ai image generator 2025-06-28 22:47:40 +08:00
javayhu
1a297e33f9 Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template into dev/ai-image 2025-06-28 10:12:23 +08:00
javayhu
05b90fb0a7 chore: optimize validate captcha 2025-06-28 10:09:50 +08:00
javayhu
66567cfecd chore: optimize turnstile captcha 2025-06-28 00:34:31 +08:00
javayhu
46d008e5fc chore: update readme 2025-06-28 00:01:53 +08:00
javayhu
c7cbf96a70
Merge pull request #57 from MkSaaSHQ/dev/turnstile
feat: support cloudflare turnstile
2025-06-27 23:52:18 +08:00
javayhu
958852335d feat: support cloudflare turnstile 2025-06-27 23:50:56 +08:00
javayhu
3058484803 custom: optimize ai image generator page 2025-06-27 01:05:19 +08:00
javayhu
985579b964 feat: support ai image generator 2025-06-26 00:41:27 +08:00
javayhu
b3180e617d chore: support datafast analytics revenue track 2025-06-25 20:28:09 +08:00
javayhu
bc915a53dc chore: add monitor api route 2025-06-24 23:48:43 +08:00
javayhu
bd67ac3517 chore: support allow promotion code in price config 2025-06-24 23:00:42 +08:00
javayhu
e94625ce4e custom: add command cf-dev on port 8787 2025-06-22 11:58:13 +08:00
javayhu
e70a8c92a2 Merge remote-tracking branch 'origin/main' into dev/credits 2025-06-21 22:50:09 +08:00
javayhu
2153cf6771 chore: add dev.vars example file 2025-06-21 17:35:32 +08:00
javayhu
0164c833db Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-21 14:40:23 +08:00
javayhu
cfbfa409b0 Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template 2025-06-21 10:47:37 +08:00
javayhu
ffbe7f4fb0 chore: optimize docker deployment by add docker ignore file 2025-06-21 10:47:29 +08:00
javayhu
13a79c7a01
Merge pull request #51 from MkSaaSHQ/dev/docker
feat: support docker & dokploy deployment
2025-06-21 09:41:15 +08:00
javayhu
1cb0793a83 chore: change baseURL in fetch session 2025-06-21 09:27:22 +08:00
javayhu
5e1f9167e0 fix: fix build error Cannot find config file 2025-06-21 01:23:31 +08:00
javayhu
39a2870131 chore: support docker deployment 2025-06-21 01:02:27 +08:00
javayhu
40b313a2f2 chore: move mdx-components to docs folder 2025-06-20 23:51:25 +08:00
javayhu
9e54932b27 chore: move source.ts to lib folder 2025-06-20 23:12:29 +08:00
javayhu
5d50135ed6 Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-20 22:21:04 +08:00
javayhu
befd10cc5b refactor: remove useless packages 2025-06-20 21:17:11 +08:00
javayhu
b17599976f chore: move blog types to index 2025-06-20 21:09:50 +08:00
javayhu
107f761716 chore: optimize email templates (found by knip) 2025-06-20 21:00:51 +08:00
javayhu
cb5c588b1e chore: install knip 2025-06-20 20:58:24 +08:00
javayhu
cbfe5e433d Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-20 02:04:54 +08:00
javayhu
7c101d595e refactor(storage) replace with s3mini sdk & fix upload issue in cloudflare worker 2025-06-20 02:04:14 +08:00
javayhu
196f72ff68 chore: fix lint and format issues 2025-06-20 02:04:00 +08:00
javayhu
7ab7d2d504 refactor(storage) replace with s3mini sdk & fix upload issue in cloudflare worker 2025-06-20 02:03:22 +08:00
javayhu
522d8de4ee chore: add comments for nodejs_compat 2025-06-20 01:36:35 +08:00
javayhu
0739c717d8 chore: fix lint and format issues 2025-06-20 01:18:48 +08:00
javayhu
71b9807433 Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-19 00:40:41 +08:00
javayhu
e49d4624fe fix: fix docs sidebar collapse issue 2025-06-18 23:56:28 +08:00
javayhu
8a72fb2409 chore: revert change website name 2025-06-18 00:18:58 +08:00
javayhu
e00c22d0fe Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-18 00:17:09 +08:00
javayhu
8a5a49f041 fix: add type annotation for data in GitHubStarsButton component 2025-06-18 00:15:20 +08:00
javayhu
bd8ccf4cf3 Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-18 00:09:28 +08:00
javayhu
fd4426ddd7 chore: remove useless packages 2025-06-17 23:41:16 +08:00
javayhu
fcb58d2206 refactor(blog) remove blog toc component 2025-06-17 23:38:56 +08:00
javayhu
aa547f209e chore: adjust locale handling in Providers and DocsRootLayout, and simplify search API request handling 2025-06-17 23:38:45 +08:00
javayhu
5b30fd8c48 chore: update DynamicCodeBlock component props 2025-06-17 23:38:38 +08:00
javayhu
c8b29c59dc chore: fix fumadocs top empty banner shown when in cloudflare worker env 2025-06-17 23:38:34 +08:00
javayhu
d946e2aead chore: upgrade fumadocs ui and core 2025-06-17 23:38:30 +08:00
javayhu
ddd3ee07df cf: do not remove logs in prod env 2025-06-17 23:38:24 +08:00
javayhu
da0176ffc5 refactor(blog) update sitemap for blog pages 2025-06-17 23:38:11 +08:00
javayhu
568ef9bc3a refactor(blog) blog category pages 2025-06-17 23:38:07 +08:00
javayhu
e05d20ee5e refactor(blog) optimize inline toc & blog page layout 2025-06-17 23:38:02 +08:00
javayhu
56fa6fb63c refactor(blog) blog page ready with toc 2025-06-17 23:37:56 +08:00
javayhu
ebeacae587 refactor(blog) refactor blog home page 2025-06-17 23:37:52 +08:00
javayhu
7d5f4a52a8 refactor(blog) update date in mdx files 2025-06-17 23:37:47 +08:00
javayhu
0a2d081b07 refactor(blog) remove content-collections & add blog source 2025-06-17 23:37:41 +08:00
javayhu
21bc0b1293 refactor(blog) update content about blog posts 2025-06-17 23:37:02 +08:00
javayhu
c477aae333 refactor(pages) migrate custom pages to using fumadocs 2025-06-17 23:36:57 +08:00
javayhu
543798e2c1 refactor(changelog) refactor release card component 2025-06-17 23:36:50 +08:00
javayhu
483a970b71 refactor(changelog) migrate changelog to use fumadocs 2025-06-17 23:36:44 +08:00
javayhu
292faddc7a refactor(docs) parse and render docs mdx files by fumadocs 2025-06-17 23:36:09 +08:00
javayhu
8fd3b679fb refactor(docs) remove math and package-install as code block languages 2025-06-17 23:35:43 +08:00
javayhu
2d12d89e3b chore: add fumadocs-mdx 2025-06-17 23:35:36 +08:00
javayhu
d0aef4b7d4 chore: remove useless packages 2025-06-17 23:26:33 +08:00
javayhu
c006ee750d refactor(blog) remove blog toc component 2025-06-17 23:26:02 +08:00
javayhu
19a6c4d994 cf: fix stripe api issue by setting httpClient 2025-06-17 22:35:27 +08:00
javayhu
86f13a1748 chore: reset compatibility_flags to nodejs_compat & nodejs_compat_v2 not solve file upload issue 2025-06-17 22:15:12 +08:00
javayhu
745ba457df cf: add init open next cf for dev 2025-06-17 22:14:01 +08:00
javayhu
beb53639a3 chore: adjust locale handling in Providers and DocsRootLayout, and simplify search API request handling 2025-06-17 21:44:48 +08:00
javayhu
65fb8722bc chore: update DynamicCodeBlock component props 2025-06-17 21:28:36 +08:00
javayhu
160a7eb929 chore: fix fumadocs top empty banner shown when in cloudflare worker env 2025-06-17 21:17:34 +08:00
javayhu
c3d82d9183 chore: upgrade fumadocs ui and core 2025-06-17 21:16:46 +08:00
javayhu
767351c5cd cf: add nodejs_compat_v2 to compatibility_flags 2025-06-17 20:43:54 +08:00
javayhu
fd3c82baaf cf: do not remove logs in prod env 2025-06-17 20:06:20 +08:00
javayhu
168eae946f cf: enable worker log push 2025-06-17 19:41:18 +08:00
javayhu
69390fed70 refactor(blog) update sitemap for blog pages 2025-06-17 18:17:05 +08:00
javayhu
2cb041beb1 refactor(blog) blog category pages 2025-06-17 18:02:29 +08:00
javayhu
3645cf5773 refactor(blog) optimize inline toc & blog page layout 2025-06-17 17:45:10 +08:00
javayhu
c6ad6d0ad5 refactor(blog) blog page ready with toc 2025-06-17 17:29:15 +08:00
javayhu
53ab869f07 refactor(blog) refactor blog home page 2025-06-17 11:28:20 +08:00
javayhu
e0f408fb07 refactor(blog) update date in mdx files 2025-06-17 09:52:13 +08:00
javayhu
1216732a55 refactor(blog) remove content-collections & add blog source 2025-06-17 09:51:57 +08:00
javayhu
4c6fddf99d refactor(blog) update content about blog posts 2025-06-17 00:08:07 +08:00
javayhu
90d5db88ab refactor(pages) migrate custom pages to using fumadocs 2025-06-16 23:34:22 +08:00
javayhu
af5a3265a6 refactor(changelog) refactor release card component 2025-06-16 22:55:24 +08:00
javayhu
ec8ce54824 refactor(changelog) migrate changelog to use fumadocs 2025-06-16 01:29:02 +08:00
javayhu
f4d8a09ab6 refactor(docs) parse and render docs mdx files by fumadocs 2025-06-16 00:51:36 +08:00
javayhu
3b741b3b98 refactor(docs) remove math and package-install as code block languages 2025-06-16 00:43:27 +08:00
javayhu
b07be5fab4 chore: add fumadocs-mdx 2025-06-15 20:50:03 +08:00
javayhu
a22a5def4d chore: update hyperdrive localConnectionString 2025-06-15 17:44:17 +08:00
javayhu
d190bcb358 chore: add pg to fix error [Better Auth]: INTERNAL_SERVER_ERROR Error: Cannot find module 'cloudflare:sockets' when run pnpm preview 2025-06-15 17:44:00 +08:00
javayhu
7f1fe23407 chore: remove unused types from tsconfig.json 2025-06-15 12:25:06 +08:00
javayhu
05a7de4599 fix: add type annotation for data in GitHubStarsButton component 2025-06-15 12:24:57 +08:00
javayhu
c098300481 chore: update next config & fix build error UnhandledSchemeError 2025-06-15 12:23:10 +08:00
javayhu
e7240db823 fix: fix build error: Module build failed: UnhandledSchemeError: Reading from "cloudflare:sockets" is not handled by plugins (Unhandled scheme).
https://github.com/vercel/next.js/discussions/50177
2025-06-15 12:00:38 +08:00
javayhu
a4390d433b chore: add types to compilerOptions in ts config 2025-06-15 11:44:37 +08:00
javayhu
ae49d06cf4 chore: update db instance & bind hyperdrive 2025-06-15 09:05:27 +08:00
javayhu
6a448825a6 Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-15 08:12:38 +08:00
javayhu
92a87ceb03 chore: update cursor rules 2025-06-15 08:12:15 +08:00
javayhu
3136766a6d chore: add email to footer social config 2025-06-15 00:44:41 +08:00
javayhu
02b5ee1727 chore: optimize feishu notification message 2025-06-15 00:14:14 +08:00
javayhu
b10e27ee29 chore: optimize discord message information 2025-06-14 22:21:39 +08:00
javayhu
ea0c74aa12 fix: z-index 100 is higher than dropdown menu 2025-06-14 19:30:27 +08:00
javayhu
4015cb3143 chore: add 2 custom components 2025-06-14 19:00:21 +08:00
javayhu
2ad6eab666 chore: add 20+ animate ui components 2025-06-14 15:23:22 +08:00
javayhu
c23383fdde chore: add MotionHighlight component from animate-ui 2025-06-14 15:00:55 +08:00
javayhu
e610fe7335 feat: support send message to feishu 2025-06-14 02:09:40 +08:00
javayhu
a7a5a8a6a4 chore: update logo cloud image urls 2025-06-12 01:52:13 +08:00
javayhu
9ffe9af0fa
Merge pull request #48 from MkSaaSHQ/dev/db-refactor
refactor: add getDb function & update all db calls
2025-06-12 01:44:29 +08:00
javayhu
17c7d67743 refactor: add getDb function & update all db calls 2025-06-12 01:40:44 +08:00
javayhu
0684b16278 chore: optimize code for type safe 2025-06-12 00:54:28 +08:00
javayhu
9c120d776d chore: trust images from html.tailus.io 2025-06-12 00:27:16 +08:00
javayhu
a7c56f4a6c chore: optimize db instance init with schema 2025-06-12 00:20:06 +08:00
javayhu
563fc2099a refactor: move db migrations to src/db/migrations folder 2025-06-12 00:04:29 +08:00
javayhu
56df0bed46 fix: optimize og image url in metadata 2025-06-10 22:52:16 +08:00
javayhu
4d60d48212 cf: reset gitignore file same as main branch 2025-06-09 01:25:33 +08:00
javayhu
26a88eb2f0 Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-09 00:58:21 +08:00
javayhu
5b50e62774 chore: move tailark components from /src/app to /src/components (cf deployment error: too many open files) 2025-06-09 00:56:38 +08:00
javayhu
c5d08a9846 Revert "cf: test remove preview pages only"
This reverts commit f5b4ed2859.
2025-06-09 00:42:09 +08:00
javayhu
f5b4ed2859 cf: test remove preview pages only 2025-06-09 00:22:45 +08:00
javayhu
b88aa9c1f5 Revert "cf: test remove docs pages and content only"
This reverts commit 708fac652f.
2025-06-09 00:21:43 +08:00
javayhu
593333c3dd Revert "cf: test remove docs pages and docs+blog content"
This reverts commit c3392320b3.
2025-06-09 00:21:34 +08:00
javayhu
f3b6603db7 Revert "cf: test remove docs and blog pages and content"
This reverts commit 9cb559a48d.
2025-06-09 00:21:28 +08:00
javayhu
9cb559a48d cf: test remove docs and blog pages and content 2025-06-09 00:17:09 +08:00
javayhu
c3392320b3 cf: test remove docs pages and docs+blog content 2025-06-09 00:08:06 +08:00
javayhu
708fac652f cf: test remove docs pages and content only 2025-06-09 00:05:32 +08:00
javayhu
ec124640f1 Revert "cf: test delete blog and docs content only"
This reverts commit 862132d8eb.
2025-06-09 00:03:44 +08:00
javayhu
862132d8eb cf: test delete blog and docs content only 2025-06-08 23:58:11 +08:00
javayhu
bf11c143fe Revert "cf: test remove all blog and docs and preview pages"
This reverts commit 6cfc76d621.
2025-06-08 23:57:16 +08:00
javayhu
6cfc76d621 cf: test remove all blog and docs and preview pages 2025-06-08 22:07:33 +08:00
javayhu
d935bcff76 cf: set @opennextjs/cloudflare as devDependencies 2025-06-08 21:49:19 +08:00
javayhu
a727a31e2f cf: revert the og image 2025-06-08 21:41:01 +08:00
javayhu
2cdc520b1d chore: update git ignore for wrangler files 2025-06-08 21:39:38 +08:00
javayhu
81cfc5f6b3 cf: update website name in zh.json 2025-06-08 21:38:14 +08:00
javayhu
8e8291c325 cf: update configs by the opennextjs docs 2025-06-08 21:18:42 +08:00
javayhu
6ff2ea6845 cf: upgrade opennextjs to 1.2.1 2025-06-08 20:04:51 +08:00
javayhu
b6836db12d Merge remote-tracking branch 'origin/main' into cloudflare 2025-06-08 18:25:26 +08:00
javayhu
4631aea7f5 chore: update readme 2025-06-08 18:09:32 +08:00
javayhu
8b3e9ecfe1 Merge remote-tracking branch 'origin/main' into credits 2025-06-08 11:13:00 +08:00
javayhu
00dcd7ce61 chore: optimize navbar menu link active status 2025-06-07 23:36:18 +08:00
javayhu
9b7c1387f9 chore: make navbar z-index higher 2025-06-07 18:15:42 +08:00
javayhu
da69bb7d20 chore: update readme 2025-05-31 13:45:47 +08:00
javayhu
7edc627505 chore: set enableDiscordWidget to false as default 2025-05-31 13:43:48 +08:00
javayhu
34b7c1c74f custom: support promotekit affiliate 2025-05-31 12:13:28 +08:00
javayhu
80763b4efb chore: add generateStaticParams to blog post page 2025-05-31 09:21:40 +08:00
javayhu
6a4f0575c4 fix: fix cr bugs from coderabbit 2025-05-31 09:19:56 +08:00
javayhu
d391d35e26 fix: remove generateStaticParams in blog post page 2025-05-31 00:47:29 +08:00
javayhu
5f6e75fe93 Merge branch 'main' of github.com:MkSaaSHQ/mksaas-template 2025-05-31 00:42:54 +08:00
javayhu
5fae666b70 fix: set dynamic to force-static in blog post page 2025-05-31 00:42:14 +08:00
javayhu
377e46a31f
Merge pull request #43 from MkSaaSHQ/blog-refactor
refactor: update blog url path & components & sitemap
2025-05-31 00:11:41 +08:00
javayhu
f589fa2d00 refactor: update blog url path & components & sitemap 2025-05-31 00:07:25 +08:00
javayhu
c23fdee88f chore: optimize blog page metadata 2025-05-30 18:27:22 +08:00
javayhu
707399057e Merge branch 'main' of github.com:MkSaaSHQ/mksaas-template 2025-05-30 15:12:06 +08:00
javayhu
ce7978a572 chore: add affonso script to layout 2025-05-30 15:11:02 +08:00
javayhu
5ae484fdaa
Merge pull request #42 from MkSaaSHQ/affonso
feat: support Affonso affiliate
2025-05-30 14:08:49 +08:00
javayhu
8dd3e12824 feat: support affonso affiliate 2025-05-30 14:05:45 +08:00
javayhu
1a4917c874 chore: optimize upgrade card config 2025-05-30 13:28:03 +08:00
javayhu
e27a7a081c chore: optimize discord widget config 2025-05-30 13:26:42 +08:00
javayhu
3a8acc5ef4 chore: update credit related functions (2) 2025-05-29 01:21:04 +08:00
javayhu
4374f118b4 chore: update credits related functions (2) 2025-05-28 00:54:27 +08:00
javayhu
443f01769c Merge branch 'main' into credits 2025-05-27 23:47:41 +08:00
javayhu
3ea18fcade chore: support config for enable upgrade card 2025-05-27 23:47:05 +08:00
javayhu
38bb93fa4f chore: support config for discord widget feature 2025-05-27 23:17:49 +08:00
javayhu
1e203f4e87 fix: do not show upgrade card when sidebar collapses 2025-05-27 23:09:47 +08:00
javayhu
5824e7489c fix: show post image as og image 2025-05-25 22:26:14 +08:00
javayhu
02df9d134f fix: change og:site_name to metadata name instead of title 2025-05-25 22:19:06 +08:00
javayhu
ac320b21f4 chore: update credits related functions 2025-05-23 00:38:30 +08:00
javayhu
82f40d7dc6 fix: fix canonicalUrl in block pages 2025-05-22 22:53:29 +08:00
javayhu
28ad92e101 fix: fix canonicalUrl 2025-05-22 22:30:35 +08:00
javayhu
9e0bd57ecc feat: support credits 2025-05-22 00:30:10 +08:00
javayhu
044af8bf74 chore: add mcp tool of context7 2025-05-18 23:59:08 +08:00
javayhu
2db79a871a chore: show discord widget in homepage only 2025-05-18 23:58:58 +08:00
javayhu
5f435b9614 chore: add mcp tool of context7 2025-05-18 17:36:30 +08:00
javayhu
9b03f6201f chore: show discord widget in homepage only 2025-05-18 16:55:37 +08:00
javayhu
111f00adaa chore: update @opennextjs/cloudflare version 2025-05-18 00:39:49 +08:00
javayhu
002d2090c2 Merge remote-tracking branch 'origin/main' into cloudflare 2025-05-17 23:40:51 +08:00
javayhu
3c1f1a60a3 fix: fix logo light config 2025-05-16 10:24:55 +08:00
javayhu
999ba40bba chore: udpate short link to roadmap 2025-05-16 10:20:33 +08:00
javayhu
48e188b0da chore: update social links 2025-05-16 10:17:15 +08:00
javayhu
c41817c704 chore: add script for listing newsletter contacts 2025-05-16 09:59:18 +08:00
javayhu
ecb57cf7ab chore: update blog domain in readme 2025-05-16 00:50:29 +08:00
javayhu
aa488bf82c chore: update discord link in readme 2025-05-16 00:10:23 +08:00
javayhu
b7808adee5 Merge branch 'main' of github.com:MkSaaSHQ/mksaas-template 2025-05-15 23:58:54 +08:00
javayhu
0585fb3253 chore: set baseURL in better auth 2025-05-15 23:58:48 +08:00
javayhu
136a123a56 chore: optimize discord widget for mobile 2025-05-15 09:31:17 +08:00
javayhu
50d6e2b069 Merge branch 'main' of github.com:MkSaaSHQ/mksaas-template 2025-05-15 00:43:56 +08:00
javayhu
ecc7952340 feat: support discord notification when successful one time payment 2025-05-15 00:43:45 +08:00
javayhu
4fe64a99fd
Merge pull request #37 from MkSaaSHQ/discordbot
feat: support show discord widget on website
2025-05-15 00:28:56 +08:00
javayhu
036ea72b30 feat: show discord widget on the website 2025-05-15 00:24:26 +08:00
javayhu
cd44d3ae67 feat: support discord bot on website 2025-05-14 23:56:01 +08:00
javayhu
e5d3e9144d chore: optimize faking user data when in demo website 2025-05-14 22:48:54 +08:00
javayhu
0476d696de fix: remove version in ogImage 2025-05-14 07:29:58 +08:00
javayhu
acf4723c17 Revert "chore: update open graph image"
This reverts commit c3913dbc88.
2025-05-14 07:24:42 +08:00
javayhu
c661dd60d7 custom: update og image version 2025-05-13 01:45:52 +08:00
javayhu
a39a39c903 chore: update open graph image 2025-05-13 01:44:45 +08:00
javayhu
c3913dbc88 chore: update open graph image 2025-05-13 01:43:25 +08:00
javayhu
9b68e3095e Merge remote-tracking branch 'origin/main' into cloudflare 2025-05-11 22:19:58 +08:00
javayhu
e223d08bbc chore: update env example file 2025-05-11 15:24:44 +08:00
javayhu
e42401206b
Merge pull request #36 from MkSaaSHQ/user-table
feat: support demo website show user admin page
2025-05-11 14:58:59 +08:00
javayhu
15c39fde7f
Merge branch 'main' into user-table 2025-05-11 14:58:49 +08:00
javayhu
e284de79a8 chore: support show admin user page in demo website 2025-05-11 14:50:13 +08:00
javayhu
50f44fb84c chore: support disable image optimization 2025-05-11 14:16:16 +08:00
javayhu
29af46fa28
Merge pull request #35 from MkSaaSHQ/user-table
feat: user management
2025-05-11 14:04:12 +08:00
javayhu
dc86cfacd8 chore: i18n user table messages 2025-05-11 13:57:26 +08:00
javayhu
70d35e5fd5 chore: update default ban reason 2025-05-11 11:51:54 +08:00
javayhu
245dfaa6e1 chore: refresh table after ban or unban user 2025-05-11 11:46:43 +08:00
javayhu
bcb1e0ef9d chore: update user detail viewer date picker component 2025-05-11 11:26:50 +08:00
javayhu
f764bcb627 chore: update calendar component and downgrade react-date-picker 2025-05-11 11:21:55 +08:00
javayhu
5f6205c150 chore: define type User and use it in users-table 2025-05-11 10:52:11 +08:00
javayhu
78681df65f chore: call ban/unban user by authClient.admin 2025-05-11 10:44:48 +08:00
javayhu
d889cdf2b7 chore: update user detail viewer 2025-05-11 09:55:21 +08:00
javayhu
4e6496adc0 chore: optimize get users logic for sorting 2025-05-11 08:55:46 +08:00
javayhu
fd1bc9ee00 chore: support sort by ban reason and expires column 2025-05-11 08:52:41 +08:00
javayhu
3bb6d089fe chore: remove column emailVerified 2025-05-11 08:47:48 +08:00
javayhu
7248750277 chore: support sort by role and banned 2025-05-11 08:38:13 +08:00
javayhu
6cace107e5 chore: add doc link to analytics components 2025-05-11 07:49:10 +08:00
javayhu
3042894e13 feat: support ahrefs analytics 2025-05-11 07:36:09 +08:00
javayhu
4b6fb7beed chore: copy email when click it 2025-05-11 00:53:34 +08:00
javayhu
061b304aa8 feat: support ban and unban user & show user detailed information 2025-05-11 00:47:05 +08:00
javayhu
71e9e33fd7 chore: optimize email and status column cell ui 2025-05-11 00:04:20 +08:00
javayhu
b57edf9bf5 chore: navigate to stripe customer page when click customer id 2025-05-10 23:36:53 +08:00
javayhu
83cfbd4980 chore: optimize status/emailverified/role cell UI 2025-05-10 23:29:00 +08:00
javayhu
959e49b01b chore: support sort table by name/email/createdAt 2025-05-10 23:08:48 +08:00
javayhu
08a3fbf704 feat: get users and show users in table 2025-05-10 20:55:22 +08:00
javayhu
4dd36ed9c4 custom: add UserTable component 2025-05-10 14:14:00 +08:00
javayhu
b1ea926aa6 fix: update logos in logo-cloud block component 2025-05-10 13:04:05 +08:00
javayhu
bd39dac6ec fix: mode switcher background color 2025-05-10 12:56:36 +08:00
javayhu
fbd764c76f chore: remove param includeFumadocsComponents in CustomMDXContent 2025-05-10 07:16:38 +08:00
javayhu
d9dee949ef chore: add new ImageWrapper component 2025-05-10 07:13:16 +08:00
javayhu
f7d3ba2427 chore: showcase youtube video component in index mdx 2025-05-10 07:03:32 +08:00
javayhu
4b36baad92 chore: add YoutubeVideo component for mdx 2025-05-10 07:03:16 +08:00
javayhu
b99093b1f4 feat: add 4 new rules and update other rules file pattern 2025-05-09 23:54:45 +08:00
javayhu
121353ae3d chore: support telegram in social links 2025-05-09 23:26:21 +08:00
javayhu
af29690c63 chore: ignore .open-next 2025-05-09 22:44:26 +08:00
javayhu
2fb627a6e9 chore: remove package-lock file 2025-05-08 00:07:35 +08:00
javayhu
f11e37374b Merge remote-tracking branch 'origin/main' into cloudflare 2025-05-08 00:03:57 +08:00
javayhu
3560616b52 Revert "chore: remove some doc files"
This reverts commit dd95dece87.
2025-05-08 00:03:34 +08:00
javayhu
80219fa10b Revert "fix: try fix build error, Error: EMFILE: too many open files"
This reverts commit a62abbf399.
2025-05-08 00:03:21 +08:00
javayhu
c5361c07ef chore: update readme 2025-05-07 20:28:05 +08:00
javayhu
6a11838003 chore: update readme & add repositories section 2025-05-07 20:23:23 +08:00
javayhu
a62abbf399 fix: try fix build error, Error: EMFILE: too many open files
https://dash.cloudflare.com/b84ee5b2c0cdee9b0371c366945b0ab1/workers/services/view/mksaas-template/production/builds/7204761e-a2d1-490d-8d9d-b77a3985c1de
2025-05-07 00:06:49 +08:00
javayhu
dd95dece87 chore: remove some doc files 2025-05-06 23:52:32 +08:00
javayhu
c938122f7e chore: update package.json 2025-05-06 23:52:29 +08:00
javayhu
3887da26d0 chore: update wrangler config & add minify 2025-05-06 23:42:16 +08:00
javayhu
7af193f770 Merge remote-tracking branch 'origin/main' into cloudflare 2025-05-06 23:32:54 +08:00
javayhu
ca654b02bd chore: remove ai tools pages in navbar for now 2025-05-06 23:23:32 +08:00
javayhu
d46a79097a chore: optimize email config 2025-05-06 23:21:13 +08:00
javayhu
a92fd943e3 fix: preview email command error 2025-05-06 22:50:37 +08:00
javayhu
d6093394d8 chore: update cf scripts 2025-05-06 00:51:39 +08:00
javayhu
f1537e305a fix: build error & try add NEXT_PRIVATE_MAX_WORKER_THREADS=2 2025-05-06 00:42:31 +08:00
javayhu
1847ef4363 custom: update metadata name 2025-05-06 00:03:19 +08:00
javayhu
0fd695c8bc fix: build 2025-05-05 23:25:00 +08:00
javayhu
ae083a7992 feat: support cloudflare by diverce 2025-05-05 23:15:54 +08:00
javayhu
c71d4e6b57 chore: update payment readme doc 2025-05-05 22:34:43 +08:00
javayhu
304530a58a chore: optimize discord util function param 2025-05-05 19:57:25 +08:00
javayhu
2df67a1075 fix: revert getSessionCookie in middleware 2025-05-04 10:00:02 +08:00
javayhu
3664d0920b chore: optimize integration and calltoaction components 2025-05-04 09:14:29 +08:00
javayhu
9728511d75 chore: optimize middleware by using getSessionCookie instead of calling /api/auth/get-session as recommended by Better Auth 2025-05-04 09:09:44 +08:00
javayhu
fd72608dd4 chore: optimize NewsletterCard 2025-05-04 00:44:07 +08:00
javayhu
065dc1c71e chore: optimize newsletter card & add newsletter card to homepage 2025-05-04 00:39:02 +08:00
javayhu
c1dbad14ec chore: update pages layout & move container into pages 2025-05-04 00:04:14 +08:00
javayhu
80fe789b9d chore: add more disallow paths for robots 2025-05-03 20:27:57 +08:00
javayhu
d1359b91a3 chore: remove useless subtitle in about page 2025-05-03 20:27:34 +08:00
javayhu
6367405870 chore: optimize about page & add follow me and image section 2025-05-02 23:16:10 +08:00
javayhu
84dcf8cea8 fix: set default title in metadata 2025-05-02 22:45:17 +08:00
javayhu
b43a05c03c chore: add comment to PlausibleAnalytics for 404 error pages 2025-05-02 22:12:58 +08:00
javayhu
ae27906e3b chore: add new env for dev port 2025-05-02 21:47:41 +08:00
javayhu
6dd00094eb Merge branch 'main' of github.com:MkSaaSHQ/mksaas-template 2025-05-01 23:59:59 +08:00
javayhu
57e32f397f chore: update roadmap link 2025-05-01 23:59:55 +08:00
javayhu
d357e0c582
Update issue templates 2025-05-01 23:52:40 +08:00
javayhu
dd8b74b096 chore: use Session defined in auth-types 2025-05-01 21:55:11 +08:00
javayhu
4ef52c2c02 chore: update homepage faqs & testimonials sections 2025-05-01 16:02:17 +08:00
javayhu
033ff64139 chore: update homepage pricing section 2025-05-01 15:51:08 +08:00
javayhu
532de654e2 chore: optimize homepage features sections 2025-05-01 15:46:53 +08:00
javayhu
9e7b7ea25a chore: optimize homepage features section 2025-05-01 15:30:50 +08:00
javayhu
a950bc36c3 chore: update homepage integration section 2025-05-01 14:52:14 +08:00
javayhu
9b0e19049d chore: optimize homepage hero and stats sections 2025-05-01 14:47:00 +08:00
javayhu
ddbaa7b6cc fix: fix seo error in hero title h1 tag 2025-05-01 14:37:02 +08:00
javayhu
268085f37a fix: fix auth page ui bugs 2025-05-01 12:20:19 +08:00
javayhu
9c28c451e4 fix: hide scrollbar for layout shift when using the theme selector 2025-04-30 21:24:15 +08:00
javayhu
04fc9ca757 chore: update blocks images 2025-04-30 15:00:03 +08:00
javayhu
f607bae96e refactor: optimize newsletter subscribe and check status logic 2025-04-29 22:22:26 +08:00
javayhu
d94e777dde chore: update font in hero section 2025-04-29 08:07:38 +08:00
javayhu
94e38f751a fix: update CardFooter background color & fix login wrapper dialog ui bug 2025-04-29 00:23:15 +08:00
javayhu
299b8a3957 Merge branch 'main' of github.com:MkSaaSHQ/mksaas-template 2025-04-28 22:58:00 +08:00
javayhu
b27a7627b5 sync: update tailark to 20250427
18c66f051b
2025-04-28 22:57:48 +08:00
javayhu
d7b23c6f00
Merge pull request #20 from MkSaaSHQ/drizzle-postgres
refactor middleware for better session handling
2025-04-28 19:14:18 +08:00
javayhu
463121c23e fix: update pnpm lock file 2025-04-28 19:11:09 +08:00
javayhu
460dae64e3 chore: refactor middleware for better session handling 2025-04-28 19:08:52 +08:00
javayhu
a73493a042 chore: refactor database connection 2025-04-28 15:20:14 +08:00
javayhu
a24eeaccc8 Revert "chore: refactor database connection"
This reverts commit c93170119f.
2025-04-28 15:17:45 +08:00
javayhu
c93170119f chore: refactor database connection 2025-04-28 12:27:40 +08:00
javayhu
e86e1ece9c fix: fix hydration errors in dashboard 2025-04-28 12:11:59 +08:00
javayhu
9f240d9595 feat: support send message to discrod 2025-04-28 11:41:05 +08:00
javayhu
0877003cdf chore: remove bluesky social link 2025-04-28 00:50:37 +08:00
javayhu
3df4ec5cf7 feat: add new social link of mastodon 2025-04-28 00:22:14 +08:00
javayhu
a119a86e78 chore: update fumadocs domain 2025-04-27 22:23:56 +08:00
javayhu
9eaacfff8d chore: update default theme to Clean Slate 2025-04-27 00:50:46 +08:00
javayhu
0a314a22f1 feat: integrate react-tweet library and add AvatarCircles and TweetImages components to enhance MagicuiPage 2025-04-26 15:36:57 +08:00
javayhu
d0b3e069d9 feat: add BlurFadeDemo component and integrate it into MagicuiPage for enhanced visual effects 2025-04-26 14:42:52 +08:00
javayhu
6a17e6f29f fix: update Confetti ButtonProps to extend React.ComponentPropsWithRef for improved type safety in Magicui 2025-04-26 12:54:26 +08:00
javayhu
0fd6af8ed0 feat: enhance Magicui with new demo components including BoxReveal, FlipText, and various animated buttons and text effects 2025-04-26 11:53:40 +08:00
javayhu
797cfbd57f feat: update BoxRevealProps to accept React.ReactNode and add multiple example components for animated text, buttons, and effects to Magicui 2025-04-26 11:30:38 +08:00
javayhu
29b225c1eb feat: add various animated text components including AnimatedGradientText, AnimatedShinyText, TypingAnimation, MorphingText, and others to Magicui 2025-04-26 10:39:11 +08:00
javayhu
1cecd22213 feat: add AnimatedBeam, BlurFade, MagicCard, Meteors components and their styles to Magicui 2025-04-26 10:35:25 +08:00
javayhu
35005ea725 feat: add multiple magic ui button components including AnimatedSubscribeButton, InteractiveHoverButton, PulsatingButton, RippleButton, ShimmerButton, and ShinyButton to Magicui 2025-04-26 10:32:09 +08:00
javayhu
3fff508728 feat: add AnimatedGrid and InteractiveGridPattern components and their demo examples to MagicuiPage 2025-04-26 10:24:06 +08:00
javayhu
625bee14ef feat: add Ripple component and its demo example to MagicuiPage 2025-04-26 10:19:44 +08:00
javayhu
fd6126f0c1 feat: add GridPattern component and its demo example to MagicuiPage 2025-04-26 10:17:30 +08:00
javayhu
b6e36365f2 feat: add DotPattern component and its demo example to MagicuiPage 2025-04-26 10:14:40 +08:00
javayhu
efba35272d feat: add AnimatedList component and its demo example to MagicuiPage 2025-04-26 10:11:43 +08:00
javayhu
e626f57aac feat: add BentoDemo component and integrate it into the MagicuiPage 2025-04-26 10:06:36 +08:00
javayhu
938bfafe72 feat: add HeroVideoDialog component and its demo example 2025-04-26 10:04:38 +08:00
javayhu
c9eca9c76c chore: add new page for showing magicui components 2025-04-26 09:50:14 +08:00
javayhu
a2f97802f2 feat: add Marquee component and its example component 2025-04-26 09:49:53 +08:00
javayhu
3120b96d35 chore: update search.exclude settings to include .next and .content-collections directories 2025-04-25 21:46:43 +08:00
javayhu
d66306f890 fix: fix hydration caused by navbar mobile 2025-04-25 20:57:10 +08:00
javayhu
ded1d6bf49 fix: fix hydration caused by register button 2025-04-25 20:49:30 +08:00
javayhu
05014da6c7 fix: fix hydration mismatch error caused by login wrapper 2025-04-25 20:35:51 +08:00
javayhu
5ff2436b15 chore: rename template website name 2025-04-25 20:34:12 +08:00
javayhu
b0ebee8633 refactor: update email configuration to use fromEmail and supportEmail in website settings 2025-04-25 00:30:04 +08:00
javayhu
222154397a fix: update default login redirect to use fallback route if not defined 2025-04-24 23:34:17 +08:00
javayhu
b16a1918de feat: add routes configuration in website settings for default login redirect 2025-04-24 23:00:37 +08:00
javayhu
9046645006 fix: update social login button to use enableGoogleLogin and enableGithubLogin configuration options 2025-04-24 00:55:18 +08:00
javayhu
48270b17ee feat: add documentation link to footer 2025-04-23 09:17:38 +08:00
javayhu
38865a6069 fix: enable Google and GitHub login options in website configuration 2025-04-23 01:03:30 +08:00
javayhu
b461f2f079 feat: add configuration options to disable Google and GitHub login in social login button 2025-04-23 01:00:52 +08:00
javayhu
603c09eeb1 fix: disable Vercel and Speed Insights analytics options in website configuration 2025-04-23 00:43:56 +08:00
javayhu
e298910b4b feat: enhance analytics component with configurable Vercel and Speed Insights options 2025-04-23 00:21:33 +08:00
javayhu
d4b385f5a2 feat: add vercel speed-insights package and integrate into analytics component 2025-04-23 00:15:21 +08:00
javayhu
bd45821dae feat: addvercel analytics 2025-04-22 23:50:24 +08:00
javayhu
8e2a6a3d47 chore: add mdx and gitlens as recommended VSCode extensions for improved development experience 2025-04-21 09:53:26 +08:00
javayhu
35bcbb7a06 docs: add documentation links to various components and configurations 2025-04-21 09:49:43 +08:00
javayhu
80b0ee0460 docs: update env.example with new documentation links 2025-04-21 09:31:19 +08:00
javayhu
a985063032 docs: update font and theme documentation with links and formatting improvements 2025-04-21 01:19:43 +08:00
javayhu
8325a649d7 chore: remove unused 'geist' dependency and delete unused font files 2025-04-20 10:46:20 +08:00
javayhu
85978fc0a2 fix: fix doc page og metadata 2025-04-19 20:34:25 +08:00
javayhu
865a4c1c0f chore: refine README documentation for mail and newsletter modules 2025-04-19 20:16:18 +08:00
javayhu
0570725353 chore: update mail readme file 2025-04-19 20:16:12 +08:00
javayhu
689b9b7926 refactor: update price plan references to use new price-config file 2025-04-19 13:40:21 +08:00
javayhu
c6b0b260ef refactor: add price config and update related references 2025-04-19 13:38:16 +08:00
javayhu
9c385b11a7 chore: update env.example and NestedMenuItem in index.d.ts 2025-04-19 11:54:05 +08:00
javayhu
eff72bee91 refactor: unify email configuration by replacing 'from' and 'to' with 'contact' 2025-04-19 10:04:11 +08:00
javayhu
16dc11bb88 chore: support Step and Steps 2025-04-19 08:59:06 +08:00
javayhu
85c23e673b chore: update resend 2025-04-18 23:45:37 +08:00
javayhu
5cb8f71a1e chore: remove unused TypeScript settings from VSCode configuration 2025-04-18 23:43:53 +08:00
javayhu
0847461f35 Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template 2025-04-18 22:46:35 +08:00
javayhu
e9066ffbf8 chore: update readme & add discord 2025-04-18 22:46:30 +08:00
javayhu
fca58c279d
Merge pull request #18 from MkSaaSHQ/lint
feat: fix biome lint errors
2025-04-18 22:32:22 +08:00
javayhu
bbb22f8438 refactor: biome lint part 5 2025-04-18 22:23:07 +08:00
javayhu
f1a0d5c9b5 refactor: biome lint part 4 2025-04-18 22:19:45 +08:00
javayhu
9f58d025d0 refactor: biome lint part 3 2025-04-18 22:12:41 +08:00
javayhu
27bc59354f refator: biome lint part 2 2025-04-18 21:53:21 +08:00
javayhu
23cd59bbac refactor: biome lint part 1 2025-04-18 21:47:14 +08:00
javayhu
5b02b0379f chore: update biome.json 2025-04-18 10:25:00 +08:00
javayhu
f0ea8bf52e chore: update biome.json, add more to the ignore paths 2025-04-18 10:08:21 +08:00
javayhu
212a7e57a8 chore: update lint and format command in package.json 2025-04-18 10:07:53 +08:00
javayhu
e8c4bf3406 chore: support icon in docs mdx 2025-04-18 01:41:22 +08:00
javayhu
5504a3fae8 chore: remove blog link from docs page 2025-04-18 01:41:18 +08:00
javayhu
0033bb2bdd chore: update readme 2025-04-17 23:43:33 +08:00
javayhu
79e1132bc7 chore: add VSCode configuration for recommended extensions and update editor settings 2025-04-17 23:29:13 +08:00
javayhu
aecdfd1054 chore: add discord to social config 2025-04-17 09:48:36 +08:00
javayhu
61fbc0e2fb chore: update social links configuration to use optional chaining 2025-04-17 01:30:02 +08:00
javayhu
4b1d888845 chore: refactor website configuration structure and update related components 2025-04-17 01:18:57 +08:00
javayhu
377f22c693 chore: rename webMetadata to metadataConfig 2025-04-17 00:33:39 +08:00
javayhu
743ef4aef7 chore: disable locale switch if only one locale defined 2025-04-17 00:24:30 +08:00
javayhu
d9e25b39af chore: optimize umami and plausible analytics 2025-04-16 23:53:58 +08:00
javayhu
47cb481682 chore: update messages in price table 2025-04-16 01:00:34 +08:00
javayhu
13889cfd2a feat: send welcome email upon newsletter subscription 2025-04-16 01:00:12 +08:00
javayhu
dca25ac784 chore: enable auto subscribe user to newsletter after sign up by default 2025-04-15 17:00:45 +08:00
javayhu
c5bde173a0 fix: check newsletter subscribe status bug 2025-04-15 01:42:29 +08:00
javayhu
a1e9621195 fix: hydration error in upgrade card component 2025-04-15 01:42:19 +08:00
javayhu
731dd41de1 chore: set stripe customer name from user name 2025-04-15 01:42:09 +08:00
javayhu
5cca961668 chore: change the bg of newsletter card 2025-04-14 23:49:39 +08:00
javayhu
df3d3a3caf Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template 2025-04-14 23:41:52 +08:00
javayhu
18cbd059be fix: screen width bug when having posts and no post 2025-04-14 23:41:47 +08:00
javayhu
3a0126c74c chore: update comments for seline analytics 2025-04-14 13:24:37 +08:00
javayhu
2d035a91e3 feat: support seline analytics 2025-04-14 13:24:37 +08:00
javayhu
9c5e7db748 feat: support auto subscribe to newsletter after sign up 2025-04-14 01:29:59 +08:00
javayhu
3ff522cff2 chore: update readme files of modules 2025-04-14 01:29:42 +08:00
javayhu
f0d89970ee refactor: optimize billing card hooks order 2025-04-13 17:46:31 +08:00
javayhu
a4ed6368db chore: optimize billing card for the case of no any plan 2025-04-13 17:17:24 +08:00
javayhu
1b67b4d93d chore: optimize pricing table for 1 or 2 plans show in center 2025-04-13 16:19:19 +08:00
javayhu
f1b2d39f1f chore: update payment config and intl message keys 2025-04-13 15:50:30 +08:00
javayhu
c3e9b480bd fix: fix errorCode 429 bug in newsletter 2025-04-13 14:36:10 +08:00
javayhu
e879c88e87 fix: fix logo hydration error 2025-04-13 14:26:21 +08:00
javayhu
f92e685ca6 chore: optimize UI button style 2025-04-13 13:24:32 +08:00
javayhu
7fe491f50f chore: clean hero section code 2025-04-13 10:22:48 +08:00
javayhu
728f89f109 chore: set ai pages working in progress 2025-04-13 09:35:38 +08:00
javayhu
f3ca37d7cd
Update config.yml 2025-04-13 08:15:50 +08:00
javayhu
86722c5c55
Delete .github/ISSUE_TEMPLATE/feature_request.md 2025-04-13 08:14:42 +08:00
javayhu
7c85bc266b
chore: Create issue config.yml 2025-04-13 08:13:31 +08:00
javayhu
c810f934c6
Update issue templates 2025-04-13 08:08:18 +08:00
javayhu
27c5de72cc
Update issue templates 2025-04-13 08:05:20 +08:00
javayhu
0a66ad8bbe chore: update readme 2025-04-13 07:58:50 +08:00
javayhu
14798b1660 chore: update readme file 2025-04-13 02:10:26 +08:00
javayhu
04caa38112 feat: update UI elements and add og image
- Changed the secondary button text in the English JSON file from "Book Demo" to "See Demo" for improved clarity.
- Added a new Open Graph image to enhance social media sharing capabilities.
- Adjusted grid gap properties in Features2Section and FeaturesSection components for better layout consistency.
- Simplified the BlogCard component by removing unnecessary border classes and updating text color for improved readability.
- Modified the Navbar component to change the background color to transparent when scrolled, enhancing visual appeal.
2025-04-13 01:55:58 +08:00
javayhu
2d21d4989e feat: add pricing section to homepage
- Introduced a new PricingSection component to display pricing options, enhancing user engagement and decision-making.
- Updated English and Chinese JSON files to include titles and descriptions for the pricing section.
- Refactored the homepage layout to integrate the new PricingSection, improving overall user experience.
- Renamed CallToAction component to CallToActionSection for consistency in naming conventions.
- Adjusted image sources in Features4Section for improved asset management.
2025-04-13 00:54:39 +08:00
javayhu
97a24727d1 feat: enhance homepage with new integration and features sections
- Introduced Integration2Section and Features5Section components to showcase integrations and additional product features, improving user engagement and workflow.
- Updated English and Chinese JSON files to include new titles, descriptions, and buttons for the integration and features sections.
- Refactored the homepage layout to integrate the new sections, enhancing overall user experience.
- Adjusted existing FeaturesSection and Features2Section components for consistency and clarity in feature presentation.
2025-04-13 00:42:29 +08:00
javayhu
9f6b1493d4 feat: add call-to-action section to homepage
- Introduced a new CallToAction component to encourage user engagement with clear action prompts.
- Updated English and Chinese JSON files to include titles, descriptions, and buttons for the call-to-action section.
- Refactored the homepage layout to integrate the new CallToAction section, enhancing overall user experience.
2025-04-13 00:19:11 +08:00
javayhu
50aacbed11 feat: add testimonials section to homepage
- Introduced a new TestimonialsSection component to display customer testimonials, enhancing user engagement and trust.
- Updated English and Chinese JSON files to include testimonials titles, descriptions, and individual customer quotes.
- Refactored the homepage layout to integrate the new testimonials section, improving overall user experience.
2025-04-13 00:06:31 +08:00
javayhu
5c48725110 feat: add integration section and features4 component to homepage
- Introduced a new IntegrationSection component to showcase integrations with popular tools, enhancing user workflow.
- Updated English and Chinese JSON files to include integration titles and descriptions.
- Added a new Features4Section component with a different layout for product features, improving presentation and user engagement.
- Refactored homepage layout to integrate the new sections, enhancing overall user experience.
2025-04-12 23:23:04 +08:00
javayhu
19f6457d6d feat: expand features sections on homepage
- Updated English and Chinese JSON files to include additional product features and descriptions, enhancing user engagement.
- Introduced a new Features3Section component to showcase more product features on the homepage.
- Refactored the homepage layout to integrate the new Features3Section, improving overall user experience.
- Adjusted existing FeaturesSection and Features2Section components for consistency and clarity in feature presentation.
2025-04-12 22:36:54 +08:00
javayhu
ea0c0cf027 feat: enhance homepage with new features sections
- Added FeaturesSection and Features2Section components to showcase product features on the homepage, improving user engagement and information accessibility.
- Updated English and Chinese JSON files to include new feature descriptions and titles for both features sections.
- Refactored the homepage layout to integrate the new features sections, enhancing overall user experience.
- Made adjustments to the LogoCloud section for improved styling and consistency.
2025-04-12 22:26:03 +08:00
javayhu
43777b5989 feat: add LogoCloud section to homepage
- Introduced a new LogoCloudSection component to showcase partner logos on the homepage, enhancing brand visibility.
- Updated English and Chinese JSON files to include a title for the LogoCloud section.
- Refactored the homepage to integrate the new LogoCloudSection, improving overall layout and user engagement.
- Added multiple SVG logos to the public/svg directory for use in the LogoCloud section.
2025-04-12 21:22:30 +08:00
javayhu
144eb7a39c feat: enhance homepage and footer with new hero section and tagline
- Introduced a new HeroSection component to the homepage, featuring an engaging introduction, title, and action buttons to improve user engagement.
- Updated the English and Chinese JSON files to include a hero section with descriptive content.
- Refactored the FAQ component to FaqSection for consistency and updated its usage in both the homepage and pricing page.
- Added a tagline to the footer for better branding visibility.
2025-04-12 20:49:43 +08:00
javayhu
d0dc072324 refactor: replace getBaseUrlWithLocale with getUrlWithLocale
- Updated multiple files to replace the deprecated getBaseUrlWithLocale function with the new getUrlWithLocale function for generating localized URLs.
- Ensured consistency across the application by standardizing URL generation methods in checkout, customer portal, and various marketing pages.
2025-04-12 20:04:40 +08:00
javayhu
fd11648d98 feat: update FAQ block
- Modified the FAQ section in both English and Chinese JSON files to enhance user support with clearer descriptions and additional contact information.
- Updated the layout of the PricingPage to include the FAQs component, improving information accessibility.
- Introduced new components for the hero section and pricing table, enhancing the overall user experience and engagement.
- Refactored the pricing layout to streamline the presentation of pricing options and improve maintainability.
2025-04-12 19:55:27 +08:00
javayhu
c43d423aa3 chore: optimize code 2025-04-12 17:42:08 +08:00
javayhu
3c72dd7098 chore: optimize login wrapper component & fix Hydration error
Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:

- A server/client branch `if (typeof window !== 'undefined')`.
- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.
- Date formatting in a user's locale which doesn't match the server.
- External changing data without sending a snapshot of it along with the HTML.
- Invalid HTML tag nesting.
2025-04-12 17:30:59 +08:00
javayhu
086eb5ab8e chore: optimize faqs block 2025-04-12 17:21:19 +08:00
javayhu
0a8934a6cf feat: add nav menus for integrations blocks and forgot-password blocks 2025-04-12 17:13:44 +08:00
javayhu
d5ae61d481 feat: add getUrlWithLocaleInCallbackUrl helper function 2025-04-12 15:26:43 +08:00
javayhu
74404eb0c6 feat: add FAQ block to pricing page
- Updated HomePage title and description to reflect new branding.
- Added a comprehensive FAQ section with questions and answers to improve user support.
- Modified the PricingPage layout to include the new FAQs component for better information accessibility.
2025-04-12 15:10:28 +08:00
javayhu
5026fb3b4d refactor: migrate blocks folder to nsui directory
- Updated import paths for various components to use the new nsui directory structure, enhancing organization and maintainability.
- Refactored layout and page components to align with the new structure, ensuring consistency across the codebase.
- Introduced new components such as BlockPreview and BlocksNav to improve modularity and reusability.
2025-04-12 14:18:08 +08:00
javayhu
78d5d9977b refactor: replace UserButton with UserButtonMobile in NavbarMobile & fix hydration error caused by UserButton
- Updated NavbarMobile to use UserButtonMobile for mobile user interactions.
- Introduced UserButtonMobile component to handle user actions in a mobile-friendly manner, including sign-out functionality and user avatar display.
- Removed unused drawer-related imports from UserButton component to streamline the codebase.
2025-04-12 14:08:50 +08:00
javayhu
5c85d80f81 feat: add FAQ and integration blocks from NSUI
- Introduced multiple FAQ pages (two, three, four) to enhance user support and information accessibility.
- Added integration sections (one, two, three, four, five, six, seven, eight) to showcase various tools and services.
- Implemented a development toolbar for easier debugging and page reloading during development.
- Removed the loading component as it was no longer needed.
- Updated the layout to conditionally render the development toolbar in development mode.
2025-04-12 13:53:37 +08:00
javayhu
1f4bec8eb2 chore: remove docs/components/tabs.client 2025-04-12 13:26:05 +08:00
javayhu
10c7646fb1 chore: remove docs/theme.client 2025-04-12 13:24:13 +08:00
javayhu
c0f4721d49 refactor: simplify theme management and localization
- Removed scaled and mono theme options from the theme selector and related components to streamline theme management.
- Updated localization files to reflect the removal of unused theme translations.
- Cleaned up CSS by eliminating unnecessary theme styles, enhancing maintainability and performance.
- Adjusted the WebsiteMetadata interface to remove references to obsolete themes, improving code clarity.
2025-04-12 13:14:39 +08:00
javayhu
44179984e5 refactor: update theme and payment providers
- Renamed and reorganized the ActiveThemeProvider and PaymentProvider components for better clarity and structure.
- Introduced the ActiveThemeProvider component to manage the active theme and set cookies accordingly.
- Implemented the PaymentProvider component to initialize payment state based on the user's session.
- Updated imports in related components to reflect the new file structure.
2025-04-12 13:03:06 +08:00
javayhu
751b015c04 refactor: remove unused marketing sections and components
- Deleted multiple marketing section files including call-to-action, content, FAQ, features, hero, pricing, stats, and testimonials to streamline the codebase.
- This cleanup enhances maintainability by removing obsolete components that are no longer in use.
2025-04-12 12:46:42 +08:00
javayhu
79dde803b4 refactor: update canonical URLs for legal pages
- Changed canonical URLs for cookie, privacy, and terms pages to remove unnecessary suffixes, enhancing SEO and URL consistency.
- Renamed the layout component for better clarity regarding its purpose in the marketing blocks structure.
2025-04-12 12:44:38 +08:00
javayhu
961163305a refactor: integrate website configuration for localization
- Replaced hardcoded locale data with a centralized website configuration structure, enhancing maintainability and consistency across components.
- Updated various components to utilize the new websiteConfig for locale flags and names, improving code clarity and reducing redundancy.
- Removed obsolete LOCALE_LIST and streamlined routing logic to align with the new configuration approach.
2025-04-12 11:54:45 +08:00
javayhu
8a0f396810 refactor: update price plan retrieval and configuration structure
- Renamed variables in the pricing table and billing card components for clarity, changing 'paymentConfig' to 'pricePlans'.
- Updated the getPricePlans function to return a more explicit Record type for better type safety and maintainability.
- Enhanced the structure of price plans by consolidating translation logic within the returned plans object, improving code organization and readability.
2025-04-12 11:03:27 +08:00
javayhu
b5de0fb940 refactor: optimize website configs
- Updated sidebar, footer, navbar, and user button components to use new naming conventions for configuration retrieval functions, enhancing code clarity and consistency.
- Renamed functions from getSidebarConfig, getFooterConfig, getNavbarConfig, and getAvatarConfig to getSidebarLinks, getFooterLinks, getNavbarLinks, and getAvatarLinks respectively.
- Adjusted the website configuration structure to include metadata for logos and social links, improving maintainability and organization of configuration data.
2025-04-12 10:46:58 +08:00
javayhu
6e1189afc4 feat: add admin user management page and support authroizeOnly for nav item
- Introduced a new admin section with user management capabilities, including a dedicated AdminUsersPage.
- Updated localization files to support new admin titles in English and Chinese.
- Added routing for the admin users page and integrated it into the sidebar configuration.
- Created necessary layout and loading components for the admin section.
- Implemented a data structure for user management, enhancing the overall admin functionality.
2025-04-12 09:54:55 +08:00
javayhu
dd6fb4df85 chore: rename dashboard components prefix with sidebar-
- Added descriptive comments for the DashboardPage, DashboardHeader, DashboardSidebar, SidebarMain, and SidebarUser components to improve code readability and maintainability.
- Enhanced understanding of component purposes and functionalities through clear documentation.
2025-04-12 08:35:05 +08:00
javayhu
f6bec8b78c refactor: restructure sitemap and robots handling
- Removed the old sitemap implementation and replaced it with a new one that generates dynamic routes for categories, posts, and documentation.
- Introduced a new robots.txt handler to manage crawling rules and specify the sitemap location.
- Updated URL handling functions to improve locale support in callback URLs.
- Enhanced the content-collections.ts file by reorganizing documentation comments and reintroducing the extractLocaleAndBase function for better clarity and maintainability.
2025-04-12 08:16:47 +08:00
javayhu
b951f92ff1 chore: optimize some component layouts 2025-04-12 01:01:46 +08:00
javayhu
e5840fe0f4 refactor: remove icons.tsx & update loading icons 2025-04-12 00:31:29 +08:00
javayhu
ad0eae7d62 feat: support showing limits for price plans 2025-04-12 00:16:51 +08:00
javayhu
c04499a353 feat: support analytics (google/umami/plausible/datafast/openpanel) 2025-04-11 23:54:05 +08:00
javayhu
257feba5bd fix: redirect to localized dashboard url after login
- Updated login-form.tsx, register-form.tsx, and social-login-button.tsx to utilize useLocale for dynamic callback URL generation based on the user's locale.
- Adjusted the default callback URL to include the locale, improving user experience and localization support in authentication flows.
2025-04-11 12:41:50 +08:00
javayhu
72326403a0 feat: implement middleware for route protection and localization
- Enhanced middleware functionality to manage access for protected routes based on user authentication status.
- Added logic to redirect users to the login page if they attempt to access protected routes while not logged in.
- Implemented a utility function to strip locale from the pathname for better route handling.
- Updated route definitions to categorize routes that are not accessible to logged-in users and those that require authentication.
- Improved comments and logging for better traceability and understanding of middleware operations.
2025-04-11 12:33:31 +08:00
javayhu
313625577c feat: remove planId from payment and subscription schema
- Created new SQL tables for account, payment, session, user, and verification to support user management and payment processing.
- Added foreign key constraints to link account, payment, and session tables to the user table for data integrity.
- Updated journal and snapshot metadata to reflect the new schema changes.
2025-04-11 01:23:13 +08:00
javayhu
f982e1b01a refactor: enhance logging and update comments for clarity
- Added detailed logging for active subscription retrieval in get-active-subscription.ts to improve traceability.
- Updated comments in pricing-table.tsx and billing-card.tsx to better describe the purpose of price plan retrieval.
- Modified payment types in types.ts to include 'incomplete_expired' for better status handling.
- Improved logging messages in stripe.ts for clearer debugging information during payment processing.
2025-04-11 00:39:32 +08:00
javayhu
60d68e059c refactor: update price plan functions and imports for consistency
- Replaced getPlanById with findPlanByPlanId in create-checkout-session.ts and stripe.ts for improved clarity.
- Removed unused getAllPricePlans import in pricing/layout.tsx to streamline the code.
- Updated price-plan.ts to enhance the findPlanByPlanId function and added error handling in findPriceInPlan.
- Adjusted payment-store.ts to reflect the updated price plan retrieval method.
2025-04-10 23:49:46 +08:00
javayhu
3cdb93bfc4 refactor: reorganize price plan imports and create price-plan module
- Updated import paths for price plan functions to use the new price-plan module for better modularity and maintainability.
- Removed redundant price plan functions from the payment module to streamline the codebase.
- Introduced a new price-plan.ts file to encapsulate price plan logic and improve code organization.
2025-04-10 23:37:21 +08:00
javayhu
7ace00c139 chore: update LICENSE 2025-04-10 23:16:20 +08:00
javayhu
876eb01506 chore: add TODO comments for future enhancements
- Added TODO comments in middleware.ts, routes.ts, sitemap.ts, and routing.ts to indicate areas for future improvements, including middleware rules for protected routes, route configuration, and sitemap entries.
- Included a comment in globals.css for reference to shadcn UI theming documentation.
2025-04-10 10:07:34 +08:00
javayhu
2cb95d8a1a refactor: update translation keys in configuration files
- Modified translation keys in avatar, footer, navbar, sidebar, and social configuration files to enhance modularity and maintainability.
- Removed redundant 'Marketing' prefix from translation keys for improved clarity and consistency across the application.
2025-04-10 09:56:43 +08:00
javayhu
643cbbef9b refactor: remove deprecated config.tsx and update import paths
- Deleted the config.tsx file as it is no longer needed for backward compatibility.
- Updated import paths in blog-card.tsx to reference the new location of PLACEHOLDER_IMAGE in constants.ts.
- Introduced a new constants.ts file to define PLACEHOLDER_IMAGE for improved modularity and maintainability.
2025-04-10 09:56:21 +08:00
javayhu
710dbe00b6 refactor: modularize configuration files and update imports
- Introduced new configuration files for navbar, footer, avatar, sidebar, social links, and payment plans to enhance modularity and maintainability.
- Updated import paths across the codebase to reference the new configuration files.
- Removed deprecated functions and streamlined the config.tsx file for better organization.
2025-04-10 00:58:14 +08:00
javayhu
4d47201ce3 refactor: reorganize website configuration and update imports
- Moved website configuration to a new file for better modularity and maintainability.
- Updated import paths across the codebase to reference the new website configuration location.
- Removed the old website configuration from the config.tsx file to streamline the codebase.
2025-04-10 00:43:52 +08:00
javayhu
165673a998 feat: add pricing plans and enhance payment configuration
- Introduced new pricing plans (Free, Pro, Lifetime) with detailed descriptions and features in both English and Chinese.
- Updated payment configuration to include new plans and their pricing structures.
- Refactored payment-related functions to retrieve pricing plans consistently across the application.
- Enhanced the PricingTable component to dynamically display available plans based on the new configuration.
- Removed deprecated payment configuration file to streamline the codebase.
2025-04-10 00:26:55 +08:00
javayhu
31a4823b54 refactor: update storage imports and improve function naming
- Changed import paths for StorageError to use the correct types module across storage-related API routes.
- Renamed functions in storage/index.ts for clarity, updating getStorageProvider and initializeStorageProvider to better reflect their functionality.
- Streamlined API endpoint constants for improved readability and maintainability in storage operations.
2025-04-09 23:50:57 +08:00
javayhu
41a2380791 refactor: reorganize mail and newsletter provider logic for clarity
- Updated mail provider functions to improve naming consistency and clarity, renaming initializeMailProvider to getMailProvider and vice versa.
- Enhanced README documentation for both mail and newsletter modules to reflect structural changes and clarify usage.
- Streamlined imports and exports in mail and newsletter files for better organization.
- Added error handling in ResendNewsletterProvider constructor to ensure required environment variables are set.
- Removed deprecated code and unnecessary type exports to simplify the codebase.
2025-04-09 23:44:11 +08:00
javayhu
d491835ef1 refactor: consolidate email sending logic and update template handling
- Merged sendTemplate and sendRawEmail functions into a single sendEmail function for improved clarity and maintainability.
- Introduced getTemplate function to handle rendering of email templates with context and locale.
- Updated EmailTemplates export to include all available templates directly in types.ts.
- Removed deprecated mail.ts and templates/index.ts files to streamline the codebase.
2025-04-09 23:28:57 +08:00
javayhu
9dca440d91 refactor: rename send function to sendEmail for clarity
- Updated references from send to sendEmail in send-message.ts and auth.ts for consistency.
- Adjusted exports in mail/index.ts to reflect the new function name.
- Removed unused mail-config.ts file to streamline the mail configuration process.
2025-04-09 23:18:01 +08:00
javayhu
2779eb9d5f refactor: update email templates and types for improved clarity
- Renamed Template type to EmailTemplate for consistency across the codebase.
- Updated email template functions to use simplified translation keys.
- Removed unused MailConfig interface and adjusted default mail configuration.
- Enhanced imports in mail-related files for better organization and readability.
2025-04-09 23:13:27 +08:00
javayhu
7b5754514c chore: rename email templates folder 2025-04-09 23:04:17 +08:00
javayhu
da67593e27 refactor: enhance pricing table logic
- Changed button class in ForgotPasswordForm and ResetPasswordForm to improve user interaction.
- Updated PricingCard to replace Check icon with CheckCircleIcon for better visual representation.
- Enhanced PricingTable logic to filter out disabled plans and prices, ensuring only available options are displayed.
- Added comments in payment types to clarify when to disable plans and prices for existing users.
2025-04-09 22:15:59 +08:00
javayhu
3c05657fe0 feat: add userId handling and enhance payment actions & optimize the whole payment process
- Introduced userId parameter in createCheckoutAction and createPortalAction for improved user-specific session management.
- Updated components to pass userId instead of customerId, aligning with the new payment structure.
- Added new actions to retrieve active subscription and lifetime status, ensuring users can check their subscription details securely.
- Created SQL migration for new payment-related tables, establishing a robust foundation for payment management.
- Enhanced error handling and logging in payment actions for better debugging and user feedback.
2025-04-09 14:31:08 +08:00
javayhu
e45d2504e6 refactor: clean up billing components and improve session handling
- Removed commented-out code in BillingPage to enhance readability.
- Updated CheckoutButton to always refetch session data for accurate user information.
- Streamlined console log statements in BillingCard for better clarity.
- Adjusted comments in BillingCard to provide clearer context on button visibility based on user status.
- Refactored usePayment hook to fetch payment data whenever the user session changes, improving data accuracy.
2025-04-09 01:19:07 +08:00
javayhu
ced7f41af2 refactor: update subscription handling and use payment & payment store
- Enhanced getCustomerSubscriptionAction to return the most recent active or trialing subscription when multiple subscriptions exist.
- Simplified UpgradeCard component by removing the user prop and directly utilizing the payment hook for current plan checks.
- Updated CustomerPortalButton to use 'default' variant instead of 'outline'.
- Refactored PricingTable to accept currentPlan instead of currentPlanId for improved clarity.
- Adjusted BillingCard to streamline error handling and utilize currentPlan for determining user status.
2025-04-09 00:22:19 +08:00
javayhu
097c1343be refactor: rename and update subscription handling methods
- Renamed ListCustomerSubscriptionsParams to getCustomerSubscriptionsParams for clarity.
- Updated listCustomerSubscriptions method in StripeProvider to getCustomerSubscriptions, improving consistency in naming.
- Adjusted method implementations to reflect the new naming conventions, enhancing code readability and maintainability.
2025-04-08 23:13:02 +08:00
javayhu
f34ee11df8 refactor: update payment schema and improve subscription handling
- Made customerId in the payment schema mandatory to ensure data integrity.
- Updated Subscription interface to make currentPeriodStart optional and replaced canceledAt with trialStartDate for better clarity.
- Refactored listCustomerSubscriptions method in StripeProvider to fetch subscriptions from the database instead of Stripe API, enhancing performance and maintainability.
- Added a new private method to map Stripe subscription status to the application's PaymentStatus for improved status handling.
2025-04-08 23:04:42 +08:00
javayhu
5753b1c28f feat: introduce payment management system and refactor related components
- Added new SQL migration to create "account", "payment", "user", and "verification" tables, establishing a foundational structure for payment management.
- Updated existing codebase to replace subscription references with payment, including hooks, providers, and actions.
- Refactored components to utilize the new payment system, enhancing clarity and maintainability.
- Removed deprecated subscription provider and related logic, streamlining the payment handling process.
- Enhanced error handling and logging for improved debugging in payment management.
2025-04-08 01:48:51 +08:00
javayhu
76e618bbea refactor: update payment types and improve subscription handling
- Renamed SubscriptionTypes to PaymentTypes to better reflect the payment model.
- Updated references in getUserLifetimeStatus action and StripeProvider to use the new PaymentTypes enum.
- Adjusted type definitions in payment/types.ts for clarity and consistency in payment handling.
- Enhanced comments to clarify the purpose of payment types and their usage in the codebase.
2025-04-08 01:10:25 +08:00
javayhu
e59824c97b feat: add subscription type handling and update related SQL migrations
- Introduced a new column "type" in the "subscription" table to differentiate between subscription types (one-time and recurring).
- Updated existing records to set the "type" based on the presence of "subscription_id".
- Modified the "interval" column to allow null values.
- Updated SQL snapshots and journal to reflect the new migration versions.
- Enhanced the getUserLifetimeStatus action to utilize the new subscription type logic for better membership status checks.
2025-04-08 01:04:23 +08:00
javayhu
c4fdcddf0a feat: enhance checkout session metadata and payment status handling
- Added userId to metadata in createCheckoutAction for improved webhook event processing.
- Updated StripeProvider to handle userId and planId from session metadata, enhancing subscription management.
- Introduced 'paused' status in PaymentStatus type for better subscription state representation.
- Improved comments for clarity in metadata handling and subscription status conversion.
2025-04-08 00:27:42 +08:00
javayhu
49a9de1a05 refactor: standardize session handling and clean up payment-related code
- Replaced instances of `authSession` with `session` for consistency across actions.
- Removed unused `getCustomer` function and related types from payment module to streamline codebase.
- Enhanced `createOrGetCustomer` method to simplify customer creation logic.
- Updated metadata handling in checkout session creation for improved clarity and maintainability.
2025-04-08 00:15:08 +08:00
javayhu
52559865ca feat: remove lifetimeMember from user schema && update fetch subscription
- Created SQL migration to drop unique constraint and columns from the user table.
- Updated journal and snapshot metadata to reflect the new migration version.
- Refactored user schema to remove the lifetimeMember field, aligning with the new subscription management logic.
- Enhanced getUserLifetimeStatus action to utilize updated subscription data structure.
2025-04-07 23:35:15 +08:00
javayhu
a4075c4728 feat: add getUserLifetimeStatus action and integrate with subscription store
- Implemented getUserLifetimeStatus action to retrieve user's lifetime membership status from the database.
- Updated subscription store to check lifetime membership status against the database if session data is outdated.
- Enhanced error handling and logging for better debugging in the subscription management process.
- Added console logs for tracking user session and lifetime status checks in billing components.
2025-04-07 01:28:36 +08:00
javayhu
7a5cf227c4 feat: implement subscription management features
- Added SubscriptionProvider to manage subscription state and initialize it on app load.
- Integrated useSubscription hook for accessing subscription data across components.
- Updated NavUser and UserButton components to reset subscription state on sign out.
- Refactored BillingCard to utilize the new subscription logic, improving clarity and performance.
- Enhanced UpgradeCard to conditionally render based on subscription status.
2025-04-06 23:59:48 +08:00
javayhu
be82337924 refactor: update billing card logic and localization
- Renamed variables for clarity, changing `isLifetimeMember` to `isLifetimePlan` and `canUpgrade` logic to improve readability.
- Added localization support for the price label in both English and Chinese.
- Optimized the UI to conditionally display messages for free and lifetime plans, enhancing user experience.
2025-04-06 23:08:53 +08:00
javayhu
9b0d354683 chore: optimize utils.tsx & remove other functions out 2025-04-06 23:01:53 +08:00
javayhu
3bd408e551 chore: remove getLocaleDate & change to formatDate 2025-04-06 22:56:55 +08:00
javayhu
c810acae4c refactor: optimize billing card UI and logic 2025-04-06 22:27:27 +08:00
javayhu
077df4ee28 chore: upload example env file 2025-04-06 22:26:50 +08:00
javayhu
6000c438da chore: refresh session after create new customer id for user
- Commented out console log statements in createCheckoutSession, createCustomerPortalSession, getUserSubscription, PricingCard, and CheckoutButton for cleaner output.
- Updated the reset-password-form to optimize the token validation check with a clearer comment.
2025-04-06 21:00:52 +08:00
javayhu
15ba1ef120 refactor: update productId to priceId in payment components and types
- Replaced instances of productId with priceId in PricingCard, BillingCard, and payment utility functions for consistency.
- Updated the Price interface in types.ts to reflect the change from productId to priceId.
- Adjusted payment configuration to use priceId instead of productId for better clarity and alignment with Stripe's API.
2025-04-06 17:30:47 +08:00
javayhu
a2849a9758 feat: add contact message email template and localization support
- Introduced a new email template for contact messages, including localization for English and Chinese.
- Updated the send-message action to utilize the new contact message template and added locale support.
- Enhanced the contact form validation schema and improved code formatting for consistency.
2025-04-06 17:28:31 +08:00
javayhu
345528e4b3 chore: remove username plugin in better auth 2025-04-06 17:09:42 +08:00
javayhu
1e8fe818bf feat: add interval column to subscription table and update subscription event handlers
- Introduced a new "interval" column in the "subscription" table to store subscription intervals.
- Updated the journal and snapshot metadata to reflect the new schema version and changes.
- Adjusted the schema definition to include the new column for better subscription management.
2025-04-06 15:27:59 +08:00
javayhu
cf1f20f867 chore: optimize pricing page 2025-04-06 12:49:36 +08:00
javayhu
788aa857a0 chore: rename legal pages routes 2025-04-06 11:41:04 +08:00
javayhu
2248cfdc35 feat: add subscription management features and database schema updates
- Introduced new database tables for managing subscriptions and user subscriptions.
- Updated package.json with new database commands for generation, migration, and studio.
- Refactored the user schema to remove deprecated fields and added foreign key relationships.
- Enhanced Stripe payment provider logic to handle subscription creation, updates, and cancellations.
- Improved error handling and logging for subscription events.
2025-04-06 11:12:27 +08:00
javayhu
e9c9d9f451 feat: support locale for customer portal session creation and improve upgrade card logic
- Added locale parameter to the createCustomerPortal function for better localization support.
- Simplified the membership check in the UpgradeCard component to only consider lifetime membership.
- Updated billing card logic to fetch subscription data based on lifetime membership status.
2025-04-06 09:40:33 +08:00
javayhu
73066348ea chore: rename upgrade card 2025-04-06 08:56:27 +08:00
javayhu
8d0f0a329c feat: add LICENSE 2025-04-06 08:54:10 +08:00
javayhu
36e76ef080 feat: enhance billing management features and localization updates
- Added new localization keys for billing management in English and Chinese message files.
- Updated the sidebar to include a billing link.
- Refactored the billing card component to improve loading state handling and user session management.
- Enhanced subscription fetching logic to include better error handling and logging.
- Adjusted the upgrade card visibility based on user membership status.
2025-04-06 00:48:08 +08:00
javayhu
b639a9e50a chore: optimize loading state when fetch current user 2025-04-05 22:30:05 +08:00
javayhu
df189215eb feat: add config for maxDuration to 60 for vercel 2025-04-05 20:21:57 +08:00
javayhu
05d811aa4e chore: update localization keys and remove schemas for auth pages
- Added new localization keys for email and password requirements in English and Chinese message files.
- Refactored page retrieval logic by replacing `getCustomPage` with `getPage` in cookie, privacy, and terms of service policy pages.
- Removed the unused `schemas.ts` file.
2025-04-05 17:45:54 +08:00
javayhu
ba1c87fc3e refactor: move some shared components to layout folder 2025-04-05 17:30:47 +08:00
javayhu
970ff2145e chore: move motion components 2025-04-05 17:30:22 +08:00
javayhu
fab6590ac7 chore: remove useless theme css files 2025-04-05 17:15:09 +08:00
javayhu
ccd1a2b568 chore: remove useless svg files 2025-04-05 16:59:50 +08:00
javayhu
2b952c5a5f chore: remove outdated issues document and update image paths
- Deleted the `ISSUES.md` file as it contained outdated information.
- Updated image paths in various components to remove the `/images` prefix for consistency.
2025-04-05 16:58:01 +08:00
javayhu
f380ba4484 fix: fix build error for intl messages 2025-04-05 14:47:19 +08:00
javayhu
43d6b2cbf7 fix: fix Logo component 2025-04-05 14:46:59 +08:00
javayhu
aa0aea352b chore: update localization keys for settings and improve message structure
- Removed unnecessary `items` segment path in internationalization messages for settings.
- Updated localization keys in the English and Chinese files for consistency and clarity.
2025-04-05 14:09:53 +08:00
javayhu
8ad6609527 chore: remove items segment path in intl messages for settings 2025-04-05 13:58:06 +08:00
javayhu
2dd6612e45 chore: remove sidebar segment path in intl message 2025-04-05 13:56:01 +08:00
javayhu
ea32f72313 feat: update localization messages and clean up sidebar configuration
- Changed key `authorIntroduction` to `introduction` in English and Chinese localization files for consistency.
- Added email validation message to the newsletter form.
- Restored the `NotFoundPage` section in the Chinese localization file.
- Cleaned up commented-out AI tools section in the sidebar configuration.
- Updated `DashboardSidebar` to use the `Routes` enum for improved routing clarity.
2025-04-05 13:51:32 +08:00
javayhu
5953031bee feat: support configs for light & dark logos 2025-04-05 13:30:19 +08:00
javayhu
f5600631f7 chore: remove locale in mdx files 2025-04-05 10:51:12 +08:00
javayhu
573ae347ed chore: update logo & favicons 2025-04-05 10:46:28 +08:00
javayhu
9dbe79593e refactor: rename navigation function and update sidebar component
- Renamed `getNavMainLinks` to `getSidebarLinks` for improved clarity in the configuration file.
- Updated the `DashboardSidebar` component to utilize the new `getSidebarLinks` function and integrated `useCurrentUser` for user status handling.
- Enhanced the sidebar to conditionally display the upgrade card and user profile based on membership status.
- Updated comments for better understanding of the code functionality.
2025-04-05 08:18:55 +08:00
javayhu
b5699b85f1 fix: fix build error for layout props 2025-04-05 07:54:30 +08:00
javayhu
e8ea6cdd5d refactor: simplify layout components and rename settings pages
- Removed unnecessary parameter handling in `BillingLayout`, `NotificationsLayout`, `ProfileLayout`, and `SecurityLayout` for cleaner code.
- Renamed `SettingsBillingPage` to `BillingPage` and `SettingsNotificationPage` to `NotificationPage` for improved clarity and consistency.
- Added new loading components for marketing legal and pages sections to enhance user experience during data fetching.
- Cleaned up commented-out code in the blog category metadata generation for better maintainability.
2025-04-05 00:23:03 +08:00
javayhu
7d1fcab6b4 feat: implement billing, notifications, profile, and security settings layouts and loading states
- Added new `BillingLayout`, `NotificationsLayout`, `ProfileLayout`, and `SecurityLayout` components to structure the respective settings pages.
- Introduced loading components for each section to enhance user experience during data fetching.
- Refactored `SettingsBillingPage`, `SettingsNotificationPage`, `ProfilePage`, and `SecurityPage` to utilize the new layouts, improving code organization and readability.
- Updated `DashboardHeader` to ensure consistent breadcrumb navigation across settings pages.
2025-04-05 00:13:37 +08:00
javayhu
1a9770d390 feat: refactor authentication forms to include callback URL handling
- Updated `LoginForm`, `RegisterForm`, and `SocialLoginButton` components to accept and utilize a `callbackUrl` prop for improved redirection after authentication.
- Removed the `showSocialLoginButton` prop from `AuthCard` as social login functionality is now integrated directly within the forms.
- Enhanced `LoginWrapper` to append the `callbackUrl` as a query parameter in the routing logic.
- Improved logging for better debugging and user feedback during authentication processes.
2025-04-04 22:42:11 +08:00
javayhu
db7d86851a feat: refactor authentication translations and improve loading indicators
- Moved common authentication messages to a new `common` namespace in English and Chinese translation files for better organization.
- Updated `LoginPage`, `RegisterPage`, and various form components to utilize the new translation keys.
- Enhanced loading indicators in `ForgotPasswordForm`, `LoginForm`, `RegisterForm`, and `ResetPasswordForm` components for improved user feedback.
- Refactored `SocialLoginButton` and `NavbarMobile` components to utilize the current user context for better user experience.
2025-04-04 19:56:43 +08:00
javayhu
043016e08d feat: implement LoginWrapper component for authentication handling
- Introduced a new `LoginWrapper` component to manage user authentication through modal or redirect modes.
- Integrated responsive design using media queries to control modal visibility based on device type.
- Updated routing logic to close the modal on route changes and handle login actions effectively.
- Refactored existing components to utilize the new `LoginWrapper` for improved user experience in authentication flows.
- Replaced instances of `useRouter` with `useLocaleRouter` for consistent locale handling across components.
2025-04-04 19:17:03 +08:00
javayhu
6f95e3c2b7 feat: enhance checkout session and refactor authentication forms
- Added locale parameter to the `createCheckoutAction` for improved localization support during checkout.
- Refactored `ForgotPasswordForm`, `LoginForm`, and `RegisterForm` components to optimize state management and remove redundant code.
- Updated `CheckoutButton` and `CustomerPortalButton` components to improve error logging and user feedback.
- Introduced a new `formatPrice` and `formatDate` utility functions in the `formatter` module for better code reuse.
- Cleaned up the `BillingCard` component by removing inline utility functions and utilizing the new formatter functions.
- Updated `StripeProvider` to handle locale in checkout session creation and improved error handling for better debugging.
2025-04-04 17:27:59 +08:00
javayhu
def0268d6e feat: enhance user metadata in checkout session and update pricing plan types
- Added user email to metadata in the `createCheckoutAction` for improved user tracking during checkout.
- Updated `PricePlan` interface to remove commented-out properties and clarify the `isLifetime` field.
- Refactored payment configuration to ensure `isLifetime` is consistently defined across plans.
- Improved error logging messages in the `StripeProvider` for better debugging and user feedback.
- Renamed the webhook handler method for clarity in the `StripeProvider`.
2025-04-04 16:46:24 +08:00
javayhu
23d4b2b42b refactor: update pricing table styles and remove webhook handler registration
- Adjusted padding and font size in the PricingTable component for improved UI consistency.
- Removed the `registerWebhookHandler` function and related comments from the payment module to streamline the codebase.
- Updated README to reflect changes in webhook functionality, emphasizing the use of the default handler in the Stripe provider.
- Cleaned up unused type definitions related to webhook event handling in the types module.
2025-04-04 16:25:21 +08:00
javayhu
2ab25a402b feat: add subscription_status column to user table and update related schema
- Introduced a new column `subscription_status` to the user table for improved subscription management.
- Updated the user schema in the database to reflect this change.
- Added a new migration file and snapshot for versioning.
- Updated the StripeProvider to handle subscription status updates in webhook events.
2025-04-04 13:58:08 +08:00
javayhu
ab8d85be00 feat: add subscription and membership fields to user schema and update related actions
- Introduced new columns `subscription_id` and `lifetime_member` to the user table for enhanced subscription management.
- Updated the user schema in the database to reflect these changes.
- Refactored actions to utilize the new user fields for better subscription handling.
- Enhanced error handling and logging in relevant actions for improved user feedback.
- Updated translations to include new messages related to subscription status and lifetime access.
2025-04-04 10:07:39 +08:00
javayhu
128748d33e feat: add inferAdditionalFields plugin to auth 2025-04-03 17:08:57 +08:00
javayhu
bc59f9ff3d feat: enhance internationalization and loading states in payment components
- Added loading messages in English and Chinese translations for better user feedback during checkout and customer portal actions.
- Updated `CheckoutButton` and `CustomerPortalButton` components to utilize new translation keys for loading states and error messages.
- Refactored `PricingCard` and `PricingTable` components to incorporate translated text for pricing details and actions, improving localization support.
2025-04-03 15:21:00 +08:00
javayhu
7ddb6bf93b feat: update payment flow and remove deprecated payment pages
- Updated success and cancel URLs in checkout session and customer portal session actions for consistency.
- Removed PaymentCancelPage and PaymentSuccessPage components to streamline the payment process.
- Refactored PricingCard component to improve link handling for free plans.
- Added logging for user customer ID in BillingCard for better debugging.
2025-04-03 13:19:15 +08:00
javayhu
c4f0c9d267 feat: update pricing page translations and enhance layout
- Updated English and Chinese translations for the PricingPage, adding a subtitle for clarity.
- Refactored the PricingPage layout to include a HeaderSection for improved presentation.
- Modified PricingCard component to handle optional interval and payment type parameters.
- Enhanced PricingTable component styling and logic for better user experience.
2025-04-03 10:19:20 +08:00
javayhu
b4ddefb990 feat: enhance checkout session logic and user metadata handling
- Updated `create-checkout-session` to require user login before checkout and added user ID and name to metadata.
- Removed email parameter from checkout actions and components to streamline the process.
- Refactored `CheckoutButton`, `PricingCard`, and `PricingTable` components to eliminate email handling.
- Improved `CreateCheckoutParams` to enforce customer email as a required field.
- Updated payment configuration to utilize enums for payment types and intervals for better maintainability.
2025-04-03 00:35:53 +08:00
javayhu
4c1e60c71d feat: update password management and billing components
- Renamed translation keys for password setup to reset for clarity in English and Chinese.
- Added new `getUserBillingDataAction` for fetching user subscription data.
- Refactored `create-checkout-session` to ensure user authentication during checkout.
- Updated `BillingCard` to utilize the new billing data fetching logic and improved error handling.
- Modularized profile settings components by updating import paths for better organization.
- Enhanced `CheckoutButton` to initiate checkout sessions with improved user feedback.
2025-04-03 00:11:56 +08:00
javayhu
63bf471b63 feat: update security settings UI and intl messages
- Renamed password management keys in translation files for clarity.
- Added new translation keys for saving and cancel actions in both English and Chinese.
- Refactored the DeleteAccountCard component to utilize a new PasswordCardWrapper for better modularity.
- Updated UpdatePasswordCard to enhance user feedback and maintain consistency in translation usage.
- Removed unnecessary client directive from billing page for improved performance.
- Renamed SettingsAccountPage to SettingsProfilePage for better clarity in profile settings.
2025-04-02 16:15:50 +08:00
javayhu
639347806b feat: optimize documentation components
- Introduced a new `DynamicCodeBlock` component for interactive code examples.
- Updated documentation structure by creating a `lazy` module for dynamic imports of components.
- Removed the deprecated `UiOverview` component to streamline the documentation.
- Enhanced image handling in `CustomMDXContent` with a new `ImageZoom` integration for better user experience.
- Added a new `Wrapper` component for consistent styling across documentation elements.
2025-04-02 15:53:34 +08:00
javayhu
6087d8f4dc chore: optimize blog read time intl message 2025-04-02 15:21:51 +08:00
javayhu
efcbff8d62 refactor: update create checkout session logic and improve error handling
- Refactored checkout session creation to enhance error handling and logging.
- Updated payment types and intervals to use enums for better clarity and maintainability.
- Improved pricing card and table components to utilize new payment type constants.
- Adjusted pricing amounts for subscription plans to reflect updated pricing structure.
- Enhanced user feedback for error scenarios during checkout and customer management.
2025-04-02 11:47:57 +08:00
javayhu
22f6bd795e chore: update blog card placeholder image 2025-04-01 21:42:10 +08:00
javayhu
e13a9c8184 fix: fix broken image urls in NSUI blocks 2025-04-01 21:26:34 +08:00
javayhu
dd12afcce0 feat: enhance blog pagination and related posts functionality
- Added pagination size and related posts size configurations to the website config.
- Updated blog components to utilize the new pagination settings.
- Introduced a new feature to display related posts on individual blog pages, improving user engagement.
- Added new translations for "More Posts" in English and Chinese.
2025-04-01 18:17:36 +08:00
javayhu
b1a93a6e49 chore: optimize blog card & add base64 placeholder image 2025-04-01 17:58:00 +08:00
javayhu
afab075808 fix: optimize pricing page UI 2025-04-01 15:52:21 +08:00
javayhu
746f450a89 refactor: update Tabs component usage in documentation files
- Replaced `groupId` prop with `items` prop in `<Tabs>` components across multiple MDX files for consistency.
- Added `<Tab>` components for "Fumadocs MDX" and "Content Collections" in relevant sections to enhance content organization.
- Improved code readability and maintainability by structuring tab content more clearly.
2025-04-01 15:47:08 +08:00
javayhu
7f4265892d feat: add new author and blog content files
- Introduced new author files for "Fox" in both English and Chinese with associated avatar images.
- Updated existing author names.
- Added new blog documentation files covering various topics, including "Fumadocs" and "Search" in both English and Chinese.
- Updated existing blog metadata, including authors and publication dates, to reflect recent changes and improve content organization.
2025-04-01 15:00:28 +08:00
javayhu
a3444c334a chore: optimize content collections remove logs 2025-04-01 01:45:05 +08:00
javayhu
cd73bf8282 feat: add locale extraction helper and new blog documentation
- Introduced `extractLocaleAndBase` function to streamline locale and base name extraction from filenames.
- Added new blog documentation files covering comparisons, internationalization, manual installation, and markdown usage in both English and Chinese.
- Removed outdated author and blog content files to enhance content organization and clarity.
- Updated `content-collections.ts` to utilize the new locale extraction function for improved file handling.
2025-04-01 01:43:51 +08:00
javayhu
8a0c6d3631 refactor: replace MDXContent with CustomMDXContent for enhanced component usage
- Updated multiple components to utilize CustomMDXContent, allowing for better integration of Fumadocs components.
- Removed direct imports of MDXContent and defaultMdxComponents, streamlining the content rendering process.
- Introduced CustomMDXContent in a new shared component file to encapsulate common MDX functionalities.
2025-04-01 00:58:45 +08:00
javayhu
fe04a2973e feat: add new documentation files for zh locale
- Introduced multiple new MDX files covering various topics including comparisons, customization, internationalization, manual installation, markdown usage, and component documentation.
- Enhanced the overall structure and organization of the documentation to improve user experience and accessibility.
- Added a meta JSON file to define the documentation structure and navigation.
- Implemented new layout files for different document types, improving the flexibility of the documentation framework.
2025-04-01 00:38:07 +08:00
javayhu
fe1159a8f5 refactor: change blog content file structure to docs content file structure
- Introduced `cleanup-old-content.js` for backing up and cleaning up old content directories.
- Added `migrate-content.js` to facilitate the migration of content types across locales.
- Created new author and blog content files in both English and Chinese, enhancing the content structure.
- Updated `content-collections.ts` to reflect new slug formats for authors.
- Added new category files for better content organization.
- Included privacy, cookie, and terms of service pages in both languages.
- Implemented initial release notes for versioning.
2025-03-31 23:50:27 +08:00
javayhu
08aa6abcc8 fix: fix ui bugs in navbar mobile 2025-03-31 23:23:29 +08:00
javayhu
1270058e99 chore: remove fumadocs-twoslash dependency and clean up imports
- Deleted the fumadocs-twoslash dependency from package.json and pnpm-lock.yaml.
- Updated accordion documentation to remove unnecessary twoslash syntax.
- Cleaned up imports in the DocPage component by removing unused Popup components.
2025-03-31 00:06:39 +08:00
javayhu
5a20dc5837 chore: remove unused fumadocs-typescript dependency and clean up AutoTypeTable
- Deleted the fumadocs-typescript dependency from package.json and pnpm-lock.yaml.
- Removed the props.ts file as it was no longer needed.
- Updated various MDX files to comment out AutoTypeTable references to props.ts for better clarity and maintainability.
2025-03-31 00:02:50 +08:00
javayhu
78a6684f53 refactor: update layout and newsletter components for improved styling and functionality
- Added a URL to the navigation in the DocsRootLayout for better routing.
- Increased padding in the NewsletterCard component for enhanced visual appeal.
- Updated the NewsletterForm button class to include a cursor pointer for better user interaction.
2025-03-30 23:53:47 +08:00
javayhu
f66add9b6a fix: try to fix build error
⨯ Error: File not found: /var/task/tsconfig.json

https://vercel.com/javayhux/mksaas-demo/logs?selectedLogId=5nc54-1743346216406-97da8acc6083
2025-03-30 23:38:02 +08:00
javayhu
16aaf55a91 refactor: enhance documentation feature and update dependencies
- Updated content collections to include new schemas for better document handling.
- Added new documentation files for comparisons, customization, and internationalization.
- Introduced a manual installation guide and improved markdown support.
- Updated package.json with new dependencies for enhanced functionality.
- Added new images for documentation and improved layout components for better user experience.
- Adjusted TypeScript configurations for better path management.
2025-03-30 22:34:16 +08:00
javayhu
5636a917ef refactor: enhance content collections and update localization
- Modified the meta collection to include files with 'meta**.json' for improved matching.
- Added new translation keys for 'blog' in English and Chinese localization files.
- Updated social links in the layout to use the XTwitterIcon for consistency.
- Adjusted image paths in the features page for better organization.
- Removed unused LocaleSwitcher import from the footer component.
2025-03-30 21:10:47 +08:00
javayhu
91f1d59b7c chore: add images for blocks 2025-03-30 20:51:28 +08:00
javayhu
1eb5b9cffe refactor: update default font and enhance localization
- Replaced font imports in the layout and font index files to use Noto and Bricolage fonts for improved typography.
- Updated global CSS variables to reflect the new font settings.
- Enhanced author introduction in English and Chinese localization files with a greeting emoji for better user engagement.
- Adjusted heading styles in the About page for consistency.
2025-03-30 14:58:12 +08:00
javayhu
d9451b7a74 fix: fix build error 2025-03-30 14:12:53 +08:00
javayhu
516cd70bba fix: update reading time display and enhance localization
- Changed the comment for average reading speed in content-collections.ts for clarity.
- Added a new translation key for reading time in English and Chinese localization files.
- Updated the BlogPostPage to utilize the new translation key for displaying estimated reading time, improving user experience and localization support.
2025-03-30 14:09:34 +08:00
javayhu
29ed01182e refactor: update prose styling in blog and custom pages
- Changed the prose class to prose-neutral in blog post and custom page components for improved typography consistency.
- Added a comment in the blog post page to clarify the necessity of the prose class for MDX styling.
- Enhanced the table of contents component with line-clamp for better text handling.
2025-03-30 13:34:31 +08:00
javayhu
e704153010 fix: update image tag in MDX files for consistency
- Replaced <Image> component with <img> tag in multiple MDX files to standardize image rendering.
- Updated alt text in the Chinese blog post for improved accessibility.
2025-03-30 13:27:41 +08:00
javayhu
08fee6d1ec refactor: streamline MDX handling and enhance content collections
- Replaced the custom Mdx component with MDXContent from @content-collections/mdx/react for improved MDX processing.
- Updated content handling in various legal and blog pages to directly use the transformed body from content collections.
- Introduced estimated reading time calculation in the posts collection for better user experience.
- Added a new mdx.css file for consistent styling across MDX components.
- Removed the obsolete shared mdx-component file to reduce redundancy.
2025-03-30 13:27:30 +08:00
javayhu
c3a774e1cb fix: update docs & optimize docs layout & pages
- Translated the title and paragraphs in multiple .mdx files from Chinese to English for consistency and clarity.
- Adjusted the layout.tsx to change the font class for improved typography.
- Enhanced the Providers component with detailed comments for better understanding of the provider structure.
2025-03-30 10:34:49 +08:00
javayhu
584d3faa1a refactor: move docs RootProvider to LocaleLayout Providers 2025-03-30 10:28:57 +08:00
javayhu
5b7dae6586 fix: fix code style inside and outside pre 2025-03-30 10:02:33 +08:00
javayhu
16926cdaf1 refactor: enhance contact and waitlist form components with transition handling
- Replaced isSubmitting state with useTransition for improved form submission handling in ContactFormCard and WaitlistFormCard components.
- Updated form submission logic to handle errors more effectively and provide user feedback through toast notifications.
- Adjusted button states to reflect pending submissions, enhancing user experience during form interactions.
- Modified styling in mdx-component to use 'text-primary' for anchor elements, ensuring consistent theming across the application.
2025-03-30 00:50:15 +08:00
javayhu
26c89575d8 refactor: restructure mode and theme translations for improved organization
- Updated English and Chinese translation files to nest mode-related entries for better clarity.
- Adjusted components to utilize the new translation structure, enhancing accessibility and maintainability.
- Ensured consistent usage of translation keys across ModeSwitcher and ThemeSelector components.
2025-03-30 00:32:07 +08:00
javayhu
f26442f611 feat: update theme structure and enhance newsletter functionality
- Refactored theme-related translations in English and Chinese to a nested structure for better organization.
- Updated the default theme in the configuration to "default" for consistency.
- Enhanced the WaitlistPage and Newsletter components with improved descriptions and error handling.
- Integrated the NewsletterCard component into the BlogPostPage for better user engagement.
- Adjusted the ThemeSelector to utilize the new translation structure for theme names.
- Improved styling and layout in the NewsletterForm for a better user experience.
2025-03-30 00:29:41 +08:00
javayhu
92ffc545de feat: enhance mdx-component with pre context and style adjustments
- Introduced PreContext to track whether the code component is inside a pre element, improving styling logic.
- Updated heading components (h3, h4, h5, h6) to use 'font-medium' instead of 'font-semibold' for consistent typography.
- Adjusted code component styling to conditionally apply background based on context, enhancing visual clarity.
2025-03-29 22:54:58 +08:00
javayhu
88202b7cc9 feat: update documentation and enhance internationalization support
- Commented out the <Cards> component in index.mdx and introduction.mdx for clarity.
- Added new translation entries for "homepage" and "title" in both English and Chinese message files.
- Refactored layout.tsx to include a new baseOptions configuration for improved layout management and theme support.
- Integrated ModeSwitcher and Logo components into the layout for enhanced user experience.
- Updated page.tsx to prepare for potential Mdx component integration.
2025-03-29 22:36:22 +08:00
javayhu
34ffcc989e feat: implement theme switcher & intl and support theme config
- Added new mode switcher components for both horizontal and dropdown layouts to facilitate theme toggling.
- Updated translation files to include new theme-related entries in English and Chinese.
- Refactored existing components to replace ThemeSwitcher with ModeSwitcher for consistency.
- Introduced new themes in the configuration and updated the theme selector to utilize translations for theme names.
- Enhanced global styles to support new themes and ensure proper application across the project.
2025-03-29 22:15:00 +08:00
javayhu
42c2460718 feat: update logo & favicon images
- Updated ISSUES.md to reflect a new issue regarding page layout shifting when navigating between docs and the homepage.
- Changed permissions for several image files to ensure proper access and usage.
- Added new SVG files for enhanced iconography in the project.
2025-03-29 21:20:45 +08:00
javayhu
8374ec9564 fix: enable TailwindIndicator in locale layout and update login button cursor style
- Un-commented the TailwindIndicator component in layout.tsx to ensure it is rendered for styling purposes.
- Updated the login button in login-form.tsx to include a cursor-pointer class for better user experience when hovering over the button.
2025-03-29 17:37:31 +08:00
javayhu
de37908d05 feat: add translations for DocsPage in English and Chinese
- Introduced new translation entries for the DocsPage, including Table of Contents, search functionality, last update information, and pagination controls in both English and Chinese.
- Refactored layout.tsx to utilize dynamic translations from the message files, enhancing internationalization support and maintainability.
2025-03-29 16:28:37 +08:00
javayhu
5c96b83455 feat: update locale handling in docs layout
- Refactored the locales array in layout.tsx to dynamically generate language options from LOCALE_LIST for improved maintainability and consistency with internationalization practices.
- Removed hardcoded locale entries to streamline the code and enhance flexibility in supporting additional languages.
2025-03-29 16:22:04 +08:00
javayhu
9366ac60f2 fix: fix search Chinese not work in docs
- Added a guideline to use `pnpm` as the default package manager in TypeScript best practices.
- Refactored the search API route to improve readability by simplifying the mapping of pages to search indexes.
- Wrapped the GET handler with locale detection from the referer header and ensured the locale parameter is passed to the search API for better internationalization support.
2025-03-29 16:12:59 +08:00
javayhu
4fe8d78099 feat: add generateStaticParams in docs page
- Added generateStaticParams function in page.tsx to support dynamic locale and slug parameters for improved routing.
- Included console logging in the search API route for better debugging and visibility of search index data.
2025-03-29 14:42:28 +08:00
javayhu
83f5760126 feat: enhance documentation and internationalization support
- Updated content-collections.ts to clarify usage for Fumadocs.
- Added new ISSUES.md file to track known issues.
- Introduced @orama/orama and @orama/tokenizers dependencies in package.json for improved search functionality.
- Enhanced search API route to support internationalization and custom tokenizers for Chinese.
- Added new introduction and documentation files in both English and Chinese.
- Removed outdated test.mdx file to streamline documentation.
- Improved error handling and metadata generation in page.tsx for better user experience.
2025-03-29 14:30:29 +08:00
javayhu
02af1c7512
Merge pull request #15 from MkSaaSHQ/docs
feat: docs support theme and i18n
2025-03-29 12:33:30 +08:00
javayhu
c15980b32a feat: update documentation and enhance internationalization support
- Updated documentation links in content-collections.ts for accuracy.
- Modified index.mdx and test.mdx files to improve content structure and clarity.
- Added new Chinese documentation file (index.zh.mdx) to support localization.
- Enhanced layout.tsx to include translations for English and Chinese.
- Updated page.tsx to handle locale parameters for improved routing.
- Refactored source.ts to streamline imports and maintain consistency.
2025-03-29 12:32:25 +08:00
javayhu
c81447e2ef feat: implement new documentation layout and enhance middleware
- Added a new layout configuration for documentation with internationalization support.
- Created a dedicated DocsRootLayout and associated providers for better structure.
- Updated middleware to refine route handling for documentation.
- Removed outdated layout configurations and components to streamline the codebase.
- Enhanced localization support for documentation in English and Chinese.
2025-03-29 11:39:44 +08:00
javayhu
1445f6a5f4
Merge pull request #14 from MkSaaSHQ/docs
feat: support docs powered by fuma docs
2025-03-27 00:12:16 +08:00
javayhu
45d46082f2 feat: add documentation structure and enhance content collections
- Introduced new content collections for documentation and metadata using Fumadocs.
- Created initial documentation files and layout for the docs section.
- Updated routing and middleware to support the new docs structure.
- Enhanced localization support by adding new entries for documentation in English and Chinese.
- Implemented a new API route for search functionality within the documentation.
2025-03-27 00:09:13 +08:00
javayhu
23aa0f179e refactor: streamline locale handling in components
- Removed unnecessary checks in locale handling functions across NavUser, LocaleSelector, and LocaleSwitcher components to simplify the code.
- Adjusted padding in NavbarMobile component for improved layout consistency and user experience.
2025-03-26 21:45:06 +08:00
javayhu
7211e6981c refactor: update page structure and enhance layout consistency
- Changed import path for Pricing component in HomePage to utilize the new preview structure.
- Adjusted layout in ContactPage and WaitlistPage by adding bottom padding for improved spacing.
- Modified HeroSection component to enhance layout with consistent padding.
- Cleaned up commented-out code in BlockPreview and Navbar components for better readability and maintainability.
2025-03-26 10:00:31 +08:00
javayhu
f1b1789207 feat: enhance locale handling and add new blocks route
- Added a new route for blocks to improve navigation structure.
- Fixed locale inconsistency in BlocksNav component by removing custom locale handling.
- Implemented checks in locale selector components to prevent unnecessary locale updates.
- Updated comments to reflect changes and improve code clarity.
2025-03-26 00:52:08 +08:00
javayhu
c9e4b7eb0b refactor: update import paths and enhance HomePage structure
- Replaced imports in HomePage component to utilize new preview paths for better organization.
- Updated Features and Pricing components to align with the new structure.
- Wrapped CallToAction component in a div for improved layout consistency.
- Commented out unused HeroHeader in the HeroSection component for clarity.
2025-03-26 00:32:51 +08:00
javayhu
91b2bdb4ac fix: update Chinese translations and enhance blocks navigation
- Updated Chinese translations in zh.json to include spaces between words and components for improved readability.
- Enhanced BlocksNav component to correctly handle locale from URL parameters, ensuring accurate navigation across different locales.
- Commented out unused imports in blocks.ts for clarity and to prevent confusion.
2025-03-26 00:27:19 +08:00
javayhu
87bb54b7c5 refactor: reorganize BlockCategoryPageProps interface and enhance BlockPreview component
- Moved BlockCategoryPageProps interface definition to improve code structure.
- Refactored BlockPreview component to utilize useCopyToClipboard hook for better clipboard functionality.
- Cleaned up commented-out code and improved readability in the BlockPreview component.
2025-03-26 00:04:18 +08:00
javayhu
af94ab6dd0 feat: update navigation and add new block components
- Disabled development indicators in next.config.ts for cleaner output.
- Updated English and Chinese message files to include new block titles for logo, login, signup, and contact sections.
- Refactored routes to include new paths for login, signup, and contact blocks.
- Introduced new layout and page components for marketing sections, including logo cloud and various call-to-action pages.
- Enhanced blocks navigation component to utilize updated paths and improve user experience.
2025-03-25 23:57:51 +08:00
javayhu
aefe37068b fix: fix build error caused by DualModeImage 2025-03-25 00:51:48 +08:00
javayhu
762760545d refactor: add category layout and block preview components & move to blocks folder
- Introduced a new layout for category pages to enhance navigation and organization of blocks.
- Added a block preview component to display various UI blocks dynamically based on category.
- Updated routes to reflect the new structure for hero blocks.
- Refactored existing hero section components to utilize the new block structure for improved modularity.
2025-03-25 00:49:10 +08:00
javayhu
25433c0570 refactor: restructure marketing sections and components to sections folder
- Updated import paths for marketing components to a new directory structure under 'sections'.
- Removed the deprecated features page and replaced it with a new structure for content and sections.
- Added new sections for call-to-action, content, FAQs, features, hero, pricing, stats, and testimonials to enhance the marketing layout.
- Introduced multiple new components for better organization and modularity in the marketing section.
2025-03-25 00:46:12 +08:00
javayhu
d9e885416a refactor: optimize code format for nsui components
- Updated import statements across multiple files to use consistent semicolon usage.
- Enhanced component structure by ensuring proper formatting and return statements.
- Improved readability and maintainability of the codebase by adhering to coding standards.
2025-03-25 00:43:31 +08:00
javayhu
cc0f17f722 feat: add NSUI components and support preview
- Added Cloudinary as an allowed image domain in next.config.ts for image optimization.
- Included new dependencies: react-use-measure and use-media in package.json for enhanced UI responsiveness.
- Introduced a service worker for caching iframe content to improve performance.
- Added multiple new block components and layouts for enhanced UI features and organization.
- Implemented utility functions and motion primitives for improved animations and effects.
2025-03-25 00:40:22 +08:00
javayhu
ef740e23db feat: add authentication checks to checkout and customer portal actions
- Integrated authentication session validation in createCheckoutAction and createPortalAction to ensure only authorized users can create sessions.
- Enhanced unsubscribeNewsletterAction with similar authentication checks for improved security and user feedback.
2025-03-24 23:54:59 +08:00
javayhu
bf4f296fe1 feat: update drizzle configuration and dependencies for Neon integration
- Updated drizzle configuration to use the Neon HTTP driver for improved compatibility with Next.js.
- Added @neondatabase/serverless package to package.json for serverless database support.
- Modified database connection logic to utilize the new Neon client.
- Removed deprecated customer creation method in StripeProvider for cleaner code.
2025-03-24 10:14:49 +08:00
javayhu
acb468fd36 feat: add customerId to user table as additionalFields 2025-03-24 09:48:14 +08:00
javayhu
a7d2ddef1a feat: enhance Stripe payment provider with customer management and error handling
- Added functionality to create or get a Stripe customer based on email, improving user experience during checkout.
- Implemented robust error handling for updating user records with customer IDs.
- Updated README to reflect new actions for creating checkout sessions and customer portal sessions.
2025-03-24 01:09:21 +08:00
javayhu
c577cbc933 feat: add column customerId in user table 2025-03-24 00:22:21 +08:00
javayhu
ff06d4dfec feat: implement newsletter and payment actions with improved error handling
- Added actions for checking newsletter subscription status, subscribing, and unsubscribing.
- Introduced actions for creating checkout and customer portal sessions with validation.
- Replaced deprecated newsletter actions in components with new implementations.
- Enhanced error handling and logging for all new actions to improve user feedback.
2025-03-23 17:06:51 +08:00
javayhu
a6e2ee698a refactor: update site metadata and translations
- Renamed "Site" to "Metadata" in translation files for clarity.
- Updated the title, tagline, and description in both English and Chinese translations to reflect the new branding.
- Adjusted references in various components to use the updated metadata structure.
- Removed the obsolete site.webmanifest file and updated the manifest path in the metadata construction.
2025-03-23 15:37:38 +08:00
javayhu
7cf3a5afe8
Merge pull request #13 from javayhu/main
fix: fix shadcnui calendar component after upgrade react-day-picker
2025-03-23 15:36:18 +08:00
javayhu
15dab2549a fix: fix shadcnui calendar component after upgrade react-day-picker 2025-03-23 15:34:32 +08:00
javayhu
c4d6bb5d70 refactor: upgrade react-day-picker to version 9.6.3 2025-03-23 07:58:10 +08:00
javayhu
3e0d1eaaa1 fix: optimize code 2025-03-23 07:56:50 +08:00
javayhu
db054ccdcc feat: enhance dashboard and settings UI with new icons and improved layout
- Added new icons (CircleUserRoundIcon and LockKeyholeIcon) to the main navigation links for better visual representation.
- Introduced a new data.json file to centralize dashboard data management, improving organization and modularity.
- Updated the dashboard page to correctly import the new data source.
- Enhanced the billing settings page layout with additional spacing and descriptions for better user guidance.
- Improved mobile navbar styles for a more consistent user experience.
- Refactored billing card component to streamline the display of subscription plans and billing history.
2025-03-22 13:54:20 +08:00
javayhu
a9e0ce57d3 refactor: update account settings to profile and enhance multilingual support
- Renamed account settings to profile in English and Chinese translations for clarity.
- Updated routing and component references to reflect the new profile terminology.
- Removed the multilingual blog documentation as it is no longer needed.
- Enhanced the profile settings page with appropriate translations and layout improvements.
2025-03-22 11:19:20 +08:00
javayhu
7af79df7c4 feat: enhance AI tool pages with descriptions and loading state
- Added descriptions for AI Text, Image, Video, Audio tools in English and Chinese translations to improve user guidance.
- Introduced a loading component for better user experience during data fetching in the dashboard.
- Refactored AI tool pages to utilize updated translations and improved layout for consistency across the application.
2025-03-22 10:28:02 +08:00
javayhu
3bceaea045 fix: enhance password update experience and UI consistency
- Updated Chinese translation for password hint to improve clarity.
- Added rounded styling to the logo in the dashboard sidebar for better aesthetics.
- Replaced loading state with a skeleton card in the password update component to enhance user experience during data fetching.
- Adjusted skeleton card dimensions for improved visual consistency.
2025-03-22 10:17:52 +08:00
javayhu
bd9772222a refactor: move password cards to components/settings/security 2025-03-22 10:05:59 +08:00
javayhu
a42a183302 feat: add security settings page and enhance translations
- Introduced a new Security settings page with options for password management and account deletion.
- Updated English and Chinese translations to include new terms for saving, canceling, and security settings.
- Enhanced navigation by adding a link to the Security settings in the main sidebar.
- Refactored existing components to utilize updated translations for consistency across the application.
2025-03-22 10:01:49 +08:00
javayhu
fa2c3f18ce refactor: improve UI consistency and enhance user experience in account settings
- Updated English translations for password setup to remove trailing periods for consistency.
- Refactored DashboardLayout to improve spacing around children components.
- Enhanced styling in various card components (ContactFormCard, DeleteAccountCard, ResetPasswordCard, UpdateAvatarCard, UpdateNameCard, UpdatePasswordCard, NewsletterFormCard, WaitlistFormCard) to ensure consistent use of flexbox and improved layout.
- Adjusted font weight in card titles for a more uniform appearance across components.
2025-03-22 09:38:51 +08:00
javayhu
2b6ce8b3ae chore: optimize ui styles 2025-03-22 08:20:44 +08:00
javayhu
270882253d refactor: enhance account and notification settings with descriptions and layout improvements
- Added descriptions for account and notification settings in the English translation file for better user guidance.
- Updated the layout of the account and notification settings pages to improve readability and organization.
- Adjusted the Dashboard route to '/dashboard' for consistency.
- Enhanced various card components to ensure full height and improved styling.
- Introduced a loading skeleton for the password update card to enhance user experience during data fetching.
2025-03-22 01:17:05 +08:00
javayhu
a5df30d441 feat: restructure dashboard components and introduce new data management
- Added a new data.json file to centralize dashboard data management.
- Refactored dashboard components to improve organization and modularity, including the introduction of ChartAreaInteractive and SectionCards.
- Updated imports in the dashboard page to reflect new component paths and data source.
- Removed deprecated dashboardv4 components to streamline the codebase.
- Enhanced the DashboardSidebar for better navigation and user experience.
2025-03-22 00:19:17 +08:00
javayhu
dbffd6ff66 refactor: enhance dashboard layout and sidebar navigation
- Updated AI section titles in English and Chinese translations for clarity.
- Refactored sidebar components to improve navigation structure, replacing SidebarMain with NavMain and NavUser for better modularity.
- Introduced SidebarUpgradeCard to promote upgrade options within the sidebar.
- Adjusted DashboardLayout and DashboardHeader for improved styling and responsiveness.
- Removed deprecated SidebarMain component to streamline the codebase.
2025-03-22 00:05:55 +08:00
javayhu
3102dab50d refactor: update routes and enhance component styles for better usability
- Changed the Dashboard route to '/dashboardv4' for versioning clarity.
- Improved styling in BlogCategoryListDesktop and BlogCategoryListMobile for better user interaction with cursor styles.
- Added cursor pointer to various components including SidebarUser, LocaleSelector, and ThemeSwitcher for enhanced usability.
- Updated global CSS variables for improved color consistency across the application.
2025-03-21 21:58:19 +08:00
javayhu
73ac2ba2cb refactor: update component styles and structure for consistency (upgrade tailwindv4)
- Adjusted layout and styling in AuthCard, LoginForm, RegisterForm, and SocialLoginButton for improved alignment and responsiveness.
- Updated icon sizes in various components to maintain uniformity.
- Enhanced Card components in ContactFormCard, DeleteAccountCard, ResetPasswordCard, UpdateAvatarCard, UpdateNameCard, UpdatePasswordCard, and NewsletterFormCard with consistent padding and margin.
- Refined Navbar and BackButtonSmall for better user interaction with cursor styles.
- Removed unused CSS variables from globals.css to streamline styles.
2025-03-21 10:13:31 +08:00
javayhu
711a5b65b6 fix: fix build error caused by confetti component
Module '"@/components/ui/button"' has no exported member 'ButtonProps'.
2025-03-21 09:41:33 +08:00
javayhu
8e6e6f40a3
Merge pull request #12 from MkSaaSHQ/tailwindv4
upgrade Tailwind v4 & add Shadcn Dashboard
2025-03-21 01:15:44 +08:00
javayhu
6fe436665b feat: upgrade tailwind to v4 (9) shadcnui admin components 2025-03-21 01:01:11 +08:00
javayhu
675d4ff780 feat: upgrade tailwind to v4 (8) upgrade shadcn dependencies 2025-03-21 00:47:12 +08:00
javayhu
808699b238 feat: upgrade tailwind to v4 (7) shadcnui admin components 2025-03-21 00:45:13 +08:00
javayhu
01ad90e905 feat: upgrade tailwind to v4 (6) shadcnui components 2025-03-21 00:25:33 +08:00
javayhu
e91e8c02a6 feat: upgrade tailwind to v4 (5) optimize globals.css 2025-03-21 00:21:28 +08:00
javayhu
b2dd3d1694 feat: upgrade tailwind to v4 (4) nsui components 2025-03-21 00:09:58 +08:00
javayhu
6a3be051e4 feat: upgrade tailwind to v4 (3) magicui components 2025-03-21 00:09:42 +08:00
javayhu
62413b37ba feat: upgrade tailwind to v4 (2) template components 2025-03-21 00:09:11 +08:00
javayhu
9a5d3a0067 feat: upgrade tailwind to v4
https://tailwindcss.com/docs/upgrade-guide
2025-03-21 00:07:17 +08:00
javayhu
4d18f6fa5a refactor: remove unused MDX styles and update global CSS
- Deleted the `mdx.css` file as it contained redundant styles.
- Added new MDX styles directly into `globals.css` for improved organization and maintainability.
- Updated legal pages to remove the import of the now-deleted `mdx.css`, streamlining the codebase.
2025-03-20 23:45:38 +08:00
javayhu
56d48078b6 refactor: update typography and styling in layout and MDX components
- Replaced font class in `LocaleLayout` with `fontDMSans` for improved typography consistency.
- Enhanced paragraph, list, and list item components in `mdx-component` to include `text-muted-foreground` for better readability.
- Added a `strong` component to `mdx-component` for semantic emphasis with appropriate styling.
- Updated global CSS import to use `theme.css` for unified theming across the application.
2025-03-20 23:39:01 +08:00
javayhu
c9edd2a906 fix: fix build error for font not found 2025-03-20 11:25:08 +08:00
javayhu
dac717673d refactor: update font configurations in Tailwind and layout
- Replaced existing font imports with new Google Fonts (DM Sans, DM Mono, DM Serif Text) for improved typography.
- Updated Tailwind configuration to reflect the new font variables and added a new heading font style.
- Adjusted layout component to utilize the updated font classes, enhancing overall design consistency.
2025-03-20 10:07:39 +08:00
javayhu
aa0622b940 refactor: streamline user avatar handling across components
- Updated the `UserAvatar` component to require a non-optional `image` prop, enhancing type safety.
- Simplified the usage of `UserAvatar` in `SidebarUser` and `UserButton` components by removing unnecessary nullish coalescing.
- Improved code clarity and consistency in user-related components by ensuring direct access to user properties.
2025-03-19 16:28:15 +08:00
javayhu
50af2e726c
Merge pull request #11 from MkSaaSHQ/payment
support Payment module
2025-03-19 10:14:46 +08:00
javayhu
9c8c54799f refactor: implement newsletter module with Resend provider integration
- Introduced a comprehensive newsletter module for managing subscriptions, including functions to subscribe, unsubscribe, and check subscription status.
- Created a `ResendNewsletterProvider` class to handle interactions with the Resend API, improving modularity and code organization.
- Re-exported relevant types for better accessibility and convenience.
- Added a README file detailing usage, configuration, and advanced features of the newsletter module.
- Implemented automatic configuration using environment variables and provided a programmatic configuration option.
2025-03-19 01:45:40 +08:00
javayhu
9e1c648a7c refactor: enhance storage module with S3 provider integration
- Introduced a new S3Provider class for managing file uploads, deletions, and presigned URL generation with Amazon S3.
- Refactored existing storage functions to utilize the new provider, improving modularity and code organization.
- Re-exported types for better accessibility and convenience.
- Implemented robust error handling for storage operations, ensuring clear error messages for configuration and upload issues.
- Updated the storage configuration to support S3-compatible services, enhancing flexibility.
2025-03-19 01:10:46 +08:00
javayhu
130338b9a5 refactor: refactor mail module & enhance auth email with locale support
- Added locale handling to email sending functions, allowing for localized URLs in reset password and verification emails.
- Introduced a new utility function `addLocaleToUrl` to append locale to callback URLs in authentication flows.
- Refactored the email sending process to utilize a mail provider interface, supporting both templated and raw email sending.
- Created a comprehensive README for the email system, detailing usage, configuration, and available templates.
- Established a default mail configuration for improved email management.
2025-03-19 01:00:14 +08:00
javayhu
6744c52087 feat: enhance billing and payment features
- Updated English and Chinese localization files to include detailed billing and subscription management messages.
- Introduced new payment actions for creating checkout and customer portal sessions.
- Added success and cancel pages for payment processing.
- Implemented a billing card component to manage subscriptions and payment methods.
- Created a pricing table component to display available plans with interval selection.
- Established a Stripe webhook handler for processing payment events.
- Refactored existing components to integrate new payment functionalities and improve user experience.
2025-03-19 00:09:58 +08:00
javayhu
a853c56994 refactor: update navbar and mobile menu styles for improved accessibility
- Replaced primary color references with foreground color for hover and focus states in Navbar and MainMobileMenu components.
- Adjusted padding in the mobile menu's bottom buttons for better layout consistency.
- Switched the global CSS import from theme.css to theme-blue.css for updated styling.
2025-03-18 17:46:14 +08:00
javayhu
41b6d0b63b chore: optimize user button 2025-03-18 17:26:57 +08:00
javayhu
87e956493e fix: fix user button hydration error 2025-03-18 17:16:38 +08:00
javayhu
14e4620c5c refactor: optimize fonts 2025-03-18 17:05:40 +08:00
javayhu
c563c537f4 feat: update shadcn ui components (new-york) 2025-03-18 16:38:19 +08:00
javayhu
bc15dfc679 chore: rename to getSidebarLinks 2025-03-18 13:44:13 +08:00
javayhu
3d380dc88c refactor: streamline translation handling in menu and footer components
- Removed the custom translation function and replaced it with `useTranslations` from `next-intl` for better integration with localization.
- Updated `getMenuLinks`, `getFooterLinks`, `getAvatarLinks`, and `getSidebarMainLinks` functions to eliminate the need for passing a translation function as a parameter.
- Simplified the `SidebarMain`, `Footer`, `Navbar`, and `UserButton` components to directly utilize the updated link retrieval functions, enhancing code clarity and maintainability.
2025-03-18 12:59:29 +08:00
javayhu
e934c7a3ba refactor: streamline legal page structure and improve layout
- Removed unnecessary hostname entry from `next.config.ts`.
- Introduced `LegalLayout` component for consistent layout across legal pages.
- Added `CookiePolicyPage`, `PrivacyPolicyPage`, and `TermsOfServicePage` components to handle respective legal content with metadata generation.
- Updated `PageLayout` component for better naming consistency.
- Simplified `AboutPage`, `ContactPage`, and `WaitlistPage` layouts by removing redundant padding.
- Cleaned up `PricingPage` by removing unused pricing components.
2025-03-18 12:17:46 +08:00
javayhu
35ee109cd3 Merge branch 'main' of https://github.com/MkSaaSHQ/mksaas-template 2025-03-18 11:45:10 +08:00
javayhu
0fa2562129 refactor: enhance localization and component structure in settings
- Updated English and Chinese localization files to improve newsletter subscription labels and team references.
- Renamed route for notifications from `SettingsNotification` to `SettingsNotifications` for consistency.
- Refactored `DashboardPage`, `SettingsBillingPage`, and `SettingsAccountPage` to streamline layout and improve responsiveness.
- Introduced `SettingsNotificationPage` to handle notification settings with a dedicated component.
- Enhanced various settings components to accept `className` props for better styling flexibility.
2025-03-18 11:43:11 +08:00
javayhu
db651f5f1d feat: integrate AWS S3 storage functionality for file uploads and retrieval
- Added new API routes for uploading files, generating pre-signed URLs, and retrieving file URLs using AWS S3.
- Implemented error handling for storage operations, including custom error classes for better clarity.
- Updated localization files to include success and failure messages for avatar updates.
- Enhanced the `UpdateAvatarCard` component to support file uploads directly from the browser, improving user experience.
2025-03-18 10:41:31 +08:00
javayhu
9e958a5f9d refactor: improve error handling in authentication forms
- Updated error message display in `ForgotPasswordForm`, `LoginForm`, `RegisterForm`, and `ResetPasswordForm` to use `ctx.error.message` instead of `ctx.error.statusText`, providing clearer feedback to users on authentication errors.
2025-03-17 09:28:15 +08:00
javayhu
a7f7556a6d refactor: update hero section content and improve user button behavior
- Changed the hero section title and description to better reflect the MkSaaS offering.
- Updated the user button to use `replace` instead of `push` for navigation after sign out, ensuring a smoother user experience.
- Modified the delete account card to also use `replace` for navigation after account deletion, enhancing consistency in routing behavior.
2025-03-17 01:19:05 +08:00
javayhu
bb7e36cc85 refactor: enhance localization and styling in account deletion flow
- Updated Chinese localization file to include a new "cancel" message for improved user experience during account deletion.
- Adjusted `DeleteAccountCard` footer styling for better alignment and spacing of buttons.
- Modified `auth.ts` to disable freshness check for user deletion, ensuring smoother account removal process.
2025-03-17 00:02:44 +08:00
javayhu
1fd3ef7eeb feat: add reset password functionality for users with social login
- Introduced `ResetPasswordCard` component to guide users who signed up with social providers in setting up a password through the forgot password flow.
- Updated `ConditionalUpdatePasswordCard` to conditionally render `ResetPasswordCard` for users without a credential provider but with an email.
- Enhanced localization files to include new messages for the password setup process in both English and Chinese.
- Implemented email pre-filling in the forgot password form based on URL parameters for improved user experience.
2025-03-16 23:45:29 +08:00
javayhu
4f8b6d56c9 refactor: implement conditional rendering for password update when user has account with credential provider
- Replaced `UpdatePasswordCard` with `ConditionalUpdatePasswordCard` in `SettingsAccountPage` to ensure the password update option is only available for users with a credential provider.
- Added `ConditionalUpdatePasswordCard` component to handle the logic for checking user credentials and rendering the password update form accordingly.
- Updated documentation in `UpdatePasswordCard` to clarify its usage and the need for credential providers.
2025-03-16 23:00:25 +08:00
javayhu
8abb393c3e refactor: improve component structure and styling
- Adjusted `AuthCard` to enhance readability by formatting the `CardContent` section.
- Simplified the `DividerWithText` component by removing unnecessary padding.
- Updated `MainMobileMenu` to improve layout consistency with adjusted padding and spacing.
- Replaced `Dialog` with `AlertDialog` in `DeleteAccountCard` for better user experience and consistency in alert handling.
- Enhanced error message display logic in `DeleteAccountCard` for improved clarity.
2025-03-16 15:38:58 +08:00
javayhu
c51a608a28 refactor: update user references from username to name
- Replaced instances of `user.username` with `user.name` in `SidebarUser`, `UserButton`, and `UpdateNameCard` components for consistency and clarity.
- Adjusted the default values in the form handling to reflect the change from username to name.
- Updated comments in `auth.ts` to clarify the implementation status of username support.
2025-03-16 15:20:42 +08:00
javayhu
6569e5c3df refactor: update localization handling in metadata generation
- Replaced `pageTranslations` with `pt` for improved clarity in localization across multiple pages including About, Changelog, Contact, Waitlist, Blog, Pricing, and Auth pages.
- Enhanced maintainability by standardizing the variable naming for translation functions.
2025-03-16 15:06:42 +08:00
javayhu
635346bff6 refactor: restructure waitlist form localization messages
- Updated English and Chinese localization files to nest waitlist form messages under a `form` object for better organization.
- Adjusted `WaitlistFormCard` component to utilize the new message structure, enhancing clarity and maintainability of the code.
2025-03-16 15:05:51 +08:00
javayhu
0ae10c6c42 refactor: optimize intl messages for contact form 2025-03-16 15:03:22 +08:00
javayhu
293ee90c8a feat: implement contact form submission with email notifications
- Added `contactAction` to handle contact form submissions, including validation using Zod.
- Integrated email sending functionality to notify the configured recipient upon form submission.
- Updated `ContactFormCard` to utilize the new action, providing user feedback through toast notifications.
- Enhanced error handling for email sending failures and improved logging for better debugging.
- Updated `websiteConfig` to include the recipient email address for notifications.
2025-03-16 14:56:23 +08:00
javayhu
5607b57bd1 feat: add notification settings and newsletter management features
- Introduced a new `SettingsNotificationPage` component for managing newsletter subscriptions.
- Added `NewsletterFormCard` to handle subscription status with user feedback through toast notifications.
- Implemented `isSubscribedAction` to check user subscription status, enhancing user experience.
- Updated localization files to include new messages for newsletter management in English and Chinese.
- Enhanced sidebar with a new notification settings link for easy access to subscription preferences.
2025-03-16 12:55:26 +08:00
javayhu
6413fcd33c refactor: enhance card components with improved styling and structure
- Updated multiple card components (`ContactFormCard`, `DeleteAccountCard`, `UpdateAvatarCard`, `UpdateNameCard`, `UpdatePasswordCard`, and `WaitlistFormCard`) to include `overflow-hidden` for better layout management.
- Improved the structure of card titles and descriptions for better readability.
- Adjusted card footers to include `rounded-none` for consistent styling across components.
- Enhanced overall UI consistency and maintainability by refining component styles.
2025-03-16 10:55:43 +08:00
javayhu
9ddf1a3c20 feat: implement newsletter subscription and unsubscription actions
- Added `subscribeAction` and `unsubscribeAction` in `newsletter.ts` to handle newsletter subscriptions and unsubscriptions with validation using Zod.
- Introduced new localization messages for email validation in English and Chinese localization files.
- Updated `WaitlistFormCard` to utilize the new subscription action, improving user feedback with toast notifications.
- Replaced the alert icon in `FormError` component for better visual representation of errors.
2025-03-16 10:42:33 +08:00
javayhu
9b221f4583 refactor: reorganize email sending logic and centralize mail functionality
- Updated the `index.ts` file to export the `send` function from the new `mail.ts` file, improving code organization.
- Introduced `mail.ts` to encapsulate the email sending logic, including template rendering and error handling, enhancing modularity and maintainability.
- Implemented a structured approach for sending emails with templates or direct content, streamlining the email functionality.
2025-03-16 10:27:40 +08:00
javayhu
657e5212f4 refactor: remove WaitlistForm component and reorganize email types
- Deleted the `WaitlistForm` component to streamline the codebase and improve modularity.
- Introduced a new `types.ts` file in the `mail` directory to centralize email-related type definitions, enhancing code organization and maintainability.
- Updated imports across email components to reference the new `types.ts`, ensuring consistency and clarity in type usage.
2025-03-16 09:49:51 +08:00
javayhu
0804ac5e96 feat: enhance sidebar theming with new CSS variables
- Added new CSS variables for sidebar theming in `globals.css` to support light and dark modes.
- Removed redundant sidebar variables from individual theme files (`theme-blue.css`, `theme-green.css`, `theme-orange.css`, `theme-red.css`, `theme-rose.css`, `theme-violet.css`, `theme-yellow.css`, `theme-zinc.css`, and `theme.css`) to streamline styling and ensure consistency.
- Improved overall theme management for better maintainability and customization.
2025-03-16 09:05:37 +08:00
javayhu
574add6956 feat: add new UI components and enhance package dependencies
- Introduced several new UI components including `AlertDialog`, `AspectRatio`, `Calendar`, `Carousel`, `Command`, `ContextMenu`, `Dialog`, `DropdownMenu`, `HoverCard`, `InputOTP`, `Menubar`, `Popover`, `Progress`, `RadioGroup`, `Resizable`, `ScrollArea`, `Select`, `Slider`, `Switch`, `Table`, `ToggleGroup`, and `Toggle`.
- Updated `package.json` and `pnpm-lock.yaml` to include new dependencies for Radix UI components and other libraries.
- Improved existing components with better structure and styling, ensuring consistency across the application.
- Enhanced responsiveness and accessibility of UI elements using Tailwind CSS and Shadcn/ui.
2025-03-16 09:05:23 +08:00
javayhu
52738f4783 feat: enhance waitlist and contact forms with improved localization messages
- Added new success and failure messages for waitlist and contact form submissions in English and Chinese localization files.
- Introduced `WaitlistFormCard` component to streamline waitlist form handling and improve user feedback with toast notifications.
- Updated `ContactFormCard` to utilize new localization messages for form submission states, enhancing user experience.
- Improved structure and validation for both forms, ensuring better error handling and user guidance.
2025-03-16 08:43:46 +08:00
javayhu
c53cbb1ce2 refactor: replace contact form with ContactFormCard component
- Removed the old `ContactForm` component and integrated the new `ContactFormCard` for improved structure and validation.
- Updated `ContactPage` to utilize the new `ContactFormCard`, enhancing user experience with better form handling and error management.
- Implemented form validation using Zod and improved user feedback with toast notifications.
2025-03-16 08:00:23 +08:00
javayhu
aef4ce6296 fix: add account deletion feature and enhance localization messages
- Introduced `DeleteAccountCard` component for users to permanently delete their accounts, including a confirmation dialog to prevent accidental deletions.
- Updated localization files in English and Chinese to include new messages related to account deletion, enhancing user guidance and clarity.
- Improved layout of the account settings page to incorporate the new delete account functionality alongside existing update features.
2025-03-16 01:15:01 +08:00
javayhu
d51a22e030 fix: enhance localization messages and improve account settings UI
- Added new success and failure messages for password updates in English and Chinese localization files.
- Updated `UpdateAvatarCard`, `UpdateNameCard`, and `UpdatePasswordCard` components to improve error handling and user feedback with toast notifications.
- Enhanced styling for the user avatar fallback icon in `UpdateAvatarCard` for better visual consistency.
2025-03-16 00:20:12 +08:00
javayhu
c258cc7d0d fix: add password visibility toggle to reset password form and update localization messages
- Implemented password visibility toggle functionality in the `ResetPasswordForm` component, enhancing user experience during password entry.
- Updated localization files in English and Chinese to include new messages for showing and hiding passwords.
- Ensured accessibility by providing appropriate icons and screen reader support for the password visibility toggle.
2025-03-15 22:20:55 +08:00
javayhu
11a78eccbc fix: enhance login and registration forms with password visibility toggle
- Added password visibility toggle functionality to `LoginForm` and `RegisterForm` components, improving user experience during authentication.
- Updated localization files to include new messages for showing and hiding passwords in both English and Chinese.
- Ensured consistent styling and accessibility for the password input fields with appropriate icons and screen reader support.
2025-03-15 21:54:59 +08:00
javayhu
c0c60f2f2f fix: enhance localization messages and update user interface components
- Added new localization messages for logout failure and success notifications in English and Chinese.
- Updated `SidebarUser` and `UserButton` components to display the username instead of the name for better clarity.
- Improved `UpdateNameCard` to handle username updates with appropriate success and error messages using toast notifications.
- Refactored `MainMobileMenu` to utilize the translation function directly for login and sign-up links, enhancing consistency across the application.
2025-03-15 21:47:33 +08:00
javayhu
c497d71757 fix: update localization messages and improve account settings UI
- Enhanced localization messages in English and Chinese for user name and password fields, adding hints for better user guidance.
- Refactored `UpdateAvatarCard`, `UpdateNameCard`, and `UpdatePasswordCard` components to improve state management and user experience.
- Updated validation hints in the `UpdateNameCard` and `UpdatePasswordCard` for clearer instructions on input requirements.
2025-03-15 21:02:13 +08:00
javayhu
3a41a656ac fix: enhance DashboardHeader and SidebarMain with improved styling
- Added a bottom border to the `DashboardHeader` for better visual separation.
- Updated `SidebarMenuButton` and `SidebarMenuSubButton` components in `SidebarMain` to include padding for improved touch target size and user experience.
- Ensured consistent styling across sidebar items for a more cohesive look.
2025-03-15 20:54:41 +08:00
javayhu
dc36339faa fix: update localization messages and enhance account settings UI
- Revised localization messages in English and Chinese for avatar upload, name input, and password change to improve clarity and consistency.
- Adjusted the layout of `UpdateAvatarCard`, `UpdateNameCard`, and `UpdatePasswordCard` components for better user experience and responsiveness.
- Added `CardFooter` to `UpdateAvatarCard` and `UpdateNameCard` for improved information display.
- Updated validation schema for user name to reflect new minimum and maximum character requirements.
2025-03-15 20:44:52 +08:00
javayhu
a37285b5cf chore: enhance DashboardHeader with theme and locale switchers
- Added `ThemeSwitcher` and `LocaleSwitcher` components to the right side of the `DashboardHeader` for improved user customization options.
- Cleaned up imports and ensured consistent formatting in the `DashboardHeader` component.
- Updated the layout to accommodate new switchers while maintaining responsiveness.
2025-03-15 20:14:42 +08:00
javayhu
3bcb0f10e4 fix: update maxLength validation for name input in localization files
- Adjusted the maximum length for name input validation in both English and Chinese localization files from 32 to 30 characters.
- Refactored `UpdateNameCard` to initialize the form with a fallback for user name and check user existence after hooks initialization.
- Commented out the `TailwindIndicator` in the layout for potential future use.
2025-03-15 20:00:51 +08:00
javayhu
20be1fdfd6 chore: enhance account settings page with avatar, name, and password update features
- Introduce new components: `UpdateAvatarCard`, `UpdateNameCard`, and `UpdatePasswordCard` for managing user account settings.
- Update localization files for English and Chinese to include new fields related to avatar upload, name input, and password change.
- Refactor `SettingsAccountPage` to utilize the new components, improving code organization and user experience.
2025-03-15 19:41:37 +08:00
javayhu
e4710bbabc fix: Each child in a list should have a unique "key" prop. See https://react.dev/link/warning-keys for more information. 2025-03-15 19:11:40 +08:00
javayhu
673829298b chore: refactor AI feature pages to use DashboardHeader component
- Replace breadcrumb and sidebar trigger implementations in AI feature pages (Audio, Image, Text, Video) with a new `DashboardHeader` component for improved code reuse and consistency.
- Update localization handling for breadcrumbs in each AI feature page to enhance user navigation experience.
- Clean up imports by removing unused components related to breadcrumb and sidebar triggers.
2025-03-15 18:53:30 +08:00
javayhu
03f00c7d37 chore: enhance sidebar navigation and localization features
- Refactor the `SidebarMain` component to improve active link detection and enhance user experience with collapsible menus.
- Introduce `useLocalePathname` for better path management and implement functions to check active states for sidebar items.
- Update `SidebarUser` component layout for improved readability and consistency in locale display.
- Replace `UserIcon` with `User2Icon` in the `UserAvatar` component for a more modern appearance.
2025-03-15 17:59:12 +08:00
javayhu
f7e5297589 chore: refactor settings navigation and localization
- Replace the `General` and `Security` settings pages with a new `Account` settings page, updating the corresponding routes and localization files for both English and Chinese.
- Implement `useTranslations` in the new `SettingsAccountPage` to enhance localization support.
- Clean up sidebar links and remove the obsolete `SettingsGeneralPage` to streamline the settings navigation.
- Update the `SidebarMain` component to reflect the changes in settings structure.
2025-03-15 17:36:49 +08:00
javayhu
06513b3bfe chore: add AI feature pages and update sidebar navigation
- Introduce new pages for AI features: Audio, Image, Text, and Video, enhancing the dashboard's functionality.
- Update the sidebar to replace the `DashboardIcon` with `LayoutDashboardIcon` for improved visual consistency.
- Adjust icon sizes in the sidebar and menu links for uniformity across the application.
- Refactor the `SidebarMain` component to improve the organization of sidebar items and enhance user experience.
2025-03-15 16:36:02 +08:00
javayhu
62198eac33 chore: refactor locale selection functions for consistency
- Update locale selection functions in `SidebarUser`, `LocaleSelector`, and `LocaleSwitcher` components to use arrow function syntax for improved readability.
- Adjust the `SidebarUser` component's layout by adding padding to the `SidebarMenu` for better visual spacing.
- Ensure consistent naming conventions for locale selection functions across components.
2025-03-15 16:18:26 +08:00
javayhu
80b99a65ed fix: Error: Failed to call useTranslations because the context from NextIntlClientProvider was not found. 2025-03-15 15:58:58 +08:00
javayhu
52c30ec9d1 chore: enhance dashboard sidebar localization and add web manifest
- Add new dashboard sidebar item for navigation in both English and Chinese localization files.
- Introduce a new `site.webmanifest` file for improved PWA support.
- Update routing constants to include specific settings routes for better organization.
- Clean up imports in `config.tsx` and adjust sidebar links for clarity.
2025-03-15 15:47:27 +08:00
javayhu
7127a46543 chore: update sidebar icons and enhance theme configuration
- Replace `BadgeCheckIcon` with `BotIcon` and `SettingsIcon` with `Settings2Icon` in the sidebar for improved visual consistency.
- Add `UserCircleIcon` to the settings link for better user representation.
- Update sidebar theme imports in `globals.css` to use `theme-blue.css` and provide manual theming instructions.
- Introduce new sidebar color variables in multiple theme files to enhance customization options.
2025-03-15 15:25:39 +08:00
javayhu
69da9e1936 chore: refactor dashboard sidebar and enhance localization support
- Introduce a new `DashboardSidebar` component to replace the obsolete `AppSidebar`, improving organization and clarity.
- Implement `SidebarMain` and `SidebarUser` components for better separation of concerns within the sidebar.
- Update localization files to include new sidebar items for AI features and settings in both English and Chinese.
- Streamline sidebar navigation by utilizing the `getSidebarMainLinks` function for dynamic link generation.
- Remove unused `NavSecondary` component to reduce complexity and improve maintainability.
2025-03-15 14:58:05 +08:00
javayhu
4cd70b1815 chore: refactor dashboard layout and introduce settings page
- Rename `Page` component to `DashboardPage` for clarity.
- Simplify the dashboard layout by removing unnecessary `SidebarProvider` and `SidebarInset`.
- Add a new `SettingsGeneralPage` component for general settings with a structured layout.
- Update navigation components to utilize `LocaleLink` for improved routing.
- Remove obsolete `NavProjects` component to streamline the sidebar navigation.
2025-03-15 14:22:24 +08:00
javayhu
5e5278aef8 chore: remove WebsiteInfo type and clean up imports in config
- Eliminate the `WebsiteInfo` type from the types definition to simplify the codebase.
- Update `config.tsx` to remove the import of the now obsolete `WebsiteInfo` type, enhancing clarity and maintainability.
2025-03-15 14:09:47 +08:00
javayhu
2b41ef578a chore: refactor website information retrieval and simplify layout components
- Remove the `getWebsiteInfo` function to streamline website information handling.
- Update components to directly use translation functions for site name and tagline.
- Clean up `DashboardLayout`, `Footer`, `Navbar`, and `NavbarMobile` by removing unnecessary imports and improving readability.
- Maintain consistent use of translations across the application for better localization support.
2025-03-15 14:08:31 +08:00
javayhu
e76745e52e chore: enhance NavUser component with locale and theme switching
- Introduce locale and theme selection functionality in the `NavUser` component.
- Implement `DropdownMenuSub` for organizing theme and language options.
- Utilize `useLocaleStore` for managing current locale state and transitions.
- Refactor imports and improve user experience with responsive design elements.
- Update translations for consistency across the dropdown menu items.
2025-03-15 14:02:48 +08:00
javayhu
6fd8defc9a chore: update routing and sidebar navigation structure
- Refactor routes for AI features and settings to improve clarity and organization.
- Update `AppSidebar` navigation items to reflect new route paths.
- Introduce `UserAvatar` component for consistent user representation across the dashboard.
- Adjust avatar sizes in various components for uniformity.
- Enhance `LocaleSwitcher` and `ThemeSwitcher` button styles for better UI consistency.
2025-03-15 13:48:23 +08:00
javayhu
9e04764444 chore: reorganize dashboard components
- Move `AppSidebar` to a new directory for better organization.
- Update imports for `PricingComparator` to reflect its new location within the blocks directory.
- Remove obsolete `fill-remaining-space.tsx` component to clean up the codebase.
- Introduce new `PricingComparator` component for improved pricing comparison functionality.
- Add new dashboard navigation components (`NavMain`, `NavProjects`, `NavSecondary`, `NavUser`) to enhance user experience and organization within the dashboard.
2025-03-15 12:12:34 +08:00
javayhu
cb0c852933 chore: update localization and add divider component for social login
- Add "or" translation to English and Chinese localization files for improved user guidance.
- Introduce `DividerWithText` component to visually separate social login options in the authentication UI.
- Integrate `DividerWithText` in the `SocialLoginButton` component for enhanced layout clarity.
2025-03-15 12:12:03 +08:00
javayhu
0929d93342 chore: enhance MDX component fix copy button and localization updates
- Add __rawString__ property to MDX component for improved code handling.
- Refactor pre element to extract code content dynamically and support copy functionality.
- Update login translation in English to "Log in" for consistency.
2025-03-15 11:27:07 +08:00
javayhu
43010fcb64 chore: update localization and metadata handling in email templates
- Refactor email components (ForgotPassword, SubscribeNewsletter, VerifyEmail) to utilize `defaultMessages` for improved localization.
- Enhance `EmailLayout` to accept locale and messages props, ensuring consistent translation across email templates.
- Update manifest generation to use `defaultMessages` for site name and description, streamlining metadata handling.
- Adjust copyright formatting in translation files for better presentation.
2025-03-15 10:24:50 +08:00
javayhu
234cc5518c chore: simplify website info by removing title and description fields
- Remove `title` and `description` fields from English and Chinese translation files to streamline website metadata.
- Update `getWebsiteInfo` function to exclude removed fields, ensuring consistency in website information retrieval.
- Adjust `WebsiteInfo` type definition to reflect the changes in metadata structure.
2025-03-15 01:03:30 +08:00
javayhu
2ba2eebbaa chore: update database schema and enhance authentication features
- Add `username` column to the `user` table and enforce uniqueness constraint.
- Introduce new SQL migration file for the `username` addition.
- Update `schema.ts` to reflect changes in the `user`, `session`, and `account` tables.
- Enhance authentication client by integrating `usernameClient` plugin for better user management.
- Adjust session management settings for improved caching and freshness.
- Refactor metadata generation in the home page for consistency.
2025-03-15 00:54:13 +08:00
javayhu
0045ecf91e chore: remove obsolete site.webmanifest and update manifest.ts documentation
- Delete the outdated `site.webmanifest` file to clean up the codebase.
- Enhance documentation in `manifest.ts` to clarify the purpose of the generated web app manifest.
2025-03-15 00:51:32 +08:00
javayhu
130880cf87 chore: refactor localization handling in email templates and manifest
- Replace top-level await for default messages with a dedicated `getDefaultMessages` function to improve code organization and readability.
- Update email components (ForgotPassword, SubscribeNewsletter, VerifyEmail) to utilize the new `getDefaultMessages` function for localization.
- Modify the manifest function to fetch default messages asynchronously, enhancing the metadata generation process.
2025-03-14 23:14:14 +08:00
javayhu
2d8f70f09a chore: refactor metadata handling and remove unused files
- Delete obsolete `robots.ts` and `opengraph-image.tsx` files to streamline the codebase.
- Update metadata generation across various pages to utilize `getBaseUrlWithLocale` for improved localization.
- Ensure all pages have consistent canonical URLs for better SEO and accessibility.
- Clean up imports and enhance the organization of metadata-related functions.
2025-03-14 23:09:30 +08:00
javayhu
5d925b65c9 tmp: optimize international metadata 2025-03-14 10:11:46 +08:00
javayhu
30bd8d1cf3 chore: optimize manifest.ts 2025-03-14 10:02:24 +08:00
javayhu
1c4f86c7ef chore: enhance localization and metadata across application
- Update English and Chinese translation files to include descriptions for various pages, improving user experience and clarity.
- Refactor metadata generation in multiple pages to utilize the new `constructMetadata` function for consistency.
- Ensure all pages have appropriate titles and descriptions for better SEO and accessibility.
- Clean up imports and streamline metadata handling in the application.
2025-03-14 01:31:17 +08:00
javayhu
695a4b9ecb chore: add MCP server configuration for console-ninja
- Introduce a new configuration file `.cursor/mcp.json` to define the MCP server settings for console-ninja.
- Specify the command and arguments for the MCP server to streamline setup.
2025-03-14 01:03:16 +08:00
javayhu
dab2bbac0c refactor: update authentication forms to use DEFAULT_LOGIN_REDIRECT
- Replace direct usage of Routes.DefaultLoginRedirect with DEFAULT_LOGIN_REDIRECT in LoginForm, RegisterForm, and SocialLoginButton for consistency.
- Add documentation comment to websiteConfig for clarity.
2025-03-14 00:56:51 +08:00
javayhu
edbec45660 chore: remove author metadata from website configuration 2025-03-14 00:13:18 +08:00
javayhu
bb4169f4bc fix: update team name in email templates for localization
- Change team name to "MkSaaS Team" in English and Chinese email templates.
- Remove unnecessary website info references in email components to streamline localization.
- Ensure consistent usage of the `defaultMessages` for translations in email templates.
2025-03-13 23:50:54 +08:00
javayhu
3dbf65b62a refactor: streamline email handling and localization
- Introduce a new `send` utility function for sending emails with templates and context.
- Refactor email templates to utilize the updated `defaultMessages` from the i18n module.
- Consolidate email-related types into a new `types.ts` file for better organization.
- Remove deprecated `messages.ts` and `types.ts` files from the mail module.
- Update email components to use the new `BaseEmailProps` type and routing for default locale.
2025-03-13 23:46:24 +08:00
javayhu
7a1991f56c refactor: standardize error handling in authentication forms
- Update error handling in ForgotPasswordForm, LoginForm, RegisterForm, and ResetPasswordForm to use a consistent format for error messages.
- Replace direct error message access with structured error status and statusText for improved clarity.
- Remove commented-out console logs for cleaner code.
2025-03-13 23:46:04 +08:00
javayhu
e549a0546e fix: fix import Locale from next-intl 2025-03-13 10:14:50 +08:00
javayhu
ce28a0e51d feat: update typography by adding DM Sans font weight 500
- Replace GeistSans with fontDMSans in layout component
- Introduce new DM Sans font file for weight 500
- Update fontDMSans to include variable for weight 500
2025-03-13 00:35:47 +08:00
javayhu
8d85680fce
Merge pull request #10 from MkSaaSHQ/next-intl
chore: upgrade next-intl to version 4.0.0 and update type definitions
2025-03-13 00:25:07 +08:00
921 changed files with 82467 additions and 14422 deletions

14
.cursor/mcp.json Normal file
View File

@ -0,0 +1,14 @@
{
"mcpServers": {
"console-ninja": {
"command": "node",
"args": [
"~/.console-ninja/mcp/"
]
},
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp@latest"]
}
}
}

View File

@ -1,6 +1,6 @@
---
description: Best practices for using Vercel AI SDK
globs: **/*.{ts,tsx}
globs: *.tsx,*.ts
alwaysApply: false
---

View File

@ -0,0 +1,43 @@
---
description:
globs: *.tsx,*.ts
alwaysApply: false
---
# Database and State Management Guide
## Database (Drizzle ORM)
- Schema definitions in `src/db/schema.ts`
- Migrations in `src/db/migrations`
- Use `db:generate` to create new migration files based on schema changes
- Use `db:migrate` to apply pending migrations to the database
- Use `db:push` to sync schema changes directly to the database (development only)
- Use `db:studio` to view and manage database data through the Drizzle Studio UI
- Follow naming conventions for tables and columns
- Use proper data types and constraints
- Implement proper indexes
- Handle relationships properly
- Use transactions when needed
## State Management (Zustand)
- Store definitions in `src/stores/`
- Keep stores modular and focused
- Use TypeScript for store types
- Implement proper state updates
- Handle async operations properly
- Use selectors for derived state
- Implement proper error handling
- Use middleware when needed
- Keep store logic pure
- Document complex state logic
## Data Flow
1. Server-side data fetching in server components
2. Client-side state in Zustand stores
3. Form state in React Hook Form
4. API calls through server actions
5. Database operations through Drizzle
6. File storage through AWS S3
7. Proper error handling at each layer
8. Type safety throughout
9. Proper validation with Zod
10. Proper caching strategies

View File

@ -1,10 +1,10 @@
---
description: Best practices for date and time manipulation with date-fns
globs: **/*.{ts,tsx,js,jsx}
globs: *.ts,*.tsx
alwaysApply: false
---
- Use the `format` function for consistent date formatting across your application.
- Implement proper timezone handling using the `utcToZonedTime` function.
- Utilize the `intervalToDuration` function for calculating time differences.
- Leverage the `isWithinInterval` function for date range checks.
- Leverage the `isWithinInterval` function for date range checks.

View File

@ -0,0 +1,39 @@
---
description:
globs: *.tsx,*.ts
alwaysApply: false
---
# Development Workflow Guide
## Available Scripts
- `pnpm dev`: Start development server with content collections
- `pnpm build`: Build the application and content collections
- `pnpm start`: Start production server
- `pnpm lint`: Run Biome linter
- `pnpm format`: Format code with Biome
- `pnpm db:generate`: Generate new migration files based on schema changes
- `pnpm db:migrate`: Apply pending migrations to the database
- `pnpm db:push`: Sync schema changes directly to the database (development only)
- `pnpm db:studio`: Open Drizzle Studio for database inspection and management
- `pnpm email`: Start email template development server
## Development Process
1. Use TypeScript for all new code
2. Follow Biome formatting rules
3. Write server actions in `src/actions/`
4. Use Zustand for client-side state
5. Implement database changes through Drizzle migrations
6. Use Radix UI components for consistent UI
7. Follow the established directory structure
8. Write tests for new features
9. Update content collections when adding new content
10. Use environment variables from `env.example`
## Code Style
- Use functional components with hooks
- Implement proper error handling
- Follow TypeScript best practices
- Use proper type definitions
- Document complex logic
- Keep components small and focused
- Use proper naming conventions

View File

@ -1,6 +1,7 @@
---
description: Best practices for using Drizzle ORM with database
globs: **/*.{ts}
globs: *.tsx,*.ts
alwaysApply: false
---
- Use Drizzle's type-safe query builder for better code completion and safety.

View File

@ -1,6 +1,6 @@
---
description: Best practices for Next.js applications and routing
globs: **/*.{ts,tsx}
globs: *.tsx,*.ts
alwaysApply: false
---

View File

@ -0,0 +1,37 @@
---
description:
globs: **/*.{ts,tsx}
alwaysApply: false
---
# Project Structure Guide
## Core Directories
- `src/app/`: Next.js app router pages and layouts
- `src/components/`: Reusable React components
- `src/lib/`: Utility functions and shared code
- `src/db/`: Database schema and migrations using Drizzle ORM
- `src/stores/`: Zustand state management
- `src/actions/`: Server actions and API routes
- `src/hooks/`: Custom React hooks
- `src/types/`: TypeScript type definitions
- `src/i18n/`: Internationalization setup
- `src/mail/`: Email templates and mail functionality
- `src/payment/`: Payment integration
- `src/analytics/`: Analytics and tracking
- `src/storage/`: File storage integration
- `src/notification/`: Sending Notifications
## Configuration Files
- `next.config.ts`: Next.js configuration
- `drizzle.config.ts`: Database configuration
- `biome.json`: Code formatting and linting rules
- `tsconfig.json`: TypeScript configuration
- `components.json`: UI components configuration
## Content Management
- `content/`: MDX content files
- `source.config.ts`: Fumadocs source configuration
## Environment
- `env.example`: Environment variables template
- `global.d.ts`: Global TypeScript declarations

View File

@ -1,6 +1,6 @@
---
description: Best practices for using Radix UI components
globs: **/*.{ts,tsx}
globs: *.tsx,*.ts
alwaysApply: false
---

View File

@ -1,6 +1,6 @@
---
description: Best practices for React component development
globs: **/*.{ts,tsx,js,jsx}
globs: *.tsx,*.ts
alwaysApply: false
---

View File

@ -1,10 +1,10 @@
---
description: Best practices for form handling with React Hook Form
globs: **/*.{ts,tsx}
globs: *.tsx,*.ts
alwaysApply: false
---
- Use the `useForm` hook for efficient form state management.
- Implement validation using Zod with `@hookform/resolvers` for type-safe form validation.
- Utilize the `Controller` component for integrating with custom inputs.
- Leverage the `useFormContext` hook for sharing form state across components.
- Leverage the `useFormContext` hook for sharing form state across components.

View File

@ -1,6 +1,6 @@
---
description: Best practices for integrating Stripe payments
globs: **/*.{ts,tsx}
globs: *.tsx,*.ts
alwaysApply: false
---

View File

@ -1,6 +1,6 @@
---
description: Best practices for styling with Tailwind CSS
globs: **/*.{ts,tsx,css}
globs: *.tsx,*.ts
alwaysApply: false
---

View File

@ -1,6 +1,6 @@
---
description: TypeScript coding standards and type safety guidelines
globs: **/*.{ts,tsx}
globs: *.tsx,*.ts
alwaysApply: false
---
@ -10,4 +10,5 @@ alwaysApply: false
- Use generics for reusable components and functions.
- Use strict null checks to prevent null and undefined errors
- Implement proper type inference using generics for reusable components.
- Utilize type guards and assertions for runtime type checking.
- Utilize type guards and assertions for runtime type checking.
- Use `pnpm` as default package manager if run Command in Terminal.

View File

@ -0,0 +1,54 @@
---
description:
globs: **/*.{ts,tsx}
alwaysApply: false
---
# UI and Components Guide
## Component Structure
- Components in `src/components/`
- Follow atomic design principles
- Use Radix UI primitives
- Implement proper accessibility
- Use Tailwind CSS for styling
- Follow consistent naming
- Keep components focused
- Implement proper error states
- Handle loading states
- Use proper TypeScript types
## UI Libraries
- Radix UI for primitives
- Tailwind CSS for styling
- Framer Motion for animations
- React Hook Form for forms
- Zod for validation
- Lucide React for icons
- Tabler Icons for additional icons
- Sonner for toasts
- Vaul for drawers
- Embla Carousel for carousels
## Styling Guidelines
- Use Tailwind CSS classes
- Follow design system tokens
- Implement dark mode support
- Use proper spacing scale
- Follow color palette
- Implement responsive design
- Use proper typography
- Handle hover/focus states
- Implement proper transitions
- Use proper z-index scale
## Accessibility
- Use semantic HTML
- Implement proper ARIA labels
- Handle keyboard navigation
- Support screen readers
- Use proper color contrast
- Implement focus management
- Handle dynamic content
- Support reduced motion
- Test with assistive tools
- Follow WCAG guidelines

View File

@ -1,6 +1,7 @@
---
description: Best practices for schema validation with Zod
globs: **/*.{ts,tsx}
globs: *.tsx,*.ts
alwaysApply: false
---
- Define clear and reusable schemas for data validation

View File

@ -1,10 +1,10 @@
---
description: Best practices for state management with Zustand
globs: **/*.{ts,tsx}
globs: *.tsx,*.ts
alwaysApply: false
---
- Use the `create` function to define your store for simplicity and performance.
- Implement middleware like `persist` for persisting state across sessions.
- Utilize the `useStore` hook for accessing store state in components.
- Leverage the `immer` middleware for easier state updates with mutable syntax.
- Leverage the `immer` middleware for easier state updates with mutable syntax.

View File

@ -1,46 +0,0 @@
You are an expert in TypeScript, Node.js, Next.js with the app router, React, Shadcn/ui, Magic UI, Tailwind, Better Auth, Drizzle ORM, Content Collections, and Vercel AI SDK.
General Principles
- Write clean, concise, and well-commented TypeScript code
- Favor functional and declarative programming patterns over object-oriented approaches
- Prioritize code reuse and modularization over duplication
Naming and Conventions
- Use PascalCase for class names and type definitions
- Utilize camelCase for variables, functions, and methods
- Employ kebab-case for file and directory names
- Reserve UPPERCASE for environment variables and constants
- Avoid magic numbers by defining constants with meaningful names
- Start each function name with a verb to indicate its purpose
TypeScript Usage
- Leverage TypeScript for all code
- Prefer types over interfaces
- Favor functional components over class components
Code Organization
- Structure files logically, grouping related components, helpers, types, and static content
- Prefer named exports for components over default exports
- Favor small, single-purpose components over large, monolithic ones
- Separate concerns between presentational and container components
UI and Styling
- Utilize Shadcn/ui, Radix, and Tailwind for building consistent and accessible UI components
- Implement responsive design using Tailwind CSS with a mobile-first approach
- Use Magic UI for advanced components and animations
- Use Lucide for icons
Data Management
- Interact with the database using Drizzle ORM
- Leverage Drizzle's generated types
Next.js and React
- Minimize the use of `use client`, `useEffect`, and `setState`
- Favor React Server Components (RSC) whenever possible
- Wrap client-side components in `Suspense` with a fallback
- Implement dynamic loading for non-critical components
- Use server actions for mutations instead of route handlers
Error Handling and Logging
- Implement robust error handling and logging mechanisms
- Provide clear and user-friendly error messages to the end-users

16
.dockerignore Normal file
View File

@ -0,0 +1,16 @@
.cursor
.claude
.conductor
.kiro
.github
.next
.open-next
.source
.vscode
.git
.wrangler
.dockerignore
node_modules
**/node_modules
Dockerfile
LICENSE

41
.gitattributes vendored Normal file
View File

@ -0,0 +1,41 @@
# Set default behavior to automatically normalize line endings
* text=auto
# Force LF line endings for text files
*.js text eol=lf
*.jsx text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.json text eol=lf
*.md text eol=lf
*.mdx text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.css text eol=lf
*.scss text eol=lf
*.html text eol=lf
*.xml text eol=lf
*.txt text eol=lf
*.sh text eol=lf
# Ensure these files are always treated as text and get LF line endings
.gitignore text eol=lf
.gitattributes text eol=lf
.editorconfig text eol=lf
*.config.js text eol=lf
*.config.ts text eol=lf
# Binary files should be left untouched
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.svg binary
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary
*.pdf binary
*.zip binary
*.tar.gz binary

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: javayhu
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone16]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: MkSaaS Community Support
url: https://github.com/MkSaaSHQ/mksaas-template/discussions
about: Please ask and answer questions here.
- name: MkSaaS Documentation
url: https://mksaas.com/docs
about: Please check out the documentation here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[feat]"
labels: enhancement
assignees: javayhu
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

25
.gitignore vendored
View File

@ -30,15 +30,38 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
certificates
# env files (can opt-in for committing if needed)
.env*
# vercel
.vercel
# claude code
.claude
# conductor
.conductor
# kiro
.kiro
# typescript
*.tsbuildinfo
next-env.d.ts
# content collections
.content-collections
.content-collections
# fumadocs
.source
# OpenNext build output
.open-next
# wrangler files
.wrangler
.dev.vars
.dev.vars*
!.dev.vars.example

10
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,10 @@
{
"recommendations": [
"biomejs.biome",
"bradlc.vscode-tailwindcss",
"Lokalise.i18n-ally",
"unifiedjs.vscode-mdx",
"eamodio.gitlens",
"editorconfig.editorconfig"
]
}

40
.vscode/settings.json vendored
View File

@ -1,7 +1,35 @@
{
"i18n-ally.localesPaths": [
"messages",
"src/i18n"
],
"i18n-ally.keystyle": "nested"
}
"i18n-ally.localesPaths": [
"messages",
"src/i18n"
],
"i18n-ally.keystyle": "nested",
"editor.defaultFormatter": "biomejs.biome",
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"search.exclude": {
"**/node_modules": true,
".next": true,
".source": true,
".wrangler": true,
".open-next": true,
".vscode": true,
".cursor": true,
".claude": true,
".conductor": true,
".kiro": true,
".github": true
}
}

109
CLAUDE.md Normal file
View File

@ -0,0 +1,109 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Development Commands
### Core Development
- `pnpm dev` - Start development server with content collections
- `pnpm build` - Build the application and content collections
- `pnpm start` - Start production server
- `pnpm lint` - Run Biome linter (use for code quality checks)
- `pnpm format` - Format code with Biome
### Database Operations (Drizzle ORM)
- `pnpm db:generate` - Generate new migration files based on schema changes
- `pnpm db:migrate` - Apply pending migrations to the database
- `pnpm db:push` - Sync schema changes directly to the database (development only)
- `pnpm db:studio` - Open Drizzle Studio for database inspection and management
### Content and Email
- `pnpm content` - Process MDX content collections
- `pnpm email` - Start email template development server on port 3333
## Project Architecture
This is a Next.js 15 full-stack SaaS application with the following key architectural components:
### Core Stack
- **Framework**: Next.js 15 with App Router
- **Database**: PostgreSQL with Drizzle ORM
- **Authentication**: Better Auth with social providers (Google, GitHub)
- **Payments**: Stripe integration with subscription and one-time payments
- **UI**: Radix UI components with TailwindCSS
- **State Management**: Zustand for client-side state
- **Internationalization**: next-intl with English and Chinese locales
- **Content**: Fumadocs for documentation and MDX for content
- **Code Quality**: Biome for formatting and linting
### Key Directory Structure
- `src/app/` - Next.js app router with internationalized routing
- `src/components/` - Reusable React components organized by feature
- `src/lib/` - Utility functions and shared code
- `src/db/` - Database schema and migrations
- `src/actions/` - Server actions for API operations
- `src/stores/` - Zustand state management
- `src/hooks/` - Custom React hooks
- `src/config/` - Application configuration files
- `src/i18n/` - Internationalization setup
- `src/mail/` - Email templates and mail functionality
- `src/payment/` - Stripe payment integration
- `src/credits/` - Credit system implementation
- `content/` - MDX content files for docs and blog
- `messages/` - Translation files (en.json, zh.json) for internationalization
### Authentication & User Management
- Uses Better Auth with PostgreSQL adapter
- Supports email/password and social login (Google, GitHub)
- Includes user management, email verification, and password reset
- Admin plugin for user management and banning
- Automatic newsletter subscription on user creation
### Payment System
- Stripe integration for subscriptions and one-time payments
- Three pricing tiers: Free, Pro (monthly/yearly), and Lifetime
- Credit system with packages for pay-per-use features
- Customer portal for subscription management
### Feature Modules
- **Blog**: MDX-based blog with pagination and categories
- **Docs**: Fumadocs-powered documentation
- **AI Features**: Image generation with multiple providers (OpenAI, Replicate, etc.)
- **Newsletter**: Email subscription system
- **Analytics**: Multiple analytics providers support
- **Storage**: S3 integration for file uploads
### Development Workflow
1. Use TypeScript for all new code
2. Follow Biome formatting rules (single quotes, trailing commas)
3. Write server actions in `src/actions/`
4. Use Zustand for client-side state management
5. Implement database changes through Drizzle migrations
6. Use Radix UI components for consistent UI
7. Follow the established directory structure
8. Use proper error handling with error.tsx and not-found.tsx
9. Leverage Next.js 15 features like Server Actions
10. Use `next-safe-action` for secure form submissions
### Configuration
- Main config in `src/config/website.tsx`
- Environment variables template in `env.example`
- Database config in `drizzle.config.ts`
- Biome config in `biome.json` with specific ignore patterns
- TypeScript config with path aliases (@/* for src/*)
### Testing and Quality
- Use Biome for linting and formatting
- TypeScript for type safety
- Environment variables for configuration
- Proper error boundaries and not-found pages
- Zod for runtime validation
## Important Notes
- The project uses pnpm as the package manager
- Database schema is in `src/db/schema.ts` with auth, payment, and credit tables
- Email templates are in `src/mail/templates/`
- The app supports both light and dark themes
- Content is managed through MDX files in the `content/` directory
- The project includes comprehensive internationalization support

62
Dockerfile Normal file
View File

@ -0,0 +1,62 @@
# syntax=docker/dockerfile:1
FROM node:20-alpine AS base
# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Install dependencies
COPY package.json pnpm-lock.yaml* ./
# Copy config files needed for fumadocs-mdx postinstall
COPY source.config.ts ./
COPY content ./content
RUN npm install -g pnpm && pnpm i --frozen-lockfile
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED 1
RUN npm install -g pnpm \
&& DOCKER_BUILD=true pnpm build
# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["node", "server.js"]

41
LICENSE Normal file
View File

@ -0,0 +1,41 @@
MkSaaS License
Personal, Team, or Organization License
MkSaaS grants you an ongoing, non-exclusive license to use the software components and templates included in the SaaS Starter Kit.
The license permits usage by a single individual, team, or organization (the Licensee) and does not transfer to additional individuals, teams, or organizations without explicit permission.
You can:
- Use MkSaaS to create unlimited end products.
- Modify MkSaaS components to create derivative works, subject to this license.
- Use MkSaaS to create projects for unlimited clients.
- Use MkSaaS to create end products sold to end users.
- Use MkSaaS to build and run SaaS applications where end users interact with your end product.
You cannot:
- Redistribute MkSaaSs components or templates, even if modified, separately from an end product.
- Share your access to MkSaaS with anyone outside your team or organization without explicit permission.
- Use MkSaaS to create products that compete with MkSaaS or provide a SaaS starter kit in conflict with MkSaaSs business.
Example Usage
Examples of permitted usage:
- Creating personal, team, or organizational websites or applications.
- Building commercial SaaS applications or web apps for clients.
Examples of prohibited usage:
- Creating a repository of MkSaaS (components) and sharing or selling it.
- Making a derivative product (e.g. starter kit) and offering it for sale or free.
Enforcement and Liability
MkSaaS reserves the right to revoke licenses in case of a material breach of this agreement. The liability of MkSaaS is limited to the refund of the license fee. This agreement is governed by the laws of Switzerland.
Questions?
Unsure if your use case is covered by the license? Email us at support@MkSaaS.com with your questions.

View File

@ -1,36 +1,46 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
# MkSaaS
## Getting Started
Make AI SaaS in a weekend.
First, run the development server:
The complete Next.js boilerplate for building profitable SaaS, with auth, payments, i18n, newsletter, dashboard, blog, docs, blocks, themes, SEO and more.
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
## Author
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
This project is created by [Fox](https://x.com/indie_maker_fox), the founder of [MkSaaS](https://mksaas.com) and [Mkdirs](https://mkdirs.com). The official X account for [MkSaaS](https://mksaas.com) is [@mksaascom](https://x.com/mksaascom), you can follow this account for the updates about MkSaaS.
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
## Documentation
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
The documentation is available on the [website](https://mksaas.com/docs). It includes guides, tutorials, and detailed explanations of the code. I designed it to be as beginner-friendly as possible, so you can start making money from day one.
## Learn More
If you found anything that could be improved, please let me know.
To learn more about Next.js, take a look at the following resources:
## Links
- [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.
- 🔥 website: [mksaas.com](https://mksaas.com)
- 🌐 demo: [demo.mksaas.com](https://demo.mksaas.com)
- 📚 documentation: [mksaas.com/docs](https://mksaas.com/docs)
- 🗓️ roadmap: [mksaas roadmap](https://mksaas.link/roadmap)
- 👨‍💻 discord: [mksaas.link/discord](https://mksaas.link/discord)
- 📹 video: [mksaas.link/youtube](https://mksaas.link/youtube)
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
## Repositories
## Deploy on Vercel
By default, you should have access to all 5 repositories. If you find that youre unable to access any of them, please dont hesitate to reach out to me, and Ill assist you in resolving the issue.
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.
- [mksaas-template (ready)](https://github.com/MkSaaSHQ/mksaas-template): https://demo.mksaas.com
- [mksaas-blog (ready)](https://github.com/MkSaaSHQ/mksaas-blog): https://mksaas.me
- [mksaas-haitang (ready)](https://github.com/MkSaaSHQ/mksaas-haitang): https://haitang.app
- [mksaas-outfit (ready)](https://github.com/MkSaaSHQ/mksaas-outfit)
- [mksaas-app (WIP)](https://github.com/MkSaaSHQ/mksaas-app): https://mksaas.app
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
## Notice
> If you have any questions, please [submit an issue](https://github.com/MkSaaSHQ/mksaas-template/issues/new), or contact me at [support@mksaas.com](mailto:support@mksaas.com), or join our [discord community](https://mksaas.link/discord) and ask for help there.
> If you want to receive notifications whenever code changes, please click `Watch` button in the top right.
> When submitting any content to the issues of the repository, please use **English** as the main Language, so that everyone can read it and help you, thank you for your supports.
## License
For any details on the license, please refer to the [License](LICENSE) file.

View File

@ -9,13 +9,28 @@
"ignoreUnknown": true,
"ignore": [
".next/**",
".content-collections/**",
".open-next/**",
".wrangler/**",
".cursor/**",
".claude/**",
".kiro/**",
".conductor/**",
".vscode/**",
".source/**",
"node_modules/**",
"dist/**",
"build/**",
"src/db/**",
"tailwind.config.ts",
"src/components/ui/*.tsx",
"src/components/magicui/*.tsx",
"tailwind.config.ts"
"src/components/animate-ui/*.tsx",
"src/components/tailark/*.tsx",
"src/components/ai-elements/*.tsx",
"src/app/[[]locale]/preview/**",
"src/payment/types.ts",
"src/credits/types.ts",
"src/types/index.d.ts"
]
},
"formatter": {
@ -23,7 +38,8 @@
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"formatWithErrors": true
"formatWithErrors": true,
"useEditorconfig": true
},
"organizeImports": {
"enabled": true
@ -33,26 +49,53 @@
"rules": {
"recommended": true,
"suspicious": {
"noSparseArray": "off"
"noSparseArray": "off",
"noArrayIndexKey": "off",
"noExplicitAny": "off",
"noShadowRestrictedNames": "off"
},
"complexity": {
"noForEach": "off"
},
"correctness": {
"useExhaustiveDependencies": "off"
},
"style": {
"useTemplate": "off",
"noNonNullAssertion": "off",
"useShorthandArrayType": "off"
"useShorthandArrayType": "off",
"useNodejsImportProtocol": "off"
},
"a11y": {
"useValidAnchor": "off"
"useValidAnchor": "off",
"noSvgWithoutTitle": "off",
"useKeyWithClickEvents": "off"
}
},
"ignore": [
".next/**",
".content-collections/**",
".open-next/**",
".wrangler/**",
".cursor/**",
".claude/**",
".conductor/**",
".kiro/**",
".vscode/**",
".source/**",
"node_modules/**",
"dist/**",
"build/**",
"src/db/**",
"tailwind.config.ts",
"src/components/ui/*.tsx",
"src/components/magicui/*.tsx",
"tailwind.config.ts"
"src/components/animate-ui/*.tsx",
"src/components/tailark/*.tsx",
"src/components/ai-elements/*.tsx",
"src/app/[[]locale]/preview/**",
"src/payment/types.ts",
"src/credits/types.ts",
"src/types/index.d.ts"
]
},
"javascript": {

7483
cloudflare-env.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"config": "",
"css": "src/styles/globals.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""

View File

@ -1,337 +0,0 @@
import { defineCollection, defineConfig } from "@content-collections/core";
import { compileMDX } from "@content-collections/mdx";
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypePrettyCode, { Options } from 'rehype-pretty-code';
import rehypeSlug from 'rehype-slug';
import { codeImport } from 'remark-code-import';
import remarkGfm from 'remark-gfm';
import { createHighlighter } from 'shiki';
import path from "path";
import { LOCALES, DEFAULT_LOCALE } from "@/i18n/routing";
import { visit } from 'unist-util-visit';
/**
* Content Collections documentation
* 1. https://www.content-collections.dev/docs/quickstart/next
* 2. https://www.content-collections.dev/docs/configuration
* 3. https://www.content-collections.dev/docs/transform#join-collections
*/
/**
* Blog Author collection
*
* Authors are identified by their slug across all languages
*/
export const authors = defineCollection({
name: 'author',
directory: 'content',
include: '**/author/*.mdx',
schema: (z) => ({
slug: z.string(),
name: z.string(),
avatar: z.string(),
locale: z.enum(LOCALES as [string, ...string[]]).optional()
}),
transform: async (data, context) => {
// Determine the locale from the file path or use the provided locale
const pathParts = data._meta.path.split(path.sep);
const localeFromPath = LOCALES.includes(pathParts[0]) ? pathParts[0] : null;
const locale = data.locale || localeFromPath || DEFAULT_LOCALE;
return {
...data,
locale,
};
}
});
/**
* Blog Category collection
*
* Categories are identified by their slug across all languages
*/
export const categories = defineCollection({
name: 'category',
directory: 'content',
include: '**/category/*.mdx',
schema: (z) => ({
slug: z.string(),
name: z.string(),
description: z.string(),
locale: z.enum(LOCALES as [string, ...string[]]).optional()
}),
transform: async (data, context) => {
// Determine the locale from the file path or use the provided locale
const pathParts = data._meta.path.split(path.sep);
const localeFromPath = LOCALES.includes(pathParts[0]) ? pathParts[0] : null;
const locale = data.locale || localeFromPath || DEFAULT_LOCALE;
return {
...data,
locale
};
}
});
/**
* Blog Post collection
*
* 1. For a blog post at content/en/blog/first-post.mdx:
* locale: en
* slug: /blog/first-post
* slugAsParams: first-post
*
* 2. For a blog post at content/zh/blog/first-post.mdx:
* locale: zh
* slug: /blog/first-post
* slugAsParams: first-post
*/
export const posts = defineCollection({
name: 'post',
directory: 'content',
include: '**/blog/**/*.mdx',
schema: (z) => ({
title: z.string(),
description: z.string(),
image: z.string(),
date: z.string().datetime(),
published: z.boolean().default(true),
categories: z.array(z.string()),
author: z.string(),
locale: z.enum(LOCALES as [string, ...string[]]).optional()
}),
transform: async (data, context) => {
const body = await compileWithCodeCopy(context, data);
// Determine the locale from the file path or use the provided locale
const pathParts = data._meta.path.split(path.sep);
const localeFromPath = LOCALES.includes(pathParts[0]) ? pathParts[0] : null;
const locale = data.locale || localeFromPath || DEFAULT_LOCALE;
// Find the author by matching slug
const blogAuthor = context
.documents(authors)
.find((a) => a.slug === data.author && a.locale === locale) ||
context
.documents(authors)
.find((a) => a.slug === data.author);
// Find categories by matching slug
const blogCategories = data.categories.map(categorySlug => {
// Try to find a category with matching slug and locale
const category = context
.documents(categories)
.find(c => c.slug === categorySlug && c.locale === locale) ||
context
.documents(categories)
.find(c => c.slug === categorySlug);
return category;
}).filter(Boolean); // Remove null values
// Create a slug without the locale in the path
let slugPath = data._meta.path;
if (localeFromPath) {
// Remove the locale from the path for the slug
const pathWithoutLocale = pathParts.slice(1).join(path.sep);
slugPath = pathWithoutLocale;
}
// Create slugAsParams without the locale
const slugParamsParts = slugPath.split(path.sep).slice(1);
const slugAsParams = slugParamsParts.join('/');
return {
...data,
locale,
author: blogAuthor,
categories: blogCategories,
slug: `/${slugPath}`,
slugAsParams,
body: {
raw: data.content,
code: body
}
};
}
});
/**
* Pages collection for policy pages like privacy-policy, terms-of-service, etc.
*
* 1. For a page at content/en/pages/privacy-policy.md:
* locale: en
* slug: /pages/privacy-policy
* slugAsParams: privacy-policy
*
* 2. For a page at content/zh/pages/privacy-policy.md:
* locale: zh
* slug: /pages/privacy-policy
* slugAsParams: privacy-policy
*/
export const pages = defineCollection({
name: 'page',
directory: 'content',
include: '**/pages/**/*.{md,mdx}',
schema: (z) => ({
title: z.string(),
description: z.string(),
date: z.string().datetime(),
published: z.boolean().default(true),
locale: z.enum(LOCALES as [string, ...string[]]).optional()
}),
transform: async (data, context) => {
const body = await compileWithCodeCopy(context, data);
// Determine the locale from the file path or use the provided locale
const pathParts = data._meta.path.split(path.sep);
const localeFromPath = LOCALES.includes(pathParts[0]) ? pathParts[0] : null;
const locale = data.locale || localeFromPath || DEFAULT_LOCALE;
// Create a slug without the locale in the path
let slugPath = data._meta.path;
if (localeFromPath) {
// Remove the locale from the path for the slug
const pathWithoutLocale = pathParts.slice(1).join(path.sep);
slugPath = pathWithoutLocale;
}
// Create slugAsParams without the locale
const slugParamsParts = slugPath.split(path.sep).slice(1);
const slugAsParams = slugParamsParts.join('/');
return {
...data,
locale,
slug: `/${slugPath}`,
slugAsParams,
body: {
raw: data.content,
code: body
}
};
}
});
/**
* Releases collection for changelog
*
* 1. For a release at content/en/release/v1-0-0.md:
* locale: en
* slug: /release/v1-0-0
* slugAsParams: v1-0-0
*
* 2. For a release at content/zh/release/v1-0-0.md:
* locale: zh
* slug: /release/v1-0-0
* slugAsParams: v1-0-0
*/
export const releases = defineCollection({
name: 'release',
directory: 'content',
include: '**/release/**/*.{md,mdx}',
schema: (z) => ({
title: z.string(),
description: z.string(),
date: z.string().datetime(),
version: z.string(),
published: z.boolean().default(true),
locale: z.enum(LOCALES as [string, ...string[]]).optional()
}),
transform: async (data, context) => {
const body = await compileWithCodeCopy(context, data);
// Determine the locale from the file path or use the provided locale
const pathParts = data._meta.path.split(path.sep);
const localeFromPath = LOCALES.includes(pathParts[0]) ? pathParts[0] : null;
const locale = data.locale || localeFromPath || DEFAULT_LOCALE;
// Create a slug without the locale in the path
let slugPath = data._meta.path;
if (localeFromPath) {
// Remove the locale from the path for the slug
const pathWithoutLocale = pathParts.slice(1).join(path.sep);
slugPath = pathWithoutLocale;
}
// Create slugAsParams without the locale
const slugParamsParts = slugPath.split(path.sep).slice(1);
const slugAsParams = slugParamsParts.join('/');
return {
...data,
locale,
slug: `/${slugPath}`,
slugAsParams,
body: {
raw: data.content,
code: body
}
};
}
});
const prettyCodeOptions: Options = {
theme: 'github-dark',
getHighlighter: (options) =>
createHighlighter({
...options
}),
onVisitLine(node) {
// Prevent lines from collapsing in `display: grid` mode, and allow empty
// lines to be copy/pasted
if (node.children.length === 0) {
node.children = [{ type: 'text', value: ' ' }];
}
},
onVisitHighlightedLine(node) {
if (!node.properties.className) {
node.properties.className = [];
}
node.properties.className.push('line--highlighted');
},
onVisitHighlightedChars(node) {
if (!node.properties.className) {
node.properties.className = [];
}
node.properties.className = ['word--highlighted'];
}
};
const compileWithCodeCopy = async (
context: any,
data: any,
options: {
remarkPlugins?: any[];
rehypePlugins?: any[];
} = {}
) => {
return await compileMDX(context, data, {
...options,
remarkPlugins: [
remarkGfm,
codeImport,
...(options.remarkPlugins || [])
],
rehypePlugins: [
rehypeSlug,
[rehypePrettyCode, prettyCodeOptions],
// add __rawString__ to pre element
() => (tree) => {
visit(tree, (node) => {
if (node?.type === "element" && node?.tagName === "pre") {
const [codeEl] = node.children;
if (codeEl.tagName !== "code") return;
node.__rawString__ = codeEl.children?.[0]?.value;
}
});
},
rehypeAutolinkHeadings,
...(options.rehypePlugins || [])
]
});
};
export default defineConfig({
collections: [authors, categories, posts, pages, releases]
});

4
content/author/fox.mdx Normal file
View File

@ -0,0 +1,4 @@
---
name: Fox
avatar: /images/avatars/fox.png
---

View File

@ -0,0 +1,4 @@
---
name: Fox
avatar: /images/avatars/fox.png
---

View File

@ -1,5 +1,4 @@
---
slug: mkdirs
name: Mkdirs
avatar: /images/avatars/mkdirs.png
---

View File

@ -1,5 +1,4 @@
---
slug: mkdirs
name: Mkdirs
name: Mkdirs模板
avatar: /images/avatars/mkdirs.png
---

View File

@ -1,5 +1,4 @@
---
slug: mksaas
name: MkSaaS
avatar: /images/avatars/mksaas.png
---

View File

@ -1,5 +1,4 @@
---
slug: mksaas
name: MkSaaS
name: MkSaaS模板
avatar: /images/avatars/mksaas.png
---

View File

@ -0,0 +1,78 @@
---
title: Comparisons
description: How is Fumadocs different from other existing frameworks?
image: /images/blog/post-2.png
date: "2025-03-22"
published: true
categories: [news, company]
author: fox
---
## Nextra
Fumadocs is highly inspired by Nextra. For example, the Routing Conventions. That is why
`meta.json` also exists in Fumadocs.
Nextra is more opinionated than Fumadocs. Fumadocs is accelerated by App Router. As a result, It provides many server-side functions, and you have to
configure things manually compared to simply editing a configuration file.
Fumadocs works great if you want more control over everything, such as
adding it to an existing codebase or implementing advanced routing.
### Feature Table
| Feature | Fumadocs | Nextra |
| ------------------- | ------------ | ------------------------- |
| Static Generation | Yes | Yes |
| Cached | Yes | Yes |
| Light/Dark Mode | Yes | Yes |
| Syntax Highlighting | Yes | Yes |
| Table of Contents | Yes | Yes |
| Full-text Search | Yes | Yes |
| i18n | Yes | Yes |
| Last Git Edit Time | Yes | Yes |
| Page Icons | Yes | Yes, via `_meta.js` files |
| RSC | Yes | Yes |
| Remote Source | Yes | Yes |
| SEO | Via Metadata | Yes |
| Built-in Components | Yes | Yes |
| RTL Layout | Yes | Yes |
### Additional Features
Features supported via 3rd party libraries like [TypeDoc](https://typedoc.org) will not be listed here.
| Feature | Fumadocs | Nextra |
| -------------------------- | -------- | ------ |
| OpenAPI Integration | Yes | No |
| TypeScript Docs Generation | Yes | No |
| TypeScript Twoslash | Yes | Yes |
## Mintlify
Mintlify is a documentation service, as compared to Fumadocs, it offers a free tier but isn't completely free and open source.
Fumadocs is not as powerful as Mintlify, for example, the OpenAPI integration of Mintlify.
As the creator of Fumadocs, I wouldn't recommend switching to Fumadocs from Mintlify if you're satisfied with the current way you build docs.
However, I believe Fumadocs is a suitable tool for all Next.js developers who want to have elegant docs.
## Docusaurus
Docusaurus is a powerful framework based on React.js. It offers many cool
features with plugins and custom themes.
### Better DX
Since Fumadocs is built on the top of Next.js, you'll have to start the Next.js dev
server every time to review changes, and initial boilerplate code is relatively more
compared to Docusaurus.
For a simple docs, Docusaurus might be a better choice if you don't need any Next.js specific functionality.
However, when you want to use Next.js, or seek extra customizability like tuning default UI components, Fumadocs could be a better choice.
### Plugins
You can easily achieve many things with plugins, their ecosystem is indeed larger and maintained by many contributors.
In comparison, the flexibility of Fumadocs allows you to implement them on your own, it may take longer to tune it to your satisfaction.

View File

@ -0,0 +1,72 @@
---
title: 对比
description: Fumadocs 与其他现有框架有何不同?
image: /images/blog/post-2.png
date: "2025-03-22"
published: true
categories: [news, company]
author: fox
---
## Nextra
Fumadocs 深受 Nextra 启发。例如,路由约定。这就是为什么 Fumadocs 中也存在 `meta.json`。
Nextra 比 Fumadocs 更加固执己见。Fumadocs 由 App Router 加速。因此,它提供了许多服务器端功能,与简单编辑配置文件相比,您必须手动配置一些内容。
如果您想要对一切都有更多的控制比如将其添加到现有代码库或实现高级路由Fumadocs 会表现得很出色。
### 功能表
| 功能 | Fumadocs | Nextra |
| ------------------- | ------------ | ------------------------- |
| 静态生成 | 是 | 是 |
| 缓存 | 是 | 是 |
| 明/暗模式 | 是 | 是 |
| 语法高亮 | 是 | 是 |
| 目录 | 是 | 是 |
| 全文搜索 | 是 | 是 |
| 国际化 | 是 | 是 |
| 最后 Git 编辑时间 | 是 | 是 |
| 页面图标 | 是 | 是,通过 `_meta.js` 文件 |
| RSC | 是 | 是 |
| 远程源 | 是 | 是 |
| SEO | 通过元数据 | 是 |
| 内置组件 | 是 | 是 |
| RTL 布局 | 是 | 是 |
### 附加功能
通过第三方库支持的功能(如 [TypeDoc](https://typedoc.org))不会在此列出。
| 功能 | Fumadocs | Nextra |
| -------------------------- | -------- | ------ |
| OpenAPI 集成 | 是 | 否 |
| TypeScript 文档生成 | 是 | 否 |
| TypeScript Twoslash | 是 | 是 |
## Mintlify
Mintlify 是一项文档服务,与 Fumadocs 相比,它提供免费套餐,但并非完全免费和开源。
Fumadocs 不如 Mintlify 强大,例如 Mintlify 的 OpenAPI 集成。
作为 Fumadocs 的创建者,如果您对当前构建文档的方式感到满意,我不建议从 Mintlify 切换到 Fumadocs。
然而,我相信 Fumadocs 是所有想要拥有优雅文档的 Next.js 开发者的合适工具。
## Docusaurus
Docusaurus 是一个基于 React.js 的强大框架。它通过插件和自定义主题提供了许多酷炫的功能。
### 更好的开发者体验
由于 Fumadocs 构建在 Next.js 之上,您每次都必须启动 Next.js 开发服务器来查看更改,并且相对于 Docusaurus初始样板代码较多。
对于简单的文档,如果您不需要任何特定于 Next.js 的功能Docusaurus 可能是更好的选择。
然而,当您想要使用 Next.js或寻求更多的可定制性如调整默认 UI 组件时Fumadocs 可能是更好的选择。
### 插件
您可以通过插件轻松实现许多功能,他们的生态系统确实更大,并由许多贡献者维护。
相比之下Fumadocs 的灵活性允许您自己实现它们,可能需要更长的时间来调整它以达到您的满意度。

278
content/blog/fumadocs.mdx Normal file
View File

@ -0,0 +1,278 @@
---
title: Quick Start
description: Getting Started with Fumadocs
image: /images/blog/post-8.png
date: "2025-03-28"
published: true
categories: [company, news]
author: mksaas
---
## Introduction
Fumadocs <span className='text-fd-muted-foreground text-sm'>(Foo-ma docs)</span> is a **documentation framework** based on Next.js, designed to be fast, flexible,
and composes seamlessly into Next.js App Router.
Fumadocs has different parts:
<Cards>
<Card icon={<CpuIcon className="text-purple-300" />} title='Fumadocs Core'>
Handles most of the logic, including document search, content source adapters, and Markdown extensions.
</Card>
<Card icon={<PanelsTopLeft className="text-blue-300" />} title='Fumadocs UI'>
The default theme of Fumadocs offers a beautiful look for documentation sites and interactive components.
</Card>
<Card icon={<Database />} title='Content Source'>
The source of your content, can be a CMS or local data layers like [Content Collections](https://www.content-collections.dev) and [Fumadocs MDX](/docs/mdx), the official content source.
</Card>
<Card icon={<Terminal />} title='Fumadocs CLI'>
A command line tool to install UI components and automate things, useful for customizing layouts.
</Card>
</Cards>
<Callout title="Want to learn more?">
Read our in-depth [What is Fumadocs](/docs/what-is-fumadocs) introduction.
</Callout>
### Terminology
**Markdown/MDX:** Markdown is a markup language for creating formatted text. Fumadocs supports Markdown and MDX (superset of Markdown) out-of-the-box.
Although not required, some basic knowledge of Next.js App Router would be useful for further customisations.
## Automatic Installation
A minimum version of Node.js 18 required, note that Node.js 23.1 might have problems with Next.js production build.
<Tabs groupId='package-manager' persist items={['npm', 'pnpm', 'yarn', 'bun']}>
```bash tab="npm"
npm create fumadocs-app
```
```bash tab="pnpm"
pnpm create fumadocs-app
```
```bash tab="yarn"
yarn create fumadocs-app
```
```bash tab="bun"
bun create fumadocs-app
```
</Tabs>
It will ask you the framework and content source to use, a new fumadocs app should be initialized. Now you can start hacking!
<Callout title='From Existing Codebase?'>
You can follow the [Manual Installation](/docs/manual-installation) guide to get started.
</Callout>
### Enjoy!
Create your first MDX file in the docs folder.
```mdx title="content/docs/index.mdx"
---
title: Hello World
---
## Yo what's up
```
Run the app in development mode and see http://localhost:3000/docs.
```mdx
npm run dev
```
## Explore
In the project, you can see:
- `lib/source.ts`: Code for content source adapter, [`loader()`](/docs/headless/source-api) provides an interface to interact with your content source, and assigns URL to your pages.
- `app/layout.config.tsx`: Shared options for layouts, optional but preferred to keep.
| Route | Description |
| ------------------------- | ------------------------------------------------------ |
| `app/(home)` | The route group for your landing page and other pages. |
| `app/docs` | The documentation layout and pages. |
| `app/api/search/route.ts` | The Route Handler for search. |
### Writing Content
For authoring docs, make sure to read:
<Cards>
<Card href="/docs/markdown" title="Markdown">
Fumadocs has some additional features for authoring content too.
</Card>
<Card href="/docs/navigation" title="Navigation">
Learn how to customise navigation links/sidebar items.
</Card>
</Cards>
### Content Source
Content source handles all your content, like compiling Markdown files and validating frontmatter.
<Tabs items={['Fumadocs MDX', 'Custom Source']}>
<Tab value='Fumadocs MDX'>
Read the [Introduction](/docs/mdx) to learn how it handles your content.
A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.
</Tab>
<Tab value='Custom Source'>
Fumadocs is not Markdown-exclusive. For other sources like Sanity, you can build a [custom content source](/docs/headless/custom-source).
</Tab>
</Tabs>
### Customise UI
See [Customisation Guide](/docs/customisation).
## FAQ
Some common questions you may encounter.
<Accordions>
<Accordion id='fix-monorepo-styling' title="How to fix stylings not being applied in Monorepo?">
Sometimes, `fumadocs-ui` is not installed in the workspace of your Tailwind CSS configuration file. (e.g. a monorepo setup).
You have to ensure the `fumadocs-ui` package is scanned by Tailwind CSS, and give a correct relative path to `@source`.
For example, add `../../` to point to the `node_modules` folder in root workspace.
```css
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* [!code --] */
@source '../node_modules/fumadocs-ui/dist/**/*.js';
/* [!code ++] */
@source '../../../node_modules/fumadocs-ui/dist/**/*.js';
```
</Accordion>
<Accordion id='change-base-url' title="How to change the base route of /docs?">
You can change the base route of docs (e.g. from `/docs/page` to `/info/page`).
Since Fumadocs uses Next.js App Router, you can simply rename the route:
<Files>
<Folder name="app/docs" defaultOpen className="opacity-50" disabled>
<File name="layout.tsx" />
</Folder>
<Folder name="app/info" defaultOpen>
<File name="layout.tsx" />
</Folder>
</Files>
And tell Fumadocs to use the new route in `source.ts`:
```ts title="lib/source.ts"
import { loader } from 'fumadocs-core/source';
export const source = loader({
baseUrl: '/info',
// other options
});
```
</Accordion>
<Accordion id='dynamic-route' title="It uses Dynamic Route, will it be poor in performance?">
Next.js turns dynamic route into static routes when `generateStaticParams` is configured.
Hence, it is as fast as static pages.
You can enable Static Exports on Next.js to get a static build output. (Notice that Route Handler doesn't work with static export, you have to configure static search)
</Accordion>
<Accordion id='custom-layout-docs-page' title='How to create a page in /docs without docs layout?'>
Same as managing layouts in Next.js App Router, remove the original MDX file from content directory (`/content/docs`).
This ensures duplicated pages will not cause errors.
Now, You can add the page to another route group, which isn't a descendant of docs layout.
For example, under your `app` folder:
<Files>
<File name="(home)/docs/page.tsx" />
<Folder name="docs">
<File name="layout.tsx" />
<File name="[[...slug]]/page.tsx" />
</Folder>
</Files>
will replace the `/docs` page with your `page.tsx`.
</Accordion>
<Accordion id='multi-versions' title="How to implement docs with multi-version?">
Use a separate deployment for each version.
On Vercel, this can be done by creating another branch for a specific version on your GitHub repository.
To link to the sites of other versions, use the Links API or a custom navigation component.
</Accordion>
<Accordion id='multi-docs' title="How to implement multi-docs?">
We recommend to use [Sidebar Tabs](/docs/navigation/sidebar#sidebar-tabs).
</Accordion>
</Accordions>
## Learn More
New to here? Don't worry, we are welcome for your questions.
If you find anything confusing, please give your feedback on [Github Discussion](https://github.com/fuma-nama/fumadocs/discussions)!
<Cards>
<Card
href="/docs/static-export"
title="Configure Static Export"
description="Learn how to enable static export on your docs"
/>
<Card
href="/docs/search"
title="Customise Search"
description="Learn how to customise document search"
/>
<Card
href="/docs/theme"
title="Theming"
description="Add themes to Fumadocs UI"
/>
<Card
href="/docs/components"
title="Components"
description="See all available components to enhance your docs"
/>
</Cards>

View File

@ -0,0 +1,253 @@
---
title: 快速入门
description: Fumadocs 入门指南
image: /images/blog/post-8.png
date: "2025-03-28"
published: true
categories: [company, news]
author: mksaas
---
## 简介
Fumadocs <span className='text-fd-muted-foreground text-sm'>(Foo-ma docs)</span> 是一个基于 Next.js 的**文档框架**,设计为快速、灵活,
并无缝集成到 Next.js App Router 中。
Fumadocs 由不同部分组成:
<Cards>
<Card icon={<CpuIcon className="text-purple-300" />} title='Fumadocs Core'>
处理大部分逻辑,包括文档搜索、内容源适配器和 Markdown 扩展。
</Card>
<Card icon={<PanelsTopLeft className="text-blue-300" />} title='Fumadocs UI'>
Fumadocs 的默认主题为文档站点提供了美观的外观和交互式组件。
</Card>
<Card icon={<Database />} title='Content Source'>
您内容的来源,可以是 CMS 或本地数据层,如 [Content Collections](https://www.content-collections.dev) 和 [Fumadocs MDX](/docs/mdx),即官方内容源。
</Card>
<Card icon={<Terminal />} title='Fumadocs CLI'>
一个命令行工具,用于安装 UI 组件和自动化操作,对于自定义布局非常有用。
</Card>
</Cards>
<Callout title="想了解更多?">
阅读我们深入的 [什么是 Fumadocs](/docs/what-is-fumadocs) 介绍。
</Callout>
### 术语
**Markdown/MDX:** Markdown 是一种用于创建格式化文本的标记语言。Fumadocs 默认支持 Markdown 和 MDXMarkdown 的超集)。
虽然不是必需的,但对 Next.js App Router 的基本了解对于进一步的自定义会很有帮助。
## 自动安装
需要 Node.js 18 或更高版本,请注意 Node.js 23.1 可能在 Next.js 生产构建中存在问题。
<Tabs groupId='package-manager' persist items={['npm', 'pnpm', 'yarn', 'bun']}>
```bash tab="npm"
npm create fumadocs-app
```
```bash tab="pnpm"
pnpm create fumadocs-app
```
```bash tab="yarn"
yarn create fumadocs-app
```
```bash tab="bun"
bun create fumadocs-app
```
</Tabs>
它会询问您要使用的框架和内容源,随后将初始化一个新的 fumadocs 应用程序。现在您可以开始动手了!
<Callout title='从现有代码库开始?'>
您可以按照 [手动安装](/docs/manual-installation) 指南开始。
</Callout>
### 尽情使用!
在 docs 文件夹中创建您的第一个 MDX 文件。
```mdx title="content/docs/index.mdx"
---
title: Hello World
---
## Yo what's up
```
在开发模式下运行应用程序并查看 http://localhost:3000/docs。
```mdx
npm run dev
```
## 探索
在项目中,您可以看到:
- `lib/source.ts`:内容源适配器的代码,[`loader()`](/docs/headless/source-api) 提供了与内容源交互的接口,并为您的页面分配 URL。
- `app/layout.config.tsx`:布局的共享选项,可选但建议保留。
| 路由 | 描述 |
| ------------------------- | -------------------------------------- |
| `app/(home)` | 您的登陆页面和其他页面的路由组。 |
| `app/docs` | 文档布局和页面。 |
| `app/api/search/route.ts` | 搜索的路由处理器。 |
### 编写内容
对于编写文档,请务必阅读:
<Cards>
<Card href="/docs/markdown" title="Markdown">
Fumadocs 还有一些额外的内容创作功能。
</Card>
<Card href="/docs/navigation" title="Navigation">
了解如何自定义导航链接/侧边栏项目。
</Card>
</Cards>
### 内容源
内容源处理您的所有内容,例如编译 Markdown 文件和验证前言。
<Tabs items={['Fumadocs MDX', 'Custom Source']}>
<Tab value='Fumadocs MDX'>
阅读 [介绍](/docs/mdx) 了解它如何处理您的内容。
项目中已包含 `source.config.ts` 配置文件,您可以自定义不同的选项,如前言模式。
</Tab>
<Tab value='Custom Source'>
Fumadocs 不仅限于 Markdown。对于其他源如 Sanity您可以构建 [自定义内容源](/docs/headless/custom-source)。
</Tab>
</Tabs>
### 自定义 UI
请参阅 [自定义指南](/docs/customisation)。
## 常见问题
您可能遇到的一些常见问题。
<Accordions>
<Accordion id='fix-monorepo-styling' title="如何修复 Monorepo 中样式不应用的问题?">
有时,`fumadocs-ui` 没有安装在您的 Tailwind CSS 配置文件的工作区中(例如,在 monorepo 设置中)。
您必须确保 Tailwind CSS 扫描 `fumadocs-ui` 包,并为 `@source` 提供正确的相对路径。
例如,添加 `../../` 指向根工作区中的 `node_modules` 文件夹。
```css
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* [!code --] */
@source '../node_modules/fumadocs-ui/dist/**/*.js';
/* [!code ++] */
@source '../../../node_modules/fumadocs-ui/dist/**/*.js';
```
</Accordion>
<Accordion id='change-base-url' title="如何更改 /docs 的基本路由?">
您可以更改文档的基本路由(例如,从 `/docs/page` 更改为 `/info/page`)。
由于 Fumadocs 使用 Next.js App Router您可以简单地重命名路由
<Files>
<Folder name="app/docs" defaultOpen className="opacity-50" disabled>
<File name="layout.tsx" />
</Folder>
<Folder name="app/info" defaultOpen>
<File name="layout.tsx" />
</Folder>
</Files>
并在 `source.ts` 中告诉 Fumadocs 使用新的路由:
```ts title="lib/source.ts"
import { loader } from 'fumadocs-core/source';
export const source = loader({
baseUrl: '/info',
// other options
});
```
</Accordion>
<Accordion id='dynamic-route' title="它使用动态路由,性能会很差吗?">
当配置了 `generateStaticParams` 时Next.js 会将动态路由转换为静态路由。
因此,它与静态页面一样快。
您可以在 Next.js 上启用静态导出,获得静态构建输出。(请注意,路由处理器不适用于静态导出,您必须配置静态搜索)
</Accordion>
<Accordion id='custom-layout-docs-page' title='如何在 /docs 中创建没有文档布局的页面?'>
与在 Next.js App Router 中管理布局相同,从内容目录(`/content/docs`)中删除原始 MDX 文件。
这确保重复的页面不会导致错误。
现在,您可以将页面添加到另一个路由组,该组不是文档布局的后代。
例如,在您的 `app` 文件夹下:
<Files>
<File name="(home)/docs/page.tsx" />
<Folder name="docs">
<File name="layout.tsx" />
<File name="[[...slug]]/page.tsx" />
</Folder>
</Files>
将用您的 `page.tsx` 替换 `/docs` 页面。
</Accordion>
<Accordion id='multi-versions' title="如何实现多版本文档?">
为每个版本使用单独的部署。
在 Vercel 上,可以通过在 GitHub 存储库中为特定版本创建另一个分支来实现。
要链接到其他版本的站点,请使用 Links API 或自定义导航组件。
</Accordion>
<Accordion id='multi-docs' title="如何实现多文档?">
我们建议使用 [侧边栏标签](/docs/navigation/sidebar#sidebar-tabs)。
</Accordion>
</Accordions>
## 了解更多
刚来这里?别担心,我们欢迎您的问题。

View File

@ -0,0 +1,227 @@
---
title: Internationalization
description: Support multiple languages in your documentation
image: /images/blog/post-3.png
date: "2025-03-15"
published: true
categories: [company, product]
author: mksaas
---
<Callout title='Before you get started'>
Fumadocs is not a full-powered i18n library, it manages only its own components and utilities.
You can use other libraries like [next-intl](https://github.com/amannn/next-intl) for the rest of your app.
Read the [Next.js Docs](https://nextjs.org/docs/app/building-your-application/routing/internationalization) to learn more about implementing I18n in Next.js.
</Callout>
## Manual Setup
Define the i18n configurations in a file, we will import it with `@/ilb/i18n` in this guide.
{/* <include cwd meta='title="lib/i18n.ts"'>
../../examples/i18n/lib/i18n.ts
</include> */}
Pass it to the source loader.
```ts title="lib/source.ts"
import { i18n } from '@/lib/i18n';
import { loader } from 'fumadocs-core/source';
export const source = loader({
i18n, // [!code highlight]
// other options
});
```
And update Fumadocs UI layout options.
```tsx title="app/layout.config.tsx"
import { i18n } from '@/lib/i18n';
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
export function baseOptions(locale: string): BaseLayoutProps {
return {
i18n,
// different props based on `locale`
};
}
```
### Middleware
Create a middleware that redirects users to appropriate locale.
```json doc-gen:file
{
"file": "../../examples/i18n/middleware.ts",
"codeblock": {
"lang": "ts",
"meta": "title=\"middleware.ts\""
}
}
```
See [Middleware](/docs/headless/internationalization#middleware) for customisable options.
> Note that this is optional, you can also use your own middleware or the one provided by i18n libraries.
### Routing
Create a `/app/[lang]` folder, and move all files (e.g. `page.tsx`, `layout.tsx`) from `/app` to the folder.
Wrap the root provider inside `I18nProvider`, and provide available languages & translations to it.
Note that only English translations are provided by default.
```tsx title="app/[lang]/layout.tsx"
import { RootProvider } from 'fumadocs-ui/provider';
import { I18nProvider, type Translations } from 'fumadocs-ui/i18n';
const cn: Partial<Translations> = {
search: 'Translated Content',
// other translations
};
// available languages that will be displayed on UI
// make sure `locale` is consistent with your i18n config
const locales = [
{
name: 'English',
locale: 'en',
},
{
name: 'Chinese',
locale: 'cn',
},
];
export default async function RootLayout({
params,
children,
}: {
params: Promise<{ lang: string }>;
children: React.ReactNode;
}) {
const lang = (await params).lang;
return (
<html lang={lang}>
<body>
<I18nProvider
locale={lang}
locales={locales}
translations={{ cn }[lang]}
>
<RootProvider>{children}</RootProvider>
</I18nProvider>
</body>
</html>
);
}
```
### Pass Locale
Pass the locale to Fumadocs in your pages and layouts.
{/* ```tsx title="/app/[lang]/(home)/layout.tsx" tab="Home Layout"
import type { ReactNode } from 'react';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';
export default async function Layout({
params,
children,
}: {
params: Promise<{ lang: string }>;
children: ReactNode;
}) {
const { lang } = await params;
return <HomeLayout {...baseOptions(lang)}>{children}</HomeLayout>;
}
```
```tsx title="/app/[lang]/docs/layout.tsx" tab="Docs Layout"
import type { ReactNode } from 'react';
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/app/layout.config';
export default async function Layout({
params,
children,
}: {
params: Promise<{ lang: string }>;
children: ReactNode;
}) {
const { lang } = await params;
return (
<DocsLayout {...baseOptions(lang)} tree={source.pageTree[lang]}>
{children}
</DocsLayout>
);
}
```
```ts title="page.tsx" tab="Docs Page"
import { source } from '@/lib/source';
export default async function Page({
params,
}: {
params: Promise<{ lang: string; slug?: string[] }>;
}) {
const { slug, lang } = await params;
// get page
source.getPage(slug); // [!code --]
source.getPage(slug, lang); // [!code ++]
// get pages
source.getPages(); // [!code --]
source.getPages(lang); // [!code ++]
}
``` */}
### Search
Configure i18n on your search solution.
- **Built-in Search (Orama):**
For [Supported Languages](https://docs.orama.com/open-source/supported-languages#officially-supported-languages), no further changes are needed.
Otherwise, additional config is required (e.g. Chinese & Japanese). See [Special Languages](/docs/headless/search/orama#special-languages).
- **Cloud Solutions (e.g. Algolia):**
They usually have official support for multilingual.
## Writing Documents
{/* <include>../../shared/page-conventions.i18n.mdx</include> */}
## Navigation
Fumadocs only handles navigation for its own layouts (e.g. sidebar).
For other places, you can use the `useParams` hook to get the locale from url, and attend it to `href`.
```tsx
import Link from 'next/link';
import { useParams } from 'next/navigation';
const { lang } = useParams();
return <Link href={`/${lang}/another-page`}>This is a link</Link>;
```
In addition, the [`fumadocs-core/dynamic-link`](/docs/headless/components/link#dynamic-hrefs) component supports dynamic hrefs, you can use it to attend the locale prefix.
It is useful for Markdown/MDX content.
```mdx title="content.mdx"
import { DynamicLink } from 'fumadocs-core/dynamic-link';
<DynamicLink href="/[lang]/another-page">This is a link</DynamicLink>
```

View File

@ -0,0 +1,227 @@
---
title: 国际化
description: 在您的文档中支持多种语言
image: /images/blog/post-3.png
date: "2025-03-15"
published: true
categories: [company, product]
author: mksaas
---
<Callout title='开始之前'>
Fumadocs 不是一个功能齐全的 i18n 库,它只管理自己的组件和工具。
您可以使用其他库,如 [next-intl](https://github.com/amannn/next-intl),用于应用程序的其余部分。
阅读 [Next.js 文档](https://nextjs.org/docs/app/building-your-application/routing/internationalization),了解更多关于在 Next.js 中实现 I18n 的信息。
</Callout>
## 手动设置
在一个文件中定义 i18n 配置,我们将在本指南中使用 `@/ilb/i18n` 导入它。
{/* <include cwd meta='title="lib/i18n.ts"'>
../../examples/i18n/lib/i18n.ts
</include> */}
将其传递给源加载器。
```ts title="lib/source.ts"
import { i18n } from '@/lib/i18n';
import { loader } from 'fumadocs-core/source';
export const source = loader({
i18n, // [!code highlight]
// other options
});
```
并更新 Fumadocs UI 布局选项。
```tsx title="app/layout.config.tsx"
import { i18n } from '@/lib/i18n';
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
export function baseOptions(locale: string): BaseLayoutProps {
return {
i18n,
// different props based on `locale`
};
}
```
### 中间件
创建一个将用户重定向到适当语言环境的中间件。
```json doc-gen:file
{
"file": "../../examples/i18n/middleware.ts",
"codeblock": {
"lang": "ts",
"meta": "title=\"middleware.ts\""
}
}
```
查看[中间件](/docs/headless/internationalization#middleware)了解可自定义选项。
> 请注意,这是可选的,您也可以使用自己的中间件或 i18n 库提供的中间件。
### 路由
创建一个 `/app/[lang]` 文件夹,并将所有文件(例如 `page.tsx`、`layout.tsx`)从 `/app` 移动到该文件夹。
将根提供程序包装在 `I18nProvider` 中,并向其提供可用语言和翻译。
请注意,默认情况下只提供英文翻译。
```tsx title="app/[lang]/layout.tsx"
import { RootProvider } from 'fumadocs-ui/provider';
import { I18nProvider, type Translations } from 'fumadocs-ui/i18n';
const cn: Partial<Translations> = {
search: 'Translated Content',
// other translations
};
// available languages that will be displayed on UI
// make sure `locale` is consistent with your i18n config
const locales = [
{
name: 'English',
locale: 'en',
},
{
name: 'Chinese',
locale: 'cn',
},
];
export default async function RootLayout({
params,
children,
}: {
params: Promise<{ lang: string }>;
children: React.ReactNode;
}) {
const lang = (await params).lang;
return (
<html lang={lang}>
<body>
<I18nProvider
locale={lang}
locales={locales}
translations={{ cn }[lang]}
>
<RootProvider>{children}</RootProvider>
</I18nProvider>
</body>
</html>
);
}
```
### 传递区域设置
在您的页面和布局中将区域设置传递给 Fumadocs。
{/* ```tsx title="/app/[lang]/(home)/layout.tsx" tab="Home Layout"
import type { ReactNode } from 'react';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';
export default async function Layout({
params,
children,
}: {
params: Promise<{ lang: string }>;
children: ReactNode;
}) {
const { lang } = await params;
return <HomeLayout {...baseOptions(lang)}>{children}</HomeLayout>;
}
```
```tsx title="/app/[lang]/docs/layout.tsx" tab="Docs Layout"
import type { ReactNode } from 'react';
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/app/layout.config';
export default async function Layout({
params,
children,
}: {
params: Promise<{ lang: string }>;
children: ReactNode;
}) {
const { lang } = await params;
return (
<DocsLayout {...baseOptions(lang)} tree={source.pageTree[lang]}>
{children}
</DocsLayout>
);
}
```
```ts title="page.tsx" tab="Docs Page"
import { source } from '@/lib/source';
export default async function Page({
params,
}: {
params: Promise<{ lang: string; slug?: string[] }>;
}) {
const { slug, lang } = await params;
// get page
source.getPage(slug); // [!code --]
source.getPage(slug, lang); // [!code ++]
// get pages
source.getPages(); // [!code --]
source.getPages(lang); // [!code ++]
}
``` */}
### 搜索
在您的搜索解决方案上配置 i18n。
- **内置搜索 (Orama)**
对于[支持的语言](https://docs.orama.com/open-source/supported-languages#officially-supported-languages),无需进一步更改。
否则,需要额外配置(例如中文和日语)。请参阅[特殊语言](/docs/headless/search/orama#special-languages)。
- **云解决方案(例如 Algolia**
它们通常官方支持多语言。
## 编写文档
{/* <include>../../shared/page-conventions.i18n.mdx</include> */}
## 导航
Fumadocs 只处理其自己的布局(例如侧边栏)的导航。
对于其他地方,您可以使用 `useParams` 钩子从 url 获取区域设置,并将其添加到 `href`。
```tsx
import Link from 'next/link';
import { useParams } from 'next/navigation';
const { lang } = useParams();
return <Link href={`/${lang}/another-page`}>This is a link</Link>;
```
另外,[`fumadocs-core/dynamic-link`](/docs/headless/components/link#dynamic-hrefs) 组件支持动态 hrefs您可以使用它来添加区域设置前缀。
这对于 Markdown/MDX 内容很有用。
```mdx title="content.mdx"
import { DynamicLink } from 'fumadocs-core/dynamic-link';
<DynamicLink href="/[lang]/another-page">This is a link</DynamicLink>
```

View File

@ -0,0 +1,198 @@
---
title: Manual Installation
description: Create a new fumadocs project from scratch.
image: /images/blog/post-4.png
date: "2025-03-14"
published: true
categories: [company, product]
author: mkdirs
---
> Read the [Quick Start](/docs) guide first for basic concept.
## Getting Started
Create a new Next.js application with `create-next-app`, and install required packages.
```mdx
fumadocs-ui fumadocs-core
```
### Content Source
Fumadocs supports different content sources, you can choose one you prefer.
There is a list of officially supported sources:
- [Setup Fumadocs MDX](/docs/mdx)
- [Setup Content Collections](/docs/headless/content-collections)
Make sure to configure the library correctly following their setup guide before continuing, we will import the source adapter using `@/lib/source.ts` in this guide.
### Root Layout
Wrap the entire application inside [Root Provider](/docs/layouts/root-provider), and add required styles to `body`.
```tsx
import { RootProvider } from 'fumadocs-ui/provider';
import type { ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body
// you can use Tailwind CSS too
style={{
display: 'flex',
flexDirection: 'column',
minHeight: '100vh',
}}
>
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}
```
### Styles
Setup Tailwind CSS v4 on your Next.js app, add the following to `global.css`.
```css title="Tailwind CSS"
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* path of `fumadocs-ui` relative to the CSS file */
@source '../node_modules/fumadocs-ui/dist/**/*.js';
```
> It doesn't come with a default font, you may choose one from `next/font`.
### Layout
Create a `app/layout.config.tsx` file to put the shared options for our layouts.
```json doc-gen:file
{
"file": "../../examples/next-mdx/app/layout.config.tsx",
"codeblock": {
"meta": "title=\"app/layout.config.tsx\""
}
}
```
Create a folder `/app/docs` for our docs, and give it a proper layout.
```json doc-gen:file
{
"file": "../../examples/next-mdx/app/docs/layout.tsx",
"codeblock": {
"meta": "title=\"app/docs/layout.tsx\""
}
}
```
> `pageTree` refers to Page Tree, it should be provided by your content source.
### Page
Create a catch-all route `/app/docs/[[...slug]]` for docs pages.
In the page, wrap your content in the [Page](/docs/layouts/page) component.
It may vary depending on your content source. You should configure static rendering with `generateStaticParams` and metadata with `generateMetadata`.
<Tabs items={['Fumadocs MDX', 'Content Collections']}>
<Tab value='Fumadocs MDX'>
```json doc-gen:file
{
"file": "../../examples/next-mdx/app/docs/[[...slug]]/page.tsx",
"codeblock": {
"meta": "title=\"app/docs/[[...slug]]/page.tsx\" tab=\"Fumadocs MDX\""
}
}
```
</Tab>
<Tab value='Content Collections'>
```json doc-gen:file
{
"file": "../../examples/content-collections/app/docs/[[...slug]]/page.tsx",
"codeblock": {
"meta": "title=\"app/docs/[[...slug]]/page.tsx\" tab=\"Content Collections\""
}
}
```
</Tab>
</Tabs>
### Search
Use the default document search based on Orama.
<Tabs items={['Fumadocs MDX', 'Content Collections']}>
<Tab value='Fumadocs MDX'>
```json doc-gen:file
{
"file": "../../examples/next-mdx/app/api/search/route.ts",
"codeblock": {
"meta": "title=\"app/api/search/route.ts\" tab=\"Fumadocs MDX\""
}
}
```
</Tab>
<Tab value='Content Collections'>
```json doc-gen:file
{
"file": "../../examples/content-collections/app/api/search/route.ts",
"codeblock": {
"meta": "title=\"app/api/search/route.ts\" tab=\"Content Collections\""
}
}
```
</Tab>
</Tabs>
Learn more about [Document Search](/docs/headless/search).
### Done
You can start the dev server and create MDX files.
```mdx title="content/docs/index.mdx"
---
title: Hello World
---
## Introduction
I love Anime.
```
## Customise
You can use [Home Layout](/docs/layouts/home-layout) for other pages of the site, it includes a navbar with theme toggle.
## Deploying
It should work out-of-the-box with Vercel & Netlify.
### Docker Deployment
If you want to deploy your Fumadocs app using Docker with **Fumadocs MDX configured**, make sure to add the `source.config.ts` file to the `WORKDIR` in the Dockerfile.
The following snippet is taken from the official [Next.js Dockerfile Example](https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile):
```zsh title="Dockerfile"
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* source.config.ts ./
```
This ensures Fumadocs MDX can access your configuration file during builds.

View File

@ -0,0 +1,196 @@
---
title: 手动安装
description: 从零开始创建一个新的 Fumadocs 项目
image: /images/blog/post-4.png
date: "2025-03-14"
published: true
categories: [company, product]
author: mkdirs
---
> 请先阅读[快速入门](/docs)指南了解基本概念。
## 入门
使用 `create-next-app` 创建一个新的 Next.js 应用程序,并安装所需的包。
```mdx
fumadocs-ui fumadocs-core
```
### 内容源
Fumadocs 支持不同的内容源,您可以选择您喜欢的一种。
以下是官方支持的源列表:
- [设置 Fumadocs MDX](/docs/mdx)
- [设置 Content Collections](/docs/headless/content-collections)
请确保在继续之前按照其设置指南正确配置库,我们将在本指南中使用 `@/lib/source.ts` 导入源适配器。
### 根布局
将整个应用程序包装在 [Root Provider](/docs/layouts/root-provider) 中,并为 `body` 添加所需的样式。
```tsx
import { RootProvider } from 'fumadocs-ui/provider';
import type { ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body
// you can use Tailwind CSS too
style={{
display: 'flex',
flexDirection: 'column',
minHeight: '100vh',
}}
>
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}
```
### 样式
在您的 Next.js 应用程序上设置 Tailwind CSS v4将以下内容添加到 `global.css`。
```css title="Tailwind CSS"
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* path of `fumadocs-ui` relative to the CSS file */
@source '../node_modules/fumadocs-ui/dist/**/*.js';
```
> 它不附带默认字体,您可以从 `next/font` 中选择一个。
### 布局
创建一个 `app/layout.config.tsx` 文件,放置我们布局的共享选项。
```json doc-gen:file
{
"file": "../../examples/next-mdx/app/layout.config.tsx",
"codeblock": {
"meta": "title=\"app/layout.config.tsx\""
}
}
```
为我们的文档创建一个文件夹 `/app/docs`,并给它一个适当的布局。
```json doc-gen:file
{
"file": "../../examples/next-mdx/app/docs/layout.tsx",
"codeblock": {
"meta": "title=\"app/docs/layout.tsx\""
}
}
```
> `pageTree` 指的是页面树,应该由您的内容源提供。
### 页面
为文档页面创建一个捕获所有路由 `/app/docs/[[...slug]]`。
在页面中,将您的内容包装在 [Page](/docs/layouts/page) 组件中。
这可能因您的内容源而异。您应该使用 `generateStaticParams` 配置静态渲染,并使用 `generateMetadata` 配置元数据。
<Tabs items={['Fumadocs MDX', 'Content Collections']}>
<Tab value='Fumadocs MDX'>
```json doc-gen:file
{
"file": "../../examples/next-mdx/app/docs/[[...slug]]/page.tsx",
"codeblock": {
"meta": "title=\"app/docs/[[...slug]]/page.tsx\" tab=\"Fumadocs MDX\""
}
}
```
</Tab>
<Tab value='Content Collections'>
```json doc-gen:file
{
"file": "../../examples/content-collections/app/docs/[[...slug]]/page.tsx",
"codeblock": {
"meta": "title=\"app/docs/[[...slug]]/page.tsx\" tab=\"Content Collections\""
}
}
```
</Tab>
</Tabs>
### 搜索
使用基于 Orama 的默认文档搜索。
<Tabs items={['Fumadocs MDX', 'Content Collections']}>
<Tab value='Fumadocs MDX'>
```json doc-gen:file
{
"file": "../../examples/next-mdx/app/api/search/route.ts",
"codeblock": {
"meta": "title=\"app/api/search/route.ts\" tab=\"Fumadocs MDX\""
}
}
```
</Tab>
<Tab value='Content Collections'>
```json doc-gen:file
{
"file": "../../examples/content-collections/app/api/search/route.ts",
"codeblock": {
"meta": "title=\"app/api/search/route.ts\" tab=\"Content Collections\""
}
}
```
</Tab>
</Tabs>
了解更多关于[文档搜索](/docs/headless/search)的信息。
### 完成
您可以启动开发服务器并创建 MDX 文件。
```mdx title="content/docs/index.mdx"
---
title: Hello World
---
## Introduction
I love Anime.
```
## 自定义
您可以为网站的其他页面使用 [Home Layout](/docs/layouts/home-layout),它包含一个带有主题切换的导航栏。
## 部署
它应该在 Vercel 和 Netlify 上开箱即用。
### Docker 部署
如果您想使用 Docker 部署您的 Fumadocs 应用程序,并且已**配置了 Fumadocs MDX**,请确保将 `source.config.ts` 文件添加到 Dockerfile 中的 `WORKDIR`。
以下片段取自官方 [Next.js Dockerfile 示例](https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile)
```zsh title="Dockerfile"
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* source.config.ts ./
```
这确保 Fumadocs MDX 在构建期间可以访问您的配置文件。

385
content/blog/markdown.mdx Normal file
View File

@ -0,0 +1,385 @@
---
title: Markdown
description: How to write documents
image: /images/blog/post-5.png
date: "2025-03-05"
published: true
categories: [news, company]
author: mkdirs
---
## Introduction
Fumadocs provides many useful extensions to MDX, a markup language. Here is a brief introduction to the default MDX syntax of Fumadocs UI.
> MDX is not the only supported format of Fumadocs. In fact, you can use any renderers such as `next-mdx-remote` or CMS.
## Markdown
We use GFM (GitHub Flavored Markdown), a superset of Markdown (CommonMark).
See [GFM Specification](https://github.github.com/gfm).
````md
# Heading
## Heading
### Heading
#### Heading
Hello World, **Bold**, _Italic_, ~~Hidden~~
```js
console.log('Hello World');
```
1. First
2. Second
3. Third
- Item 1
- Item 2
> Quote here
![alt](/image.png)
| Table | Description |
| ----- | ----------- |
| Hello | World |
````
### Auto Links
Internal links use the `next/link` component to allow prefetching and avoid hard-reload.
External links will get the default `rel="noreferrer noopener" target="_blank"` attributes for security.
```mdx
[My Link](https://github.github.com/gfm)
This also works: https://github.github.com/gfm.
```
## MDX
MDX is a superset of Markdown, with support of JSX syntax.
It allows you to import components, and use them right in the document, or even export values.
```mdx
import { Component } from './component';
<Component name="Hello" />
```
see [MDX Syntax](https://mdxjs.com/docs/what-is-mdx/#mdx-syntax) to learn more.
### Cards
Useful for adding links, it is included by default.
```mdx
<Cards>
<Card
href="https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating"
title="Fetching, Caching, and Revalidating"
>
Learn more about caching in Next.js
</Card>
</Cards>
```
<Cards>
<Card
href="https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating"
title="Fetching, Caching, and Revalidating"
>
Learn more about caching in Next.js
</Card>
</Cards>
#### Icon
You can specify an icon to cards.
```mdx
import { HomeIcon } from 'lucide-react';
<Cards>
<Card icon={<HomeIcon />} href="/" title="Home">
Go back to home
</Card>
</Cards>
```
<Cards>
<Card icon={<HomeIcon />} href="/" title="Go back to home">
The home page of Fumadocs.
</Card>
</Cards>
#### Without href
```mdx
<Cards>
<Card title="Fetching, Caching, and Revalidating">
Learn more about `fetch` in Next.js.
</Card>
</Cards>
```
<Cards>
<Card title="Fetching, Caching, and Revalidating">
Learn more about `fetch` in Next.js.
</Card>
</Cards>
### Callouts
Useful for adding tips/warnings, it is included by default.
```mdx
<Callout>Hello World</Callout>
```
<Callout>Hello World</Callout>
#### Title
Specify a callout title.
```mdx
<Callout title="Title">Hello World</Callout>
```
<Callout title="Title">Hello World</Callout>
#### Types
You can specify the type of callout.
- `info` (default)
- `warn`
- `error`
```mdx
<Callout title="Title" type="error">
Hello World
</Callout>
```
<Callout title="Title" type="error">
Hello World
</Callout>
### Customise Components
See [all MDX components and available options](/docs/mdx).
## Headings
An anchor is automatically applied to each heading, it sanitizes invalid characters like spaces. (e.g. `Hello World` to `hello-world`)
```md
# Hello `World`
```
### TOC Settings
The table of contents (TOC) will be generated based on headings, you can also customise the effects of headings:
```md
# Heading [!toc]
This heading will be hidden from TOC.
# Another Heading [toc]
This heading will **only** be visible in TOC, you can use it to add additional TOC items.
Like headings rendered in a React component:
<MyComp />
```
### Custom Anchor
You can add `[#slug]` to customise heading anchors.
```md
# heading [#my-heading-id]
```
You can also chain it with TOC settings like:
```md
# heading [toc] [#my-heading-id]
```
To link people to a specific heading, add the heading id to hash fragment: `/page#my-heading-id`.
## Frontmatter
We support YAML frontmatter. It is a way to specify common information of the document (e.g. title).
Place it at the top of document.
```mdx
---
title: Hello World
---
## Title
```
See [Page Conventions](/docs/page-conventions#frontmatter) for a list of properties available for frontmatter.
## Codeblock
Syntax Highlighting is supported by default using [Rehype Code](/docs/headless/mdx/rehype-code).
````mdx
```js
console.log('Hello World');
```
````
You can add a title to the codeblock.
````mdx
```js title="My Title"
console.log('Hello World');
```
````
### Highlight Lines
You can highlight specific lines by adding `[!code highlight]`.
````md
```tsx
<div>Hello World</div> // [\!code highlight]
<div>Hello World</div>
<div>Goodbye</div>
<div>Hello World</div>
```
````
### Highlight Words
You can highlight a specific word by adding `[!code word:<match>]`.
````md
```js
// [\!code word:config]
const config = {
reactStrictMode: true,
};
```
````
### Diffs
````mdx
```ts
console.log('hewwo'); // [\!code --]
console.log('hello'); // [\!code ++]
```
````
```ts
console.log('hewwo'); // [!code --]
console.log('hello'); // [!code ++]
```
### Tab Groups
You can use code blocks with the `<Tab />` component.
````mdx
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tabs items={['Tab 1', 'Tab 2']}>
<Tab value='Tab 1'>
```ts
console.log('A');
```
</Tab>
<Tab value='Tab 2'>
```ts
console.log('B');
```
</Tab>
</Tabs>
````
> Note that you can add MDX components instead of importing them in MDX files.
<Tabs items={['Tab 1', 'Tab 2']}>
<Tab value='Tab 1'>
```ts
console.log('A');
```
</Tab>
<Tab value='Tab 2'>
```ts
console.log('B');
```
</Tab>
</Tabs>
### Using Typescript Twoslash
Write Typescript codeblocks with hover type information and detected types errors.
Not enabled by default. See [Twoslash](/docs/twoslash).
## Images
All built-in content sources handle images properly.
Images are automatically optimized for `next/image`.
```mdx
![Image](/image.png)
```
![Image](/images/blog/post-1.png)
## Optional
Some optional plugins you can enable.
### Math Equations
Write math equations with TeX.
````md
```mdx
f(x) = x * e^{2 pi i \xi x}
```
````
```mdx
f(x) = x * e^{2 pi i \xi x}
```
To enable, see [Math Integration](/docs/math).
### Package Install
Generate code blocks for installing packages via package managers (JS/Node.js).
````md
```mdx
npm i next -D
```
````
```mdx
npm i next -D
```
To enable, see [Remark Install](/docs/headless/mdx/install).
### More
You can see [a list of plugins](/docs/headless/mdx) supported by Fumadocs.

View File

@ -0,0 +1,345 @@
---
title: Markdown
description: 如何撰写文档
image: /images/blog/post-5.png
date: "2025-03-05"
published: true
categories: [news, company]
author: mkdirs
---
## 介绍
Fumadocs 为 MDX一种标记语言提供了许多有用的扩展。以下是 Fumadocs UI 默认 MDX 语法的简要介绍。
> MDX 不是 Fumadocs 唯一支持的格式。实际上,您可以使用任何渲染器,如 `next-mdx-remote` 或 CMS。
## Markdown
我们使用 GFMGitHub 风格的 Markdown这是 MarkdownCommonMark的超集。
参见 [GFM 规范](https://github.github.com/gfm)。
````md
# Heading
## Heading
### Heading
#### Heading
Hello World, **Bold**, _Italic_, ~~Hidden~~
```js
console.log('Hello World');
```
1. First
2. Second
3. Third
- Item 1
- Item 2
> Quote here
![alt](/image.png)
| Table | Description |
| ----- | ----------- |
| Hello | World |
````
### 自动链接
内部链接使用 `next/link` 组件,允许预取并避免硬重载。
外部链接将获得默认的 `rel="noreferrer noopener" target="_blank"` 属性以增强安全性。
```mdx
[My Link](https://github.github.com/gfm)
This also works: https://github.github.com/gfm.
```
## MDX
MDX 是 Markdown 的超集,支持 JSX 语法。
它允许您导入组件,并直接在文档中使用它们,甚至导出值。
```mdx
import { Component } from './component';
<Component name="Hello" />
```
参见 [MDX 语法](https://mdxjs.com/docs/what-is-mdx/#mdx-syntax) 了解更多信息。
### 卡片
对于添加链接很有用,默认包含。
```mdx
<Cards>
<Card
href="https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating"
title="Fetching, Caching, and Revalidating"
>
Learn more about caching in Next.js
</Card>
</Cards>
```
<Cards>
<Card
href="https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating"
title="Fetching, Caching, and Revalidating"
>
Learn more about caching in Next.js
</Card>
</Cards>
#### 图标
您可以为卡片指定图标。
```mdx
import { HomeIcon } from 'lucide-react';
<Cards>
<Card icon={<HomeIcon />} href="/" title="Home">
Go back to home
</Card>
</Cards>
```
<Cards>
<Card icon={<HomeIcon />} href="/" title="Go back to home">
The home page of Fumadocs.
</Card>
</Cards>
#### 无 href
```mdx
<Cards>
<Card title="Fetching, Caching, and Revalidating">
Learn more about `fetch` in Next.js.
</Card>
</Cards>
```
<Cards>
<Card title="Fetching, Caching, and Revalidating">
Learn more about `fetch` in Next.js.
</Card>
</Cards>
### 提示框
对于添加提示/警告很有用,默认包含。
```mdx
<Callout>Hello World</Callout>
```
<Callout>Hello World</Callout>
#### 标题
指定提示框标题。
```mdx
<Callout title="Title">Hello World</Callout>
```
<Callout title="Title">Hello World</Callout>
#### 类型
您可以指定提示框的类型。
- `info`(默认)
- `warn`
- `error`
```mdx
<Callout title="Title" type="error">
Hello World
</Callout>
```
<Callout title="Title" type="error">
Hello World
</Callout>
### 自定义组件
参见[所有 MDX 组件和可用选项](/docs/mdx)。
## 标题
每个标题会自动应用锚点,它会清理空格等无效字符。(例如,`Hello World` 变为 `hello-world`
```md
# Hello `World`
```
### 目录设置
目录 (TOC) 将基于标题生成,您还可以自定义标题的效果:
```md
# Heading [!toc]
This heading will be hidden from TOC.
# Another Heading [toc]
This heading will **only** be visible in TOC, you can use it to add additional TOC items.
Like headings rendered in a React component:
<MyComp />
```
### 自定义锚点
您可以添加 `[#slug]` 来自定义标题锚点。
```md
# heading [#my-heading-id]
```
您也可以将其与目录设置链接起来,例如:
```md
# heading [toc] [#my-heading-id]
```
要将人们链接到特定标题,请将标题 ID 添加到哈希片段:`/page#my-heading-id`。
## 前言
我们支持 YAML 前言。这是一种指定文档常见信息(例如标题)的方式。
将其放在文档顶部。
```mdx
---
title: Hello World
---
## Title
```
有关前言可用属性的列表,请参见[页面约定](/docs/page-conventions#frontmatter)。
## 代码块
默认使用 [Rehype Code](/docs/headless/mdx/rehype-code) 支持语法高亮。
````mdx
```js
console.log('Hello World');
```
````
您可以为代码块添加标题。
````mdx
```js title="My Title"
console.log('Hello World');
```
````
### 高亮行
````md
```tsx
<div>Hello World</div> // [\!code highlight]
<div>Hello World</div>
<div>Goodbye</div>
<div>Hello World</div>
```
````
### 高亮单词
您可以通过添加 `[!code word:<match>]` 来高亮特定单词。
````md
```js
// [\!code word:config]
const config = {
reactStrictMode: true,
};
```
````
### 差异
````mdx
```ts
console.log('hewwo'); // [\!code --]
console.log('hello'); // [\!code ++]
```
````
```ts
console.log('hewwo'); // [!code --]
console.log('hello'); // [!code ++]
```
### 标签组
您可以使用 `<Tab />` 组件与代码块一起使用。
````mdx
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tabs items={['Tab 1', 'Tab 2']}>
<Tab value='Tab 1'>
```ts
console.log('A');
```
</Tab>
<Tab value='Tab 2'>
```ts
console.log('B');
```
</Tab>
</Tabs>
````
> 注意,您可以在 MDX 文件中添加 MDX 组件,而不必导入它们。
<Tabs items={['Tab 1', 'Tab 2']}>
<Tab value='Tab 1'>
```ts
console.log('A');
```
</Tab>
<Tab value='Tab 2'>
```ts
console.log('B');
```
</Tab>
</Tabs>
### 使用 Typescript Twoslash
编写带有悬停类型信息和检测到类型错误的 Typescript 代码块。
默认情况下未启用。参见 [Twoslash](/docs/twoslash)。
## 图片
所有内置内容源都能正确处理图片。
图片会自动为 `next/image` 优化。
```mdx
![Image](/image.png)
```
## 可选功能
一些您可以启用的可选插件。

56
content/blog/premium.mdx Normal file
View File

@ -0,0 +1,56 @@
---
title: "Premium Blog Post"
description: "This blog post is a test for premium content."
date: "2025-08-30"
published: true
premium: true
categories: ["product"]
author: "fox"
image: "/images/blog/post-7.png"
---
This blog post is a test for premium content.
You can read this part of the blog post if you are not a premium user.
But for the rest of the blog post, you need to be logged in as a premium user.
You can click the "Sign In" button to sign in as a user with free plan.
Then you can click the "Upgrade Now" button to upgrade to a premium plan.
<Callout type="warn">
Don't worry, you don't actually pay any cents, because we are in the sandbox environment of Stripe.
</Callout>
You can use the test card number to pay for monthly or yearly PRO plan or LIFETIME plan.
```
Card number: 4242 4242 4242 4242
Exp: 12/34
CVV: 567
```
After that, you can return to the blog post and you can read the rest of the blog post.
For more details, please check out the documentation: [Blog](https://mksaas.com/docs/blog).
Now the rest of the blog post is premium content.
<PremiumContent>
<Callout type="info">
This is the beginning of the premium content part.
</Callout>
This is the premium content part.
You can read this paragraph only if you are a premium user.
Please don't share this blog post with others.
<Callout type="info">
This is the end of the premium content part.
</Callout>
</PremiumContent>

View File

@ -0,0 +1,56 @@
---
title: "测试专用付费文章"
description: "这是一篇测试专用付费文章。"
date: "2025-08-30"
published: true
premium: true
categories: ["product"]
author: "fox"
image: "/images/blog/post-7.png"
---
这是一篇测试专用的付费文章。
如果你不是付费用户,你可以阅读这篇文章的这部分内容。
但如果你想阅读剩下的内容,你需要成为一个付费用户。
你可以点击 "登录" 按钮来以免费用户的身份登录。
然后你可以点击 "立即升级" 按钮来升级到付费计划。
<Callout type="warn">
不用担心,你实际上不需要支付任何费用,因为我们处于 Stripe 的沙盒环境中。
</Callout>
你可以使用测试卡号来支付月度或年度 PRO 计划或终身计划。
```
Card number: 4242 4242 4242 4242
Exp: 12/34
CVV: 567
```
之后,你可以返回这篇博客文章,然后你可以阅读剩下的内容。
更多详情,请参考文档:[博客](https://mksaas.com/docs/blog)。
现在剩下的内容是付费内容。
<PremiumContent>
<Callout type="info">
这是付费内容部分的开始。
</Callout>
这是付费内容部分。
你可以阅读这篇内容,只要你是一个付费用户。
请不要分享这篇文章给其他人。
<Callout type="info">
这是付费内容部分的结束。
</Callout>
</PremiumContent>

280
content/blog/search.mdx Normal file
View File

@ -0,0 +1,280 @@
---
title: Search
description: Implement document search in your docs
image: /images/blog/post-6.png
date: "2025-02-15"
published: true
categories: [company, news]
author: mksaas
---
Fumadocs UI provides a good-looking search UI for your docs, the search functionality is instead provided and documented on Fumadocs Core.
See [Document Search](/docs/headless/search).
## Search UI
Open with <kbd>⌘</kbd> <kbd>K</kbd> or <kbd>Ctrl</kbd> <kbd>K</kbd>.
### Configurations
You can customize search UI from the [Root Provider](/docs/layouts/root-provider) component in root layout.
When not specified, it uses the Default [`fetch` Search Client](/docs/headless/search/orama) powered by Orama.
### Custom Links
Add custom link items to search dialog.
They are shown as fallbacks when the query is empty.
```tsx title="app/layout.tsx"
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
links: [
['Home', '/'],
['Docs', '/docs'],
],
}}
>
{children}
</RootProvider>;
```
### Disable Search
To opt-out of document search, disable it from root provider.
```tsx
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
enabled: false,
}}
>
{children}
</RootProvider>;
```
### Hot Keys
Customise the hot keys to trigger search dialog.
```tsx
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
hotKey: [
{
display: 'K',
key: 'k', // key code, or a function determining whether the key is pressed
},
],
}}
>
{children}
</RootProvider>;
```
### Tag Filter
Add UI to change filters.
Make sure to configure [Tag Filter](/docs/headless/search/orama#tag-filter) on search server first.
```tsx
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
options: {
defaultTag: 'value',
tags: [
{
name: 'Tag Name',
value: 'value',
},
],
},
}}
>
{children}
</RootProvider>;
```
### Search Options
Pass options to the search client, like changing the API endpoint for Orama search server:
```tsx
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
options: {
api: '/api/search/docs',
},
}}
>
{children}
</RootProvider>;
```
### Replace Search Dialog
You can replace the default Search Dialog with:
```tsx title="components/search.tsx"
'use client';
import SearchDialog from 'fumadocs-ui/components/dialog/search-default';
import type { SharedProps } from 'fumadocs-ui/components/dialog/search';
export default function CustomDialog(props: SharedProps) {
// your own logic here
return <SearchDialog {...props} />;
}
```
To pass it to the Root Provider, you need a wrapper with `use client` directive.
```tsx title="provider.tsx"
'use client';
import { RootProvider } from 'fumadocs-ui/provider';
import dynamic from 'next/dynamic';
import type { ReactNode } from 'react';
const SearchDialog = dynamic(() => import('@/components/search')); // lazy load
export function Provider({ children }: { children: ReactNode }) {
return (
<RootProvider
search={{
SearchDialog,
}}
>
{children}
</RootProvider>
);
}
```
Use it instead of your previous Root Provider
```tsx title="layout.tsx"
import { Provider } from './provider';
import type { ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body>
<Provider>{children}</Provider>
</body>
</html>
);
}
```
## Other Solutions
### Algolia
For the setup guide, see [Integrate Algolia Search](/docs/headless/search/algolia).
While generally we recommend building your own search with their client-side
SDK, you can also plug the built-in dialog interface.
```tsx title="components/search.tsx"
'use client';
import algo from 'algoliasearch/lite';
import type { SharedProps } from 'fumadocs-ui/components/dialog/search';
import SearchDialog from 'fumadocs-ui/components/dialog/search-algolia';
const client = algo('appId', 'apiKey');
const index = client.initIndex('indexName');
export default function CustomSearchDialog(props: SharedProps) {
return <SearchDialog index={index} {...props} />;
}
```
1. Replace `appId`, `apiKey` and `indexName` with your desired values.
2. [Replace the default search dialog](#replace-search-dialog) with your new component.
<Callout title="Note" className='mt-4'>
The built-in implementation doesn't use instant search (their official
javascript client).
</Callout>
#### Tag Filter
Same as default search client, you can configure [Tag Filter](/docs/headless/search/algolia#tag-filter) on the dialog.
```tsx title="components/search.tsx"
import SearchDialog from 'fumadocs-ui/components/dialog/search-algolia';
<SearchDialog
defaultTag="value"
tags={[
{
name: 'Tag Name',
value: 'value',
},
]}
/>;
```
### Orama Cloud
For the setup guide, see [Integrate Orama Cloud](/docs/headless/search/orama-cloud).
```tsx title="components/search.tsx"
'use client';
import { OramaClient } from '@oramacloud/client';
import type { SharedProps } from 'fumadocs-ui/components/dialog/search';
import SearchDialog from 'fumadocs-ui/components/dialog/search-orama';
const client = new OramaClient({
endpoint: 'endpoint',
api_key: 'apiKey',
});
export default function CustomSearchDialog(props: SharedProps) {
return <SearchDialog {...props} client={client} showOrama />;
}
```
1. Replace `endpoint`, `apiKey` with your desired values.
2. [Replace the default search dialog](#replace-search-dialog) with your new component.
### Community Integrations
A list of integrations maintained by community.
- [Trieve Search](/docs/headless/search/trieve)
## Built-in UI
If you want to use the built-in search dialog UI instead of building your own,
you may use the `SearchDialog` component.
```tsx
import {
SearchDialog,
type SharedProps,
} from 'fumadocs-ui/components/dialog/search';
export default function CustomSearchDialog(props: SharedProps) {
return <SearchDialog {...props} />;
}
```
<Callout type="warn" title="Unstable">
It is an internal API, might break during iterations
</Callout>

252
content/blog/search.zh.mdx Normal file
View File

@ -0,0 +1,252 @@
---
title: 搜索
description: 在您的文档中实现文档搜索
image: /images/blog/post-6.png
date: "2025-02-15"
published: true
categories: [company, news]
author: mksaas
---
Fumadocs UI 为您的文档提供了一个美观的搜索界面,而搜索功能则由 Fumadocs Core 提供和记录。
参见[文档搜索](/docs/headless/search)。
## 搜索 UI
使用 <kbd>⌘</kbd> <kbd>K</kbd> 或 <kbd>Ctrl</kbd> <kbd>K</kbd> 打开。
### 配置
您可以通过根布局中的 [Root Provider](/docs/layouts/root-provider) 组件自定义搜索 UI。
当未指定时,它使用由 Orama 提供支持的默认 [`fetch` 搜索客户端](/docs/headless/search/orama)。
### 自定义链接
向搜索对话框添加自定义链接项。
当查询为空时,它们会显示为备选项。
```tsx title="app/layout.tsx"
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
links: [
['Home', '/'],
['Docs', '/docs'],
],
}}
>
{children}
</RootProvider>;
```
### 禁用搜索
要禁用文档搜索,请在根提供程序中禁用它。
```tsx
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
enabled: false,
}}
>
{children}
</RootProvider>;
```
### 热键
自定义触发搜索对话框的热键。
```tsx
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
hotKey: [
{
display: 'K',
key: 'k', // key code, or a function determining whether the key is pressed
},
],
}}
>
{children}
</RootProvider>;
```
### 标签过滤器
添加 UI 以更改过滤器。
确保首先在搜索服务器上配置[标签过滤器](/docs/headless/search/orama#tag-filter)。
```tsx
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
options: {
defaultTag: 'value',
tags: [
{
name: 'Tag Name',
value: 'value',
},
],
},
}}
>
{children}
</RootProvider>;
```
### 搜索选项
向搜索客户端传递选项,例如更改 Orama 搜索服务器的 API 端点:
```tsx
import { RootProvider } from 'fumadocs-ui/root-provider';
<RootProvider
search={{
options: {
api: '/api/search/docs',
},
}}
>
{children}
</RootProvider>;
```
### 替换搜索对话框
您可以用以下内容替换默认搜索对话框:
```tsx title="components/search.tsx"
'use client';
import SearchDialog from 'fumadocs-ui/components/dialog/search-default';
import type { SharedProps } from 'fumadocs-ui/components/dialog/search';
export default function CustomDialog(props: SharedProps) {
// your own logic here
return <SearchDialog {...props} />;
}
```
要将其传递给 Root Provider您需要一个带有 `use client` 指令的包装器。
```tsx title="provider.tsx"
'use client';
import { RootProvider } from 'fumadocs-ui/provider';
import dynamic from 'next/dynamic';
import type { ReactNode } from 'react';
const SearchDialog = dynamic(() => import('@/components/search')); // lazy load
export function Provider({ children }: { children: ReactNode }) {
return (
<RootProvider
search={{
SearchDialog,
}}
>
{children}
</RootProvider>
);
}
```
使用它替代您之前的 Root Provider
```tsx title="layout.tsx"
import { Provider } from './provider';
import type { ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body>
<Provider>{children}</Provider>
</body>
</html>
);
}
```
## 其他解决方案
### Algolia
关于设置指南,请参见[集成 Algolia 搜索](/docs/headless/search/algolia)。
虽然我们通常建议使用他们的客户端 SDK 构建您自己的搜索,但您也可以插入内置的对话框接口。
```tsx title="components/search.tsx"
'use client';
import algo from 'algoliasearch/lite';
import type { SharedProps } from 'fumadocs-ui/components/dialog/search';
import SearchDialog from 'fumadocs-ui/components/dialog/search-algolia';
const client = algo('appId', 'apiKey');
const index = client.initIndex('indexName');
export default function CustomSearchDialog(props: SharedProps) {
return <SearchDialog index={index} {...props} />;
}
```
1. 将 `appId`、`apiKey` 和 `indexName` 替换为您想要的值。
2. 用您的新组件[替换默认搜索对话框](#replace-search-dialog)。
<Callout title="注意" className='mt-4'>
内置实现不使用即时搜索(他们的官方 JavaScript 客户端)。
</Callout>
#### 标签过滤器
与默认搜索客户端相同,您可以在对话框上配置[标签过滤器](/docs/headless/search/algolia#tag-filter)。
```tsx title="components/search.tsx"
import SearchDialog from 'fumadocs-ui/components/dialog/search-algolia';
<SearchDialog
defaultTag="value"
tags={[
{
name: 'Tag Name',
value: 'value',
},
]}
/>;
```
### Orama Cloud
关于设置指南,请参见[集成 Orama Cloud](/docs/headless/search/orama-cloud)。
```tsx title="components/search.tsx"
'use client';
import { OramaClient } from '@oramacloud/client';
import type { SharedProps } from 'fumadocs-ui/components/dialog/search';
import SearchDialog from 'fumadocs-ui/components/dialog/search-orama';
const client = new OramaClient({
endpoint: 'endpoint',
api_key: 'apiKey',
});
export default function CustomSearchDialog(props: SharedProps) {
return <SearchDialog {...props} client={client} showOrama />;
}
```
1. 将 `endpoint`、`apiKey` 替换为您想要的值。
2. 用您的新组件[替换默认搜索对话框](#replace-search-dialog)。

171
content/blog/theme.mdx Normal file
View File

@ -0,0 +1,171 @@
---
title: Themes
description: Add Theme to Fumadocs UI
image: /images/blog/post-7.png
date: "2025-01-15"
published: true
categories: [product, news]
author: mkdirs
---
## Usage
Note only Tailwind CSS v4 is supported:
```css title="Tailwind CSS"
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* path of `fumadocs-ui` relative to the CSS file */
@source '../node_modules/fumadocs-ui/dist/**/*.js';
```
### Preflight Changes
By using the Tailwind CSS plugin, or the pre-built stylesheet, your default border, text and background
colors will be changed.
### Light/Dark Modes
Fumadocs supports light/dark modes with [`next-themes`](https://github.com/pacocoursey/next-themes), it is included in Root Provider.
See [Root Provider](/docs/layouts/root-provider#theme-provider) to learn more.
### RTL Layout
RTL (Right-to-left) layout is supported.
To enable RTL, set the `dir` prop to `rtl` in body and root provider (required for Radix UI).
```tsx
import { RootProvider } from 'fumadocs-ui/provider';
import type { ReactNode } from 'react';
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body dir="rtl">
<RootProvider dir="rtl">{children}</RootProvider>
</body>
</html>
);
}
```
### Prefix
Fumadocs UI has its own colors, animations, and utilities.
By default, it adds a `fd-` prefix to avoid conflicts with Shadcn UI or your own CSS variables.
You can use them without the prefix by adding some aliases:
```css title="Tailwind CSS"
@theme {
--color-primary: var(--color-fd-primary);
}
```
> You can use it with CSS media queries for responsive design.
### Layout Width
Customise the max width of docs layout with CSS Variables.
```css
:root {
--fd-layout-width: 1400px;
}
```
{/* <WidthTrigger /> */}
## Tailwind CSS Preset
The Tailwind CSS preset introduces new colors and extra utilities including `fd-steps`.
### Themes
It comes with many themes out-of-the-box, you can pick one you prefer.
```css
@import 'fumadocs-ui/css/<theme>.css';
/* Example */
@import 'fumadocs-ui/css/black.css';
```
<Tabs items={['neutral', 'black', 'vitepress', 'dusk', 'catppuccin', 'ocean', 'purple']}>
<Tab value='neutral'>
![Neutral](/images/docs/themes/neutral.png)
</Tab>
<Tab value='black'>
![Black](/images/docs/themes/black.png)
</Tab>
<Tab value='vitepress'>
![Vitepress](/images/docs/themes/vitepress.png)
</Tab>
<Tab value='dusk'>
![Dusk](/images/docs/themes/dusk.png)
</Tab>
<Tab value='Catppuccin'>
![Catppuccin](/images/docs/themes/catppuccin.png)
</Tab>
<Tab value='ocean'>
![Ocean](/images/docs/themes/ocean.png)
</Tab>
<Tab value='purple'>
![Purple](/images/docs/themes/purple.png)
</Tab>
</Tabs>
### Colors
The design system was inspired by [Shadcn UI](https://ui.shadcn.com), you can easily customize the colors using CSS variables.
```css title="global.css"
:root {
--color-fd-background: hsl(0, 0%, 100%);
}
.dark {
--color-fd-background: hsl(0, 0%, 0%);
}
```
### Typography
We have a built-in plugin forked from [Tailwind CSS Typography](https://tailwindcss.com/docs/typography-plugin).
The plugin adds a `prose` class and variants to customise it.
```tsx
<div className="prose">
<h1>Good Heading</h1>
</div>
```
> The plugin works with and only with Fumadocs UI's MDX components, it may conflict with `@tailwindcss/typography`.
> If you need to use `@tailwindcss/typography` over the default plugin, [set a class name option](https://github.com/tailwindlabs/tailwindcss-typography/blob/main/README.md#changing-the-default-class-name) to avoid conflicts.

170
content/blog/theme.zh.mdx Normal file
View File

@ -0,0 +1,170 @@
---
title: 主题
description: 为 Fumadocs UI 添加主题
image: /images/blog/post-7.png
date: "2025-01-15"
published: true
categories: [product, news]
author: mkdirs
---
## 使用方法
注意只支持 Tailwind CSS v4
```css title="Tailwind CSS"
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* path of `fumadocs-ui` relative to the CSS file */
@source '../node_modules/fumadocs-ui/dist/**/*.js';
```
### 预设更改
通过使用 Tailwind CSS 插件或预构建的样式表,您的默认边框、文本和背景颜色将被更改。
### 明/暗模式
Fumadocs 通过 [`next-themes`](https://github.com/pacocoursey/next-themes) 支持明/暗模式,它包含在 Root Provider 中。
参见 [Root Provider](/docs/layouts/root-provider#theme-provider) 了解更多信息。
### RTL 布局
支持 RTL从右到左布局。
要启用 RTL请在 body 和 root providerRadix UI 需要)中将 `dir` 属性设置为 `rtl`。
```tsx
import { RootProvider } from 'fumadocs-ui/provider';
import type { ReactNode } from 'react';
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body dir="rtl">
<RootProvider dir="rtl">{children}</RootProvider>
</body>
</html>
);
}
```
### 前缀
Fumadocs UI 有自己的颜色、动画和工具。
默认情况下,它添加了 `fd-` 前缀,以避免与 Shadcn UI 或您自己的 CSS 变量冲突。
您可以通过添加一些别名来使用它们,而无需前缀:
```css title="Tailwind CSS"
@theme {
--color-primary: var(--color-fd-primary);
}
```
> 您可以将其与 CSS 媒体查询一起使用,实现响应式设计。
### 布局宽度
使用 CSS 变量自定义文档布局的最大宽度。
```css
:root {
--fd-layout-width: 1400px;
}
```
{/* <WidthTrigger /> */}
## Tailwind CSS 预设
Tailwind CSS 预设引入了新的颜色和额外的工具,包括 `fd-steps`。
### 主题
它开箱即用地提供了许多主题,您可以选择一个您喜欢的。
```css
@import 'fumadocs-ui/css/<theme>.css';
/* Example */
@import 'fumadocs-ui/css/black.css';
```
<Tabs items={['neutral', 'black', 'vitepress', 'dusk', 'catppuccin', 'ocean', 'purple']}>
<Tab value='neutral'>
![Neutral](/images/docs/themes/neutral.png)
</Tab>
<Tab value='black'>
![Black](/images/docs/themes/black.png)
</Tab>
<Tab value='vitepress'>
![Vitepress](/images/docs/themes/vitepress.png)
</Tab>
<Tab value='dusk'>
![Dusk](/images/docs/themes/dusk.png)
</Tab>
<Tab value='Catppuccin'>
![Catppuccin](/images/docs/themes/catppuccin.png)
</Tab>
<Tab value='ocean'>
![Ocean](/images/docs/themes/ocean.png)
</Tab>
<Tab value='purple'>
![Purple](/images/docs/themes/purple.png)
</Tab>
</Tabs>
### 颜色
设计系统的灵感来自 [Shadcn UI](https://ui.shadcn.com),您可以使用 CSS 变量轻松自定义颜色。
```css title="global.css"
:root {
--color-fd-background: hsl(0, 0%, 100%);
}
.dark {
--color-fd-background: hsl(0, 0%, 0%);
}
```
### 排版
我们有一个内置插件,它是从 [Tailwind CSS Typography](https://tailwindcss.com/docs/typography-plugin) 派生而来的。
该插件添加了一个 `prose` 类和变体来自定义它。
```tsx
<div className="prose">
<h1>Good Heading</h1>
</div>
```
> 该插件仅与 Fumadocs UI 的 MDX 组件一起工作,它可能与 `@tailwindcss/typography` 冲突。
> 如果您需要使用 `@tailwindcss/typography` 而不是默认插件,请[设置类名选项](https://github.com/tailwindlabs/tailwindcss-typography/blob/main/README.md#changing-the-default-class-name)以避免冲突。

View File

@ -0,0 +1,62 @@
---
title: What is Fumadocs
description: Introducing Fumadocs, a docs framework that you can break.
image: /images/blog/post-1.png
date: "2025-04-01"
published: true
categories: [company, product]
author: fox
---
Fumadocs was created because I wanted a more customisable experience for building docs, to be a docs framework that is not opinionated, **a "framework" that you can break**.
## Philosophy
**Less Abstraction:** Fumadocs expects you to write code and cooperate with the rest of your software.
While most frameworks are configured with a configuration file, they usually lack flexibility when you hope to tune its details.
You cant control how they render the page nor the internal logic. Fumadocs shows you how the app works, instead of a single configuration file.
**Next.js Fundamentals:** It gives you the utilities and a good-looking UI.
You are still using features of Next.js App Router, like **Static Site Generation**. There is nothing new for Next.js developers, so you can use it with confidence.
**Opinionated on UI:** The only thing Fumadocs UI (the default theme) offers is **User Interface**. The UI is opinionated for bringing better mobile responsiveness and user experience.
Instead, we use a much more flexible approach inspired by Shadcn UI — [Fumadocs CLI](/docs/cli), so we can iterate our design quick, and welcome for more feedback about the UI.
## Why Fumadocs
Fumadocs is designed with flexibility in mind.
You can use `fumadocs-core` as a headless UI library and bring your own styles.
Fumadocs MDX is also a useful library to handle MDX content in Next.js. It also includes:
- Many built-in components.
- Typescript Twoslash, OpenAPI, and Math (KaTeX) integrations.
- Fast and optimized by default, natively built on App Router.
- Tight integration with Next.js, you can add it to an existing Next.js project easily.
You can read [Comparisons](/docs/comparisons) if you're interested.
### Documentation
Fumadocs focuses on **authoring experience**, it provides a beautiful theme and many docs automation tools.
It helps you to iterate your codebase faster while never leaving your docs behind.
You can take this site as an example of docs site built with Fumadocs.
### Blog sites
Since Next.js is already a powerful framework, most features can be implemented with **just Next.js**.
Fumadocs provides additional tooling for Next.js, including syntax highlighting, document search, and a default theme (Fumadocs UI).
It helps you to avoid reinventing the wheels.
## When to use Fumadocs
For most of the web applications, vanilla React.js is no longer enough.
Nowadays, we also wish to have a blog, a showcase page, a FAQ page, etc. With a
fancy UI that's breathtaking, in these cases, Fumadocs can help you build the
docs easier, with less boilerplate.
Fumadocs is maintained by Fuma and many contributors, with care on the maintainability of codebase.
While we don't aim to offer every functionality people wanted, we're more focused on making basic features perfect and well-maintained.
You can also help Fumadocs to be more useful by contributing!

View File

@ -0,0 +1,60 @@
---
title: 什么是 Fumadocs
description: 介绍 Fumadocs一个可以打破常规的文档框架
image: /images/blog/post-1.png
date: "2025-04-01"
published: true
categories: [company, product]
author: fox
---
Fumadocs 的创建是因为我想要一种更加可定制化的文档构建体验,一个不固执己见的文档框架,**一个你可以"打破"的"框架"**。
## 理念
**更少的抽象:** Fumadocs 期望您编写代码并与您的其余软件协作。
虽然大多数框架都是通过配置文件进行配置,但当您希望调整其细节时,它们通常缺乏灵活性。
您无法控制它们如何渲染页面或内部逻辑。Fumadocs 向您展示应用程序如何工作,而不是仅提供单一的配置文件。
**Next.js 基础:** 它为您提供实用工具和美观的 UI。
您仍然使用 Next.js App Router 的功能,如**静态站点生成**。对于 Next.js 开发者来说没有新的东西,所以您可以放心使用。
**对 UI 有自己的看法:** Fumadocs UI默认主题提供的唯一东西是**用户界面**。UI 的设计理念是提供更好的移动响应性和用户体验。
相反,我们使用受 Shadcn UI 启发的更灵活的方法 — [Fumadocs CLI](/docs/cli),这样我们可以快速迭代设计,并欢迎更多关于 UI 的反馈。
## 为什么选择 Fumadocs
Fumadocs 的设计考虑了灵活性。
您可以将 `fumadocs-core` 用作无头 UI 库并带来您自己的样式。
Fumadocs MDX 也是处理 Next.js 中 MDX 内容的有用库。它还包括:
- 许多内置组件。
- Typescript Twoslash、OpenAPI 和 Math (KaTeX) 集成。
- 默认情况下快速且优化,原生构建在 App Router 上。
- 与 Next.js 紧密集成,您可以轻松将其添加到现有的 Next.js 项目中。
如果您感兴趣,可以阅读 [比较](/docs/comparisons)。
### 文档
Fumadocs 专注于**创作体验**,它提供了一个漂亮的主题和许多文档自动化工具。
它帮助您更快地迭代代码库,同时不会落下您的文档。
您可以将此站点作为使用 Fumadocs 构建的文档站点的示例。
### 博客站点
由于 Next.js 已经是一个强大的框架,大多数功能可以**仅使用 Next.js** 实现。
Fumadocs 为 Next.js 提供了额外的工具包括语法高亮、文档搜索和默认主题Fumadocs UI
它帮助您避免重新发明轮子。
## 何时使用 Fumadocs
对于大多数 Web 应用程序,原生 React.js 已经不够用了。
如今我们还希望有一个博客、展示页面、FAQ 页面等。带有令人惊叹的精美 UI在这些情况下Fumadocs 可以帮助您更轻松地构建文档,减少样板代码。
Fumadocs 由 Fuma 和许多贡献者维护,关注代码库的可维护性。
虽然我们不打算提供人们想要的每一项功能,但我们更专注于使基本功能完美且维护良好。
您也可以通过贡献来帮助 Fumadocs 变得更加有用!

View File

@ -1,5 +1,4 @@
---
slug: company
name: Company
description: Company news and updates
---

View File

@ -1,6 +1,4 @@
---
slug: company
name: 公司
description: 公司新闻和更新
locale: zh
---

View File

@ -1,5 +1,4 @@
---
slug: news
name: News
description: News and updates about MkSaaS
---

View File

@ -1,6 +1,4 @@
---
slug: news
name: 新闻
description: 最新新闻和更新
locale: zh
---

View File

@ -1,5 +1,4 @@
---
slug: product
name: Product
description: Products and services powered by MkSaaS
---

View File

@ -1,6 +1,4 @@
---
slug: product
name: 产品
description: 产品和服务
locale: zh
---

View File

@ -1,7 +1,7 @@
---
title: "Initial Release"
description: "Our first official release with core features and functionality"
date: "2024-03-01T00:00:00Z"
date: "2024-03-01"
version: "v1.0.0"
published: true
---
@ -27,4 +27,4 @@ We're excited to announce the initial release of our platform with the following
- Fixed issues with user registration flow
- Resolved authentication token expiration handling
- Improved form validation and error messages
- Improved form validation and error messages

View File

@ -1,7 +1,7 @@
---
title: "初始版本"
description: "我们的第一个正式版本,包含核心功能"
date: "2024-03-01T00:00:00Z"
date: "2024-03-01"
version: "v1.0.0"
published: true
---
@ -27,4 +27,4 @@ published: true
- 修复了用户注册流程中的问题
- 解决了身份验证令牌过期处理
- 改进了表单验证和错误消息
- 改进了表单验证和错误消息

View File

@ -1,7 +1,7 @@
---
title: "Feature Update"
description: "New features and improvements to enhance your experience"
date: "2024-03-15T00:00:00Z"
date: "2024-03-15"
version: "v1.1.0"
published: true
---
@ -27,4 +27,4 @@ We've added several new features to improve your experience:
- Fixed issue with project duplication
- Resolved calendar sync problems
- Fixed data import validation errors
- Improved error handling for API requests
- Improved error handling for API requests

View File

@ -1,7 +1,7 @@
---
title: "功能更新"
description: "新功能和改进,提升您的使用体验"
date: "2024-03-15T00:00:00Z"
date: "2024-03-15"
version: "v1.1.0"
published: true
---
@ -27,4 +27,4 @@ published: true
- 修复了项目复制问题
- 解决了日历同步问题
- 修复了数据导入验证错误
- 改进了API请求的错误处理
- 改进了API请求的错误处理

View File

@ -1,7 +1,7 @@
---
title: "AI Integration"
description: "Introducing AI-powered features to boost productivity"
date: "2024-03-30T00:00:00Z"
date: "2024-03-30"
version: "v1.2.0"
published: true
---
@ -34,4 +34,4 @@ We're thrilled to introduce our new AI capabilities:
- Fixed issues with file uploads on certain browsers
- Resolved synchronization issues between devices
- Improved error handling for third-party integrations
- Fixed accessibility issues in the dashboard
- Fixed accessibility issues in the dashboard

View File

@ -1,7 +1,7 @@
---
title: "AI集成"
description: "引入AI驱动的功能提高生产力"
date: "2024-03-30T00:00:00Z"
date: "2024-03-30"
version: "v1.2.0"
published: true
---
@ -34,4 +34,4 @@ published: true
- 修复了某些浏览器上文件上传的问题
- 解决了设备之间的同步问题
- 改进了第三方集成的错误处理
- 修复了仪表板中的可访问性问题
- 修复了仪表板中的可访问性问题

View File

@ -0,0 +1,74 @@
---
title: Comparisons
description: How is Fumadocs different from other existing frameworks?
icon: GitCompareArrows
---
## Nextra
Fumadocs is highly inspired by Nextra. For example, the Routing Conventions. That is why
`meta.json` also exists in Fumadocs.
Nextra is more opinionated than Fumadocs. Fumadocs is accelerated by App Router. As a result, It provides many server-side functions, and you have to
configure things manually compared to simply editing a configuration file.
Fumadocs works great if you want more control over everything, such as
adding it to an existing codebase or implementing advanced routing.
### Feature Table
| Feature | Fumadocs | Nextra |
| ------------------- | ------------ | ------------------------- |
| Static Generation | Yes | Yes |
| Cached | Yes | Yes |
| Light/Dark Mode | Yes | Yes |
| Syntax Highlighting | Yes | Yes |
| Table of Contents | Yes | Yes |
| Full-text Search | Yes | Yes |
| i18n | Yes | Yes |
| Last Git Edit Time | Yes | Yes |
| Page Icons | Yes | Yes, via `_meta.js` files |
| RSC | Yes | Yes |
| Remote Source | Yes | Yes |
| SEO | Via Metadata | Yes |
| Built-in Components | Yes | Yes |
| RTL Layout | Yes | Yes |
### Additional Features
Features supported via 3rd party libraries like [TypeDoc](https://typedoc.org) will not be listed here.
| Feature | Fumadocs | Nextra |
| -------------------------- | -------- | ------ |
| OpenAPI Integration | Yes | No |
| TypeScript Docs Generation | Yes | No |
| TypeScript Twoslash | Yes | Yes |
## Mintlify
Mintlify is a documentation service, as compared to Fumadocs, it offers a free tier but isn't completely free and open source.
Fumadocs is not as powerful as Mintlify, for example, the OpenAPI integration of Mintlify.
As the creator of Fumadocs, I wouldn't recommend switching to Fumadocs from Mintlify if you're satisfied with the current way you build docs.
However, I believe Fumadocs is a suitable tool for all Next.js developers who want to have elegant docs.
## Docusaurus
Docusaurus is a powerful framework based on React.js. It offers many cool
features with plugins and custom themes.
### Better DX
Since Fumadocs is built on the top of Next.js, you'll have to start the Next.js dev
server every time to review changes, and initial boilerplate code is relatively more
compared to Docusaurus.
For a simple docs, Docusaurus might be a better choice if you don't need any Next.js specific functionality.
However, when you want to use Next.js, or seek extra customizability like tuning default UI components, Fumadocs could be a better choice.
### Plugins
You can easily achieve many things with plugins, their ecosystem is indeed larger and maintained by many contributors.
In comparison, the flexibility of Fumadocs allows you to implement them on your own, it may take longer to tune it to your satisfaction.

View File

@ -0,0 +1,68 @@
---
title: 对比
description: Fumadocs 与其他现有框架有何不同?
icon: GitCompareArrows
---
## Nextra
Fumadocs 深受 Nextra 启发。例如,路由约定。这就是为什么 Fumadocs 中也存在 `meta.json`。
Nextra 比 Fumadocs 更加固执己见。Fumadocs 由 App Router 加速。因此,它提供了许多服务器端功能,与简单编辑配置文件相比,您必须手动配置一些内容。
如果您想要对一切都有更多的控制比如将其添加到现有代码库或实现高级路由Fumadocs 会表现得很出色。
### 功能表
| 功能 | Fumadocs | Nextra |
| ------------------- | ------------ | ------------------------- |
| 静态生成 | 是 | 是 |
| 缓存 | 是 | 是 |
| 明/暗模式 | 是 | 是 |
| 语法高亮 | 是 | 是 |
| 目录 | 是 | 是 |
| 全文搜索 | 是 | 是 |
| 国际化 | 是 | 是 |
| 最后 Git 编辑时间 | 是 | 是 |
| 页面图标 | 是 | 是,通过 `_meta.js` 文件 |
| RSC | 是 | 是 |
| 远程源 | 是 | 是 |
| SEO | 通过元数据 | 是 |
| 内置组件 | 是 | 是 |
| RTL 布局 | 是 | 是 |
### 附加功能
通过第三方库支持的功能(如 [TypeDoc](https://typedoc.org))不会在此列出。
| 功能 | Fumadocs | Nextra |
| -------------------------- | -------- | ------ |
| OpenAPI 集成 | 是 | 否 |
| TypeScript 文档生成 | 是 | 否 |
| TypeScript Twoslash | 是 | 是 |
## Mintlify
Mintlify 是一项文档服务,与 Fumadocs 相比,它提供免费套餐,但并非完全免费和开源。
Fumadocs 不如 Mintlify 强大,例如 Mintlify 的 OpenAPI 集成。
作为 Fumadocs 的创建者,如果您对当前构建文档的方式感到满意,我不建议从 Mintlify 切换到 Fumadocs。
然而,我相信 Fumadocs 是所有想要拥有优雅文档的 Next.js 开发者的合适工具。
## Docusaurus
Docusaurus 是一个基于 React.js 的强大框架。它通过插件和自定义主题提供了许多酷炫的功能。
### 更好的开发者体验
由于 Fumadocs 构建在 Next.js 之上,您每次都必须启动 Next.js 开发服务器来查看更改,并且相对于 Docusaurus初始样板代码较多。
对于简单的文档,如果您不需要任何特定于 Next.js 的功能Docusaurus 可能是更好的选择。
然而,当您想要使用 Next.js或寻求更多的可定制性如调整默认 UI 组件时Fumadocs 可能是更好的选择。
### 插件
您可以通过插件轻松实现许多功能,他们的生态系统确实更大,并由许多贡献者维护。
相比之下Fumadocs 的灵活性允许您自己实现它们,可能需要更长的时间来调整它以达到您的满意度。

View File

@ -0,0 +1,43 @@
---
title: Accordion
description: Add Accordions to your documentation
preview: accordion
---
## Usage
Based on
[Radix UI Accordion](https://www.radix-ui.com/primitives/docs/components/accordion), useful for FAQ sections.
```tsx
import React from 'react';
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
<Accordions type="single">
<Accordion title="My Title">My Content</Accordion>
</Accordions>;
```
### Accordions
{/* <AutoTypeTable path="./content/docs/props.ts" name="AccordionsProps" /> */}
### Accordion
{/* <AutoTypeTable path="./content/docs/props.ts" name="AccordionProps" /> */}
### Linking to Accordion
You can specify an `id` for accordion. The accordion will automatically open when the user is navigating to the page with the specified `id` in hash parameter.
```mdx
<Accordions>
<Accordion title="My Title" id="my-title">
My Content
</Accordion>
</Accordions>
```
> The value of accordion is same as title by default. When an id presents, it will be used as the value instead.

View File

@ -0,0 +1,42 @@
---
title: 手风琴
description: 在文档中添加手风琴组件
preview: accordion
---
## 使用方法
基于 [Radix UI Accordion](https://www.radix-ui.com/primitives/docs/components/accordion),对 FAQ 部分特别有用。
```tsx
import React from 'react';
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
<Accordions type="single">
<Accordion title="我的标题">我的内容</Accordion>
</Accordions>;
```
### Accordions
{/* <AutoTypeTable path="./content/docs/props.ts" name="AccordionsProps" /> */}
### Accordion
{/* <AutoTypeTable path="./content/docs/props.ts" name="AccordionProps" /> */}
### 链接到手风琴
您可以为手风琴指定一个 `id`。当用户导航到带有指定 `id` 的哈希参数的页面时,手风琴将自动打开。
```mdx
<Accordions>
<Accordion title="我的标题" id="my-title">
我的内容
</Accordion>
</Accordions>
```
> 手风琴的值默认与标题相同。当存在 id 时,它将被用作值。

View File

@ -0,0 +1,61 @@
---
title: Banner
description: Add a banner to your site
preview: banner
---
## Usage
Put the element at the top of your root layout, you can use it for displaying announcements.
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}): React.ReactElement {
return (
<html lang="en">
<body>
<Banner>Hello World</Banner>
{children}
</body>
</html>
);
}
```
### Variant
Change the default variant.
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner variant="rainbow">Hello World</Banner>;
```
### Change Layout
By default, the banner uses a `style` tag to modify Fumadocs layouts (e.g. reduce the sidebar height).
You can disable it with:
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner changeLayout={false}>Hello World</Banner>;
```
### Close
To allow users to close the banner, give the banner an ID.
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner id="hello-world">Hello World</Banner>;
```
The state will be automatically persisted.

View File

@ -0,0 +1,61 @@
---
title: 横幅
description: 在您的网站添加横幅
preview: banner
---
## 使用方法
将元素放在根布局的顶部,您可以用它来显示公告。
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}): React.ReactElement {
return (
<html lang="en">
<body>
<Banner>Hello World</Banner>
{children}
</body>
</html>
);
}
```
### 变体
更改默认变体。
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner variant="rainbow">Hello World</Banner>;
```
### 更改布局
默认情况下,横幅使用 `style` 标签来修改 Fumadocs 布局(例如减少侧边栏高度)。
您可以通过以下方式禁用它:
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner changeLayout={false}>Hello World</Banner>;
```
### 关闭
要允许用户关闭横幅,请给横幅一个 ID。
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner id="hello-world">Hello World</Banner>;
```
状态将自动保持。

View File

@ -0,0 +1,38 @@
---
title: Code Block (Dynamic)
description: A codeblock that also highlights code
preview: dynamicCodeBlock
---
## Usage
```tsx
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
<DynamicCodeBlock lang="ts" code='console.log("Hello World")' />;
```
This component, different from the MDX [`CodeBlock`](/docs/mdx/codeblock) component, can be used without MDX.
It highlights the code with Shiki and use the default component to render it.
Features:
- Can be pre-rendered on server
- load languages and themes on browser lazily
### Options
```tsx
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
<DynamicCodeBlock
lang="ts"
code='console.log("Hello World")'
options={{
components: {
// add/override components
},
// or Shiki options
}}
/>;
```

View File

@ -0,0 +1,38 @@
---
title: 代码块(动态)
description: 也能高亮代码的代码块
preview: dynamicCodeBlock
---
## 使用方法
```tsx
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
<DynamicCodeBlock lang="ts" code='console.log("Hello World")' />;
```
这个组件与 MDX [`CodeBlock`](/docs/mdx/codeblock) 组件不同,可以在不使用 MDX 的情况下使用。
它使用 Shiki 高亮代码,并使用默认组件渲染它。
特点:
- 可以在服务器上预渲染
- 在浏览器上懒加载语言和主题
### 选项
```tsx
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
<DynamicCodeBlock
lang="ts"
code='console.log("Hello World")'
options={{
components: {
// 添加/覆盖组件
},
// 或 Shiki 选项
}}
/>;
```

View File

@ -0,0 +1,35 @@
---
title: Files
description: Display file structure in your documentation
preview: 'files'
---
## Usage
Wrap file components in `Files`.
```mdx
import { File, Folder, Files } from 'fumadocs-ui/components/files';
<Files>
<Folder name="app" defaultOpen>
<File name="layout.tsx" />
<File name="page.tsx" />
<File name="global.css" />
</Folder>
<Folder name="components">
<File name="button.tsx" />
<File name="tabs.tsx" />
<File name="dialog.tsx" />
</Folder>
<File name="package.json" />
</Files>
```
### File
{/* <AutoTypeTable path="./content/docs/props.ts" name="FileProps" /> */}
### Folder
{/* <AutoTypeTable path="./content/docs/props.ts" name="FolderProps" /> */}

View File

@ -0,0 +1,35 @@
---
title: 文件
description: 在文档中显示文件结构
preview: 'files'
---
## 使用方法
将文件组件包装在 `Files` 中。
```mdx
import { File, Folder, Files } from 'fumadocs-ui/components/files';
<Files>
<Folder name="app" defaultOpen>
<File name="layout.tsx" />
<File name="page.tsx" />
<File name="global.css" />
</Folder>
<Folder name="components">
<File name="button.tsx" />
<File name="tabs.tsx" />
<File name="dialog.tsx" />
</Folder>
<File name="package.json" />
</Files>
```
### File
{/* <AutoTypeTable path="./content/docs/props.ts" name="FileProps" /> */}
### Folder
{/* <AutoTypeTable path="./content/docs/props.ts" name="FolderProps" /> */}

View File

@ -0,0 +1,45 @@
---
title: GitHub Info
description: Display your GitHub repository information
preview: githubInfo
---
## Usage
```tsx
import { GithubInfo } from 'fumadocs-ui/components/github-info';
<GithubInfo
owner="fuma-nama"
repo="fumadocs"
// your own GitHub access token (optional)
token={process.env.GITHUB_TOKEN}
/>;
```
It's recommended to add it to your docs layout with `links` option:
```tsx title="app/docs/layout.tsx"
import { DocsLayout, type DocsLayoutProps } from 'fumadocs-ui/layouts/notebook';
import type { ReactNode } from 'react';
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import { GithubInfo } from 'fumadocs-ui/components/github-info';
const docsOptions: DocsLayoutProps = {
...baseOptions,
tree: source.pageTree,
links: [
{
type: 'custom',
children: (
<GithubInfo owner="fuma-nama" repo="fumadocs" className="lg:-mx-2" />
),
},
],
};
export default function Layout({ children }: { children: ReactNode }) {
return <DocsLayout {...docsOptions}>{children}</DocsLayout>;
}
```

View File

@ -0,0 +1,45 @@
---
title: GitHub 信息
description: 显示您的 GitHub 仓库信息
preview: githubInfo
---
## 使用方法
```tsx
import { GithubInfo } from 'fumadocs-ui/components/github-info';
<GithubInfo
owner="fuma-nama"
repo="fumadocs"
// 您自己的 GitHub 访问令牌(可选)
token={process.env.GITHUB_TOKEN}
/>;
```
建议将其添加到您的文档布局中,使用 `links` 选项:
```tsx title="app/docs/layout.tsx"
import { DocsLayout, type DocsLayoutProps } from 'fumadocs-ui/layouts/notebook';
import type { ReactNode } from 'react';
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import { GithubInfo } from 'fumadocs-ui/components/github-info';
const docsOptions: DocsLayoutProps = {
...baseOptions,
tree: source.pageTree,
links: [
{
type: 'custom',
children: (
<GithubInfo owner="fuma-nama" repo="fumadocs" className="lg:-mx-2" />
),
},
],
};
export default function Layout({ children }: { children: ReactNode }) {
return <DocsLayout {...docsOptions}>{children}</DocsLayout>;
}
```

View File

@ -0,0 +1,34 @@
---
title: Zoomable Image
description: Allow zoom-in images in your documentation
preview: zoomImage
---
## Usage
Replace `img` with `ImageZoom` in your MDX components.
```tsx title="app/docs/[[...slug]]/page.tsx"
import { ImageZoom } from 'fumadocs-ui/components/image-zoom';
import defaultMdxComponents from 'fumadocs-ui/mdx';
return (
<MdxContent
components={{
...defaultMdxComponents,
img: (props) => <ImageZoom {...(props as any)} />,
// other Mdx components
}}
/>
);
```
Now image zoom will be automatically enabled on all images.
```mdx
![Test](/banner.png)
```
### Image Optimization
A default [`sizes` property](https://nextjs.org/docs/app/api-reference/components/image#sizes) will be defined for Next.js `<Image />` component if not specified.

View File

@ -0,0 +1,34 @@
---
title: 可缩放图片
description: 在文档中允许放大图片
preview: zoomImage
---
## 使用方法
在 MDX 组件中用 `ImageZoom` 替换 `img`。
```tsx title="app/docs/[[...slug]]/page.tsx"
import { ImageZoom } from 'fumadocs-ui/components/image-zoom';
import defaultMdxComponents from 'fumadocs-ui/mdx';
return (
<MdxContent
components={{
...defaultMdxComponents,
img: (props) => <ImageZoom {...(props as any)} />,
// 其他 Mdx 组件
}}
/>
);
```
现在,所有图片都将自动启用图片缩放功能。
```mdx
![Test](/banner.png)
```
### 图片优化
如果未指定,将为 Next.js `<Image />` 组件定义默认的 [`sizes` 属性](https://nextjs.org/docs/app/api-reference/components/image#sizes)。

View File

@ -0,0 +1,5 @@
---
title: Components
description: Additional components to improve your docs
index: true
---

View File

@ -0,0 +1,5 @@
---
title: 组件
description: 改进文档的额外组件
index: true
---

View File

@ -0,0 +1,31 @@
---
title: Inline TOC
description: Add Inline TOC into your documentation
preview: inlineTOC
---
## Usage
Pass TOC items to the component.
```mdx
import { InlineTOC } from 'fumadocs-ui/components/inline-toc';
<InlineTOC items={toc} />
```
### Use in Pages
You can add inline TOC into every page.
```tsx
<DocsPage>
...
<InlineTOC items={toc} />
...
</DocsPage>
```
## Reference
{/* <AutoTypeTable path="./content/docs/props.ts" name="InlineTOCProps" /> */}

View File

@ -0,0 +1,31 @@
---
title: 内联目录
description: 在文档中添加内联目录
preview: inlineTOC
---
## 使用方法
将 TOC 项目传递给组件。
```mdx
import { InlineTOC } from 'fumadocs-ui/components/inline-toc';
<InlineTOC items={toc} />
```
### 在页面中使用
您可以在每个页面中添加内联目录。
```tsx
<DocsPage>
...
<InlineTOC items={toc} />
...
</DocsPage>
```
## 参考
{/* <AutoTypeTable path="./content/docs/props.ts" name="InlineTOCProps" /> */}

View File

@ -0,0 +1,35 @@
---
title: Root Toggle
description: Switch between page trees
preview: rootToggle
---
## Usages
Add this component to your sidebar or other places you want.
```tsx
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { RootToggle } from 'fumadocs-ui/components/layout/root-toggle';
<DocsLayout
sidebar={{
banner: (
<RootToggle
options={[
{
title: 'Folder 1',
description: 'Pages in folder 1',
url: '/path/to/page-tree-1',
},
{
title: 'Folder 2',
description: 'Pages in folder 2',
url: '/path/to/page-tree-2',
},
]}
/>
),
}}
/>;
```

View File

@ -0,0 +1,35 @@
---
title: 根切换器
description: 在页面树之间切换
preview: rootToggle
---
## 使用方法
将此组件添加到您的侧边栏或您想要的其他地方。
```tsx
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { RootToggle } from 'fumadocs-ui/components/layout/root-toggle';
<DocsLayout
sidebar={{
banner: (
<RootToggle
options={[
{
title: '文件夹 1',
description: '文件夹 1 中的页面',
url: '/path/to/page-tree-1',
},
{
title: '文件夹 2',
description: '文件夹 2 中的页面',
url: '/path/to/page-tree-2',
},
]}
/>
),
}}
/>;
```

View File

@ -0,0 +1,57 @@
---
title: Steps
description: Adding steps to your docs
preview: steps
---
## Usage
Put your steps into the `Steps` container.
```mdx
import { Step, Steps } from 'fumadocs-ui/components/steps';
<Steps>
<Step>
### Hello World
</Step>
<Step>
### Hello World
</Step>
</Steps>
```
> We recommend using Tailwind CSS utility classes directly on Tailwind CSS projects.
### Without imports
You can use the Tailwind CSS utilities without importing it.
```mdx
<div className="fd-steps">
<div className="fd-step" />
</div>
```
It supports adding step styles to only headings with arbitrary variants.
```mdx
<div className='fd-steps [&_h3]:fd-step'>
### Hello World
</div>
```
<div className='fd-steps [&_h3]:fd-step'>
### Hello World
You no longer need to use the step component anymore.
</div>

View File

@ -0,0 +1,57 @@
---
title: 步骤
description: 在文档中添加步骤
preview: steps
---
## 使用方法
将您的步骤放入 `Steps` 容器中。
```mdx
import { Step, Steps } from 'fumadocs-ui/components/steps';
<Steps>
<Step>
### 你好世界
</Step>
<Step>
### 你好世界
</Step>
</Steps>
```
> 我们建议在 Tailwind CSS 项目中直接使用 Tailwind CSS 实用类。
### 不使用导入
您可以在不导入的情况下使用 Tailwind CSS 实用工具。
```mdx
<div className="fd-steps">
<div className="fd-step" />
</div>
```
它支持仅对带有任意变体的标题添加步骤样式。
```mdx
<div className='fd-steps [&_h3]:fd-step'>
### 你好世界
</div>
```
<div className='fd-steps [&_h3]:fd-step'>
### 你好世界
您不再需要使用步骤组件了。
</div>

View File

@ -0,0 +1,146 @@
---
title: Tabs
description:
A Tabs component built with Radix UI, with additional features such as
persistent and shared value.
preview: tabs
---
## Usage
Import it in your MDX documents.
```mdx
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tabs items={['Javascript', 'Rust']}>
<Tab value="Javascript">Javascript is weird</Tab>
<Tab value="Rust">Rust is fast</Tab>
</Tabs>
```
### Without `value`
Without a `value`, it detects from the children index. Note that it might cause errors on re-renders, it's not encouraged if the tabs might change.
```mdx
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tabs items={['Javascript', 'Rust']}>
<Tab>Javascript is weird</Tab>
<Tab>Rust is fast</Tab>
</Tabs>
```
#### Demo with Re-renders
<Tabs items={['Javascript', 'Rust']}>
<Tab>Javascript is weird</Tab>
<Tab>Rust is fast</Tab>
</Tabs>
{/* <WithoutValueTest /> */}
### Shared Value
By passing an `groupId` property, you can share a value across all tabs with the same
id.
```mdx
<Tabs groupId="language" items={['Javascript', 'Rust']}>
<Tab value="Javascript">Javascript is weird</Tab>
<Tab value="Rust">Rust is fast</Tab>
</Tabs>
```
### Persistent
You can enable persistent by passing a `persist` property. The value will be
stored in `localStorage`, with its id as the key.
```mdx
<Tabs groupId="language" items={['Javascript', 'Rust']} persist>
<Tab value="Javascript">Javascript is weird</Tab>
<Tab value="Rust">Rust is fast</Tab>
</Tabs>
```
> Persistent only works if you have passed an `id`.
### Default Value
Set a default value by passing `defaultIndex`.
```mdx
<Tabs items={['Javascript', 'Rust']} defaultIndex={1}>
<Tab value="Javascript">Javascript is weird</Tab>
<Tab value="Rust">Rust is fast</Tab>
</Tabs>
```
### Link to Tab
Use HTML `id` attribute to link to a specific tab.
```mdx
<Tabs items={['Javascript', 'Rust', 'C++']}>
<Tab value="Javascript">Javascript is weird</Tab>
<Tab value="Rust">Rust is fast</Tab>
<Tab id="tab-cpp" value="C++">
`Hello World`
</Tab>
</Tabs>
```
You can add the hash `#tab-cpp` to your URL and reload, the C++ tab will be activated.
<Tabs items={['Javascript', 'Rust', 'C++']}>
<Tab value="Javascript">Javascript is weird</Tab>
<Tab value="Rust">Rust is fast</Tab>
<Tab id="tab-cpp" value="C++">
`Hello World`
</Tab>
</Tabs>
Additionally, the `updateAnchor` property can be set to `true` in the `Tabs` component
to automatically update the URL hash whenever time a new tab is selected:
```mdx
<Tabs items={['Javascript', 'Rust', 'C++']} updateAnchor>
<Tab id="tab-js" value="Javascript">
Javascript is weird
</Tab>
<Tab id="tab-rs" value="Rust">
Rust is fast
</Tab>
<Tab id="tab-cpp" value="C++">
`Hello World`
</Tab>
</Tabs>
```
{/* <UrlBar /> */}
<Tabs items={['Hello', 'World']} updateAnchor>
<Tab id="tab-hello" value="Hello">
Hello!
</Tab>
<Tab id="tab-world" value="World">
World!
</Tab>
</Tabs>
### Advanced
You can use the styled Radix UI primitive directly from exported `Primitive`.
```mdx
import { Primitive } from 'fumadocs-ui/components/tabs';
<Primitive.Tabs>
<Primitive.TabsList>
<Primitive.TabsTrigger />
</Primitive.TabsList>
<Primitive.TabsContent />
</Primitive.Tabs>
```

View File

@ -0,0 +1,114 @@
---
title: 选项卡
description:
使用 Radix UI 构建的选项卡组件,具有持久性和共享值等附加功能。
preview: tabs
---
## 使用方法
在 MDX 文档中导入它。
```mdx
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tabs items={['Javascript', 'Rust']}>
<Tab value="Javascript">Javascript 很奇怪</Tab>
<Tab value="Rust">Rust 很快</Tab>
</Tabs>
```
### 不使用 `value`
如果没有 `value`,它会从子元素索引中检测。请注意,这可能会在重新渲染时导致错误,如果选项卡可能会改变,不建议这样做。
```mdx
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tabs items={['Javascript', 'Rust']}>
<Tab>Javascript 很奇怪</Tab>
<Tab>Rust 很快</Tab>
</Tabs>
```
### 共享值
通过传递 `groupId` 属性,您可以在具有相同 ID 的所有选项卡之间共享值。
```mdx
<Tabs groupId="language" items={['Javascript', 'Rust']}>
<Tab value="Javascript">Javascript 很奇怪</Tab>
<Tab value="Rust">Rust 很快</Tab>
</Tabs>
```
### 持久性
您可以通过传递 `persist` 属性启用持久性。该值将存储在 `localStorage` 中,以其 ID 作为键。
```mdx
<Tabs groupId="language" items={['Javascript', 'Rust']} persist>
<Tab value="Javascript">Javascript 很奇怪</Tab>
<Tab value="Rust">Rust 很快</Tab>
</Tabs>
```
> 持久性仅在您传递了 `id` 时有效。
### 默认值
通过传递 `defaultIndex` 设置默认值。
```mdx
<Tabs items={['Javascript', 'Rust']} defaultIndex={1}>
<Tab value="Javascript">Javascript 很奇怪</Tab>
<Tab value="Rust">Rust 很快</Tab>
</Tabs>
```
### 链接到选项卡
使用 HTML `id` 属性链接到特定选项卡。
```mdx
<Tabs items={['Javascript', 'Rust', 'C++']}>
<Tab value="Javascript">Javascript 很奇怪</Tab>
<Tab value="Rust">Rust 很快</Tab>
<Tab id="tab-cpp" value="C++">
`Hello World`
</Tab>
</Tabs>
```
您可以在 URL 中添加哈希 `#tab-cpp` 并重新加载C++ 选项卡将被激活。
此外,可以在 `Tabs` 组件中将 `updateAnchor` 属性设置为 `true`,以便在每次选择新选项卡时自动更新 URL 哈希:
```mdx
<Tabs items={['Javascript', 'Rust', 'C++']} updateAnchor>
<Tab id="tab-js" value="Javascript">
Javascript 很奇怪
</Tab>
<Tab id="tab-rs" value="Rust">
Rust 很快
</Tab>
<Tab id="tab-cpp" value="C++">
`Hello World`
</Tab>
</Tabs>
```
### 高级用法
您可以直接从导出的 `Primitive` 中使用样式化的 Radix UI 原语。
```mdx
import { Primitive } from 'fumadocs-ui/components/tabs';
<Primitive.Tabs>
<Primitive.TabsList>
<Primitive.TabsTrigger />
</Primitive.TabsList>
<Primitive.TabsContent />
</Primitive.Tabs>
```

View File

@ -0,0 +1,34 @@
---
title: Type Table
description: A table for documenting types
preview: typeTable
---
## Usage
It accepts a `type` property.
```mdx
import { TypeTable } from 'fumadocs-ui/components/type-table';
<TypeTable
type={{
percentage: {
description:
'The percentage of scroll position to display the roll button',
type: 'number',
default: 0.2,
},
}}
/>
```
## References
### Type Table
{/* <AutoTypeTable path="./content/docs/props.ts" name="TypeTableProps" /> */}
### Object Type
{/* <AutoTypeTable path="./content/docs/props.ts" name="ObjectTypeProps" /> */}

View File

@ -0,0 +1,34 @@
---
title: 类型表格
description: 用于记录类型的表格
preview: typeTable
---
## 使用方法
它接受一个 `type` 属性。
```mdx
import { TypeTable } from 'fumadocs-ui/components/type-table';
<TypeTable
type={{
percentage: {
description:
'显示滚动按钮的滚动位置百分比',
type: 'number',
default: 0.2,
},
}}
/>
```
## 参考
### Type Table
{/* <AutoTypeTable path="./content/docs/props.ts" name="TypeTableProps" /> */}
### Object Type
{/* <AutoTypeTable path="./content/docs/props.ts" name="ObjectTypeProps" /> */}

View File

@ -0,0 +1,51 @@
---
title: Overview
description: An overview of Fumadocs UI
---
## Architecture
### Page Tree
Navigation elements like sidebar take a [Page Tree](/docs/headless/page-tree) to render navigation links, it's a tree that describes all available pages and folders.
Normally, it is generated from your file structure using [`loader()`](/docs/headless/source-api), you can learn [how to organize pages](/docs/page-conventions).
## Customisation
### Layouts
You can use the exposed options of different layouts:
<Cards>
<Card title="Docs Layout" href="/docs/layouts/docs">
Layout for docs
</Card>
<Card title="Docs Page" href="/docs/layouts/page">
Layout for docs content
</Card>
<Card title="Notebook Layout" href="/docs/layouts/notebook">
A more compact version of Docs Layout
</Card>
<Card title="Home Layout" href="/docs/layouts/home-layout">
Layout for other pages
</Card>
</Cards>
### Components
Fumadocs UI also offers styled components for interactive examples to enhance your docs, you can customise them with exposed props like `style` and `className`.
See [Components](/docs/components).
### Design System
Since the design system is built on Tailwind CSS, you can customise it [with CSS Variables](/docs/theme#colors).
### CLI
If none of them suits you, Fumadocs CLI is a tool to install Fumadocs UI components and layouts to your codebase, similar to Shadcn UI. Allowing you to fully customise Fumadocs UI:
```mdx
npx fumadocs add
```

View File

@ -0,0 +1,51 @@
---
title: 概览
description: Fumadocs UI 的概览
---
## 架构
### 页面树
侧边栏等导航元素使用[页面树](/docs/headless/page-tree)来渲染导航链接,它是描述所有可用页面和文件夹的树形结构。
通常,它是使用 [`loader()`](/docs/headless/source-api) 从您的文件结构生成的,您可以了解[如何组织页面](/docs/page-conventions)。
## 自定义
### 布局
您可以使用不同布局的暴露选项:
<Cards>
<Card title="文档布局" href="/docs/layouts/docs">
文档的布局
</Card>
<Card title="文档页面" href="/docs/layouts/page">
文档内容的布局
</Card>
<Card title="笔记本布局" href="/docs/layouts/notebook">
文档布局的更紧凑版本
</Card>
<Card title="主页布局" href="/docs/layouts/home-layout">
其他页面的布局
</Card>
</Cards>
### 组件
Fumadocs UI 还提供了样式化组件,用于交互式示例以增强您的文档,您可以使用暴露的道具如 `style` 和 `className` 来自定义它们。
参见[组件](/docs/components)。
### 设计系统
由于设计系统是基于 Tailwind CSS 构建的,您可以[通过 CSS 变量](/docs/theme#colors)自定义它。
### CLI
如果这些都不适合您Fumadocs CLI 是一个工具,可以将 Fumadocs UI 组件和布局安装到您的代码库中,类似于 Shadcn UI。允许您完全自定义 Fumadocs UI
```mdx
npx fumadocs add
```

278
content/docs/index.mdx Normal file
View File

@ -0,0 +1,278 @@
---
title: Quick Start
description: Getting Started with Fumadocs
icon: Album
---
## Introduction
Fumadocs <span className='text-fd-muted-foreground text-sm'>(Foo-ma docs)</span> is a **documentation framework** based on Next.js, designed to be fast, flexible,
and composes seamlessly into Next.js App Router.
Fumadocs has different parts:
<Cards>
<Card icon={<CpuIcon className="text-purple-300" />} title='Fumadocs Core'>
Handles most of the logic, including document search, content source adapters, and Markdown extensions.
</Card>
<Card icon={<PanelsTopLeft className="text-blue-300" />} title='Fumadocs UI'>
The default theme of Fumadocs offers a beautiful look for documentation sites and interactive components.
</Card>
<Card icon={<Database />} title='Content Source'>
The source of your content, can be a CMS or local data layers like [Content Collections](https://www.content-collections.dev) and [Fumadocs MDX](/docs/mdx), the official content source.
</Card>
<Card icon={<Terminal />} title='Fumadocs CLI'>
A command line tool to install UI components and automate things, useful for customizing layouts.
</Card>
</Cards>
<Callout title="Want to learn more?">
Read our in-depth [What is Fumadocs](/docs/what-is-fumadocs) introduction.
</Callout>
### Terminology
**Markdown/MDX:** Markdown is a markup language for creating formatted text. Fumadocs supports Markdown and MDX (superset of Markdown) out-of-the-box.
Although not required, some basic knowledge of Next.js App Router would be useful for further customisations.
## Automatic Installation
A minimum version of Node.js 18 required, note that Node.js 23.1 might have problems with Next.js production build.
<Tabs groupId='package-manager' persist items={['npm', 'pnpm', 'yarn', 'bun']}>
```bash tab="npm"
npm create fumadocs-app
```
```bash tab="pnpm"
pnpm create fumadocs-app
```
```bash tab="yarn"
yarn create fumadocs-app
```
```bash tab="bun"
bun create fumadocs-app
```
</Tabs>
It will ask you the framework and content source to use, a new fumadocs app should be initialized. Now you can start hacking!
<Callout title='From Existing Codebase?'>
You can follow the [Manual Installation](/docs/manual-installation) guide to get started.
</Callout>
### Enjoy!
Create your first MDX file in the docs folder.
```mdx title="content/docs/index.mdx"
---
title: Hello World
---
## Yo what's up
```
Run the app in development mode and see http://localhost:3000/docs.
```mdx
npm run dev
```
## Explore
In the project, you can see:
- `lib/source.ts`: Code for content source adapter, [`loader()`](/docs/headless/source-api) provides an interface to interact with your content source, and assigns URL to your pages.
- `app/layout.config.tsx`: Shared options for layouts, optional but preferred to keep.
| Route | Description |
| ------------------------- | ------------------------------------------------------ |
| `app/(home)` | The route group for your landing page and other pages. |
| `app/docs` | The documentation layout and pages. |
| `app/api/search/route.ts` | The Route Handler for search. |
### Writing Content
For authoring docs, make sure to read:
<Cards>
<Card href="/docs/markdown" title="Markdown">
Fumadocs has some additional features for authoring content too.
</Card>
<Card href="/docs/navigation" title="Navigation">
Learn how to customise navigation links/sidebar items.
</Card>
</Cards>
### Content Source
Content source handles all your content, like compiling Markdown files and validating frontmatter.
<Tabs items={['Fumadocs MDX', 'Custom Source']}>
<Tab value='Fumadocs MDX'>
Read the [Introduction](/docs/mdx) to learn how it handles your content.
A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.
</Tab>
<Tab value='Custom Source'>
Fumadocs is not Markdown-exclusive. For other sources like Sanity, you can build a [custom content source](/docs/headless/custom-source).
</Tab>
</Tabs>
### Customise UI
See [Customisation Guide](/docs/customisation).
## FAQ
Some common questions you may encounter.
<Accordions>
<Accordion id='fix-monorepo-styling' title="How to fix stylings not being applied in Monorepo?">
Sometimes, `fumadocs-ui` is not installed in the workspace of your Tailwind CSS configuration file. (e.g. a monorepo setup).
You have to ensure the `fumadocs-ui` package is scanned by Tailwind CSS, and give a correct relative path to `@source`.
For example, add `../../` to point to the `node_modules` folder in root workspace.
```css
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* [!code --] */
@source '../node_modules/fumadocs-ui/dist/**/*.js';
/* [!code ++] */
@source '../../../node_modules/fumadocs-ui/dist/**/*.js';
```
</Accordion>
<Accordion id='change-base-url' title="How to change the base route of /docs?">
You can change the base route of docs (e.g. from `/docs/page` to `/info/page`).
Since Fumadocs uses Next.js App Router, you can simply rename the route:
<Files>
<Folder name="app/docs" defaultOpen className="opacity-50" disabled>
<File name="layout.tsx" />
</Folder>
<Folder name="app/info" defaultOpen>
<File name="layout.tsx" />
</Folder>
</Files>
And tell Fumadocs to use the new route in `source.ts`:
```ts title="lib/source.ts"
import { loader } from 'fumadocs-core/source';
export const source = loader({
baseUrl: '/info',
// other options
});
```
</Accordion>
<Accordion id='dynamic-route' title="It uses Dynamic Route, will it be poor in performance?">
Next.js turns dynamic route into static routes when `generateStaticParams` is configured.
Hence, it is as fast as static pages.
You can enable Static Exports on Next.js to get a static build output. (Notice that Route Handler doesn't work with static export, you have to configure static search)
</Accordion>
<Accordion id='custom-layout-docs-page' title='How to create a page in /docs without docs layout?'>
Same as managing layouts in Next.js App Router, remove the original MDX file from content directory (`/content/docs`).
This ensures duplicated pages will not cause errors.
Now, You can add the page to another route group, which isn't a descendant of docs layout.
For example, under your `app` folder:
<Files>
<File name="(home)/docs/page.tsx" />
<Folder name="docs">
<File name="layout.tsx" />
<File name="[[...slug]]/page.tsx" />
</Folder>
</Files>
will replace the `/docs` page with your `page.tsx`.
</Accordion>
<Accordion id='multi-versions' title="How to implement docs with multi-version?">
Use a separate deployment for each version.
On Vercel, this can be done by creating another branch for a specific version on your GitHub repository.
To link to the sites of other versions, use the Links API or a custom navigation component.
</Accordion>
<Accordion id='multi-docs' title="How to implement multi-docs?">
We recommend to use [Sidebar Tabs](/docs/navigation/sidebar#sidebar-tabs).
</Accordion>
</Accordions>
## Video Tutorials
<YoutubeVideo url="https://www.youtube.com/embed/BPnK-YbISHQ?si=TH_tI3e4MCgMHzGr" />
## Learn More
New to here? Don't worry, we are welcome for your questions.
If you find anything confusing, please give your feedback on [Github Discussion](https://github.com/fuma-nama/fumadocs/discussions)!
<Cards>
<Card
href="/docs/static-export"
title="Configure Static Export"
description="Learn how to enable static export on your docs"
/>
<Card
href="/docs/search"
title="Customise Search"
description="Learn how to customise document search"
/>
<Card
href="/docs/theme"
title="Theming"
description="Add themes to Fumadocs UI"
/>
<Card
href="/docs/components"
title="Components"
description="See all available components to enhance your docs"
/>
</Cards>

253
content/docs/index.zh.mdx Normal file
View File

@ -0,0 +1,253 @@
---
title: 快速入门
description: Fumadocs 入门指南
icon: Album
---
## 简介
Fumadocs <span className='text-fd-muted-foreground text-sm'>(Foo-ma docs)</span> 是一个基于 Next.js 的**文档框架**,设计为快速、灵活,
并无缝集成到 Next.js App Router 中。
Fumadocs 由不同部分组成:
<Cards>
<Card icon={<CpuIcon className="text-purple-300" />} title='Fumadocs Core'>
处理大部分逻辑,包括文档搜索、内容源适配器和 Markdown 扩展。
</Card>
<Card icon={<PanelsTopLeft className="text-blue-300" />} title='Fumadocs UI'>
Fumadocs 的默认主题为文档站点提供了美观的外观和交互式组件。
</Card>
<Card icon={<Database />} title='Content Source'>
您内容的来源,可以是 CMS 或本地数据层,如 [Content Collections](https://www.content-collections.dev) 和 [Fumadocs MDX](/docs/mdx),即官方内容源。
</Card>
<Card icon={<Terminal />} title='Fumadocs CLI'>
一个命令行工具,用于安装 UI 组件和自动化操作,对于自定义布局非常有用。
</Card>
</Cards>
<Callout title="想了解更多?">
阅读我们深入的 [什么是 Fumadocs](/docs/what-is-fumadocs) 介绍。
</Callout>
### 术语
**Markdown/MDX:** Markdown 是一种用于创建格式化文本的标记语言。Fumadocs 默认支持 Markdown 和 MDXMarkdown 的超集)。
虽然不是必需的,但对 Next.js App Router 的基本了解对于进一步的自定义会很有帮助。
## 自动安装
需要 Node.js 18 或更高版本,请注意 Node.js 23.1 可能在 Next.js 生产构建中存在问题。
<Tabs groupId='package-manager' persist items={['npm', 'pnpm', 'yarn', 'bun']}>
```bash tab="npm"
npm create fumadocs-app
```
```bash tab="pnpm"
pnpm create fumadocs-app
```
```bash tab="yarn"
yarn create fumadocs-app
```
```bash tab="bun"
bun create fumadocs-app
```
</Tabs>
它会询问您要使用的框架和内容源,随后将初始化一个新的 fumadocs 应用程序。现在您可以开始动手了!
<Callout title='从现有代码库开始?'>
您可以按照 [手动安装](/docs/manual-installation) 指南开始。
</Callout>
### 尽情使用!
在 docs 文件夹中创建您的第一个 MDX 文件。
```mdx title="content/docs/index.mdx"
---
title: Hello World
---
## Yo what's up
```
在开发模式下运行应用程序并查看 http://localhost:3000/docs。
```mdx
npm run dev
```
## 探索
在项目中,您可以看到:
- `lib/source.ts`:内容源适配器的代码,[`loader()`](/docs/headless/source-api) 提供了与内容源交互的接口,并为您的页面分配 URL。
- `app/layout.config.tsx`:布局的共享选项,可选但建议保留。
| 路由 | 描述 |
| ------------------------- | -------------------------------------- |
| `app/(home)` | 您的登陆页面和其他页面的路由组。 |
| `app/docs` | 文档布局和页面。 |
| `app/api/search/route.ts` | 搜索的路由处理器。 |
### 编写内容
对于编写文档,请务必阅读:
<Cards>
<Card href="/docs/markdown" title="Markdown">
Fumadocs 还有一些额外的内容创作功能。
</Card>
<Card href="/docs/navigation" title="Navigation">
了解如何自定义导航链接/侧边栏项目。
</Card>
</Cards>
### 内容源
内容源处理您的所有内容,例如编译 Markdown 文件和验证前言。
<Tabs items={['Fumadocs MDX', 'Custom Source']}>
<Tab value='Fumadocs MDX'>
阅读 [介绍](/docs/mdx) 了解它如何处理您的内容。
项目中已包含 `source.config.ts` 配置文件,您可以自定义不同的选项,如前言模式。
</Tab>
<Tab value='Custom Source'>
Fumadocs 不仅限于 Markdown。对于其他源如 Sanity您可以构建 [自定义内容源](/docs/headless/custom-source)。
</Tab>
</Tabs>
### 自定义 UI
请参阅 [自定义指南](/docs/customisation)。
## 常见问题
您可能遇到的一些常见问题。
<Accordions>
<Accordion id='fix-monorepo-styling' title="如何修复 Monorepo 中样式不应用的问题?">
有时,`fumadocs-ui` 没有安装在您的 Tailwind CSS 配置文件的工作区中(例如,在 monorepo 设置中)。
您必须确保 Tailwind CSS 扫描 `fumadocs-ui` 包,并为 `@source` 提供正确的相对路径。
例如,添加 `../../` 指向根工作区中的 `node_modules` 文件夹。
```css
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* [!code --] */
@source '../node_modules/fumadocs-ui/dist/**/*.js';
/* [!code ++] */
@source '../../../node_modules/fumadocs-ui/dist/**/*.js';
```
</Accordion>
<Accordion id='change-base-url' title="如何更改 /docs 的基本路由?">
您可以更改文档的基本路由(例如,从 `/docs/page` 更改为 `/info/page`)。
由于 Fumadocs 使用 Next.js App Router您可以简单地重命名路由
<Files>
<Folder name="app/docs" defaultOpen className="opacity-50" disabled>
<File name="layout.tsx" />
</Folder>
<Folder name="app/info" defaultOpen>
<File name="layout.tsx" />
</Folder>
</Files>
并在 `source.ts` 中告诉 Fumadocs 使用新的路由:
```ts title="lib/source.ts"
import { loader } from 'fumadocs-core/source';
export const source = loader({
baseUrl: '/info',
// other options
});
```
</Accordion>
<Accordion id='dynamic-route' title="它使用动态路由,性能会很差吗?">
当配置了 `generateStaticParams` 时Next.js 会将动态路由转换为静态路由。
因此,它与静态页面一样快。
您可以在 Next.js 上启用静态导出,获得静态构建输出。(请注意,路由处理器不适用于静态导出,您必须配置静态搜索)
</Accordion>
<Accordion id='custom-layout-docs-page' title='如何在 /docs 中创建没有文档布局的页面?'>
与在 Next.js App Router 中管理布局相同,从内容目录(`/content/docs`)中删除原始 MDX 文件。
这确保重复的页面不会导致错误。
现在,您可以将页面添加到另一个路由组,该组不是文档布局的后代。
例如,在您的 `app` 文件夹下:
<Files>
<File name="(home)/docs/page.tsx" />
<Folder name="docs">
<File name="layout.tsx" />
<File name="[[...slug]]/page.tsx" />
</Folder>
</Files>
将用您的 `page.tsx` 替换 `/docs` 页面。
</Accordion>
<Accordion id='multi-versions' title="如何实现多版本文档?">
为每个版本使用单独的部署。
在 Vercel 上,可以通过在 GitHub 存储库中为特定版本创建另一个分支来实现。
要链接到其他版本的站点,请使用 Links API 或自定义导航组件。
</Accordion>
<Accordion id='multi-docs' title="如何实现多文档?">
我们建议使用 [侧边栏标签](/docs/navigation/sidebar#sidebar-tabs)。
</Accordion>
</Accordions>
## 视频教程
<YoutubeVideo url="https://www.youtube.com/embed/BPnK-YbISHQ?si=TH_tI3e4MCgMHzGr" />
## 了解更多
刚来这里?别担心,我们欢迎您的问题。

Some files were not shown because too many files have changed in this diff Show More