From 9928c5185bd098b7c58c88fb07e15f1799147984 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 28 Sep 2026 03:49:16 -0500 Subject: [PATCH] Mount nav/book/community as native App Router routes in one Next process. Replace reverse-proxy/iframe approach with @ebook/@community/@navmini imports under /nav /book /community so localhost:3000 serves all three products directly. Co-authored-by: Cursor --- app/book/admin/page.tsx | 11 + app/book/api/creem/checkout/route.ts | 17 + app/book/api/creem/webhook/route.ts | 88 + app/book/api/feedback/route.ts | 35 + app/book/api/pay/invoice/route.ts | 27 + app/book/api/pay/ipn/route.ts | 34 + app/book/layout.tsx | 61 + app/book/opengraph-image.tsx | 98 + app/book/page.tsx | 31 + app/book/purchase/thanks/page.tsx | 10 + app/book/read/[slug]/page.tsx | 30 + app/book/read/opengraph-image.tsx | 49 + app/book/read/page.tsx | 31 + app/book/support/thanks/page.tsx | 10 + app/community/about/page.tsx | 11 + app/community/ai/page.tsx | 20 + app/community/blog/[slug]/page.tsx | 27 + app/community/book/ebook-globals.css | 3187 +++++++++++++++++ app/community/book/layout.tsx | 64 + app/community/book/loading.tsx | 7 + app/community/book/opengraph-image.tsx | 98 + app/community/book/page.tsx | 31 + app/community/book/read/[slug]/page.tsx | 31 + app/community/book/read/page.tsx | 31 + app/community/book/thanks/page.tsx | 137 + app/community/careers/page.tsx | 10 + app/community/changelog/page.tsx | 526 +++ app/community/chat/[id]/page.tsx | 16 + app/community/chat/page.tsx | 16 + app/community/community/[id]/page.tsx | 37 + app/community/community/new/page.tsx | 10 + app/community/community/page.tsx | 24 + app/community/compare/page.tsx | 41 + app/community/contact/page.tsx | 19 + app/community/cookies/page.tsx | 10 + app/community/dating/likes/page.tsx | 16 + app/community/dating/page.tsx | 16 + app/community/destinations/[slug]/page.tsx | 76 + app/community/digital/course/[m]/[l]/page.tsx | 22 + app/community/digital/course/page.tsx | 19 + app/community/digital/day/[id]/page.tsx | 23 + app/community/digital/jobs/page.tsx | 19 + app/community/digital/page.tsx | 20 + app/community/error.tsx | 40 + app/community/feedback/page.tsx | 16 + app/community/gigs/page.tsx | 14 + app/community/gigs/post/page.tsx | 15 + app/community/guidelines/page.tsx | 19 + app/community/help/page.tsx | 19 + app/community/join/page.tsx | 16 + app/community/join/paid/page.tsx | 18 + app/community/layout.tsx | 24 + app/community/loading.tsx | 8 + app/community/login/page.tsx | 185 + app/community/manifest.ts | 27 + app/community/map/page.tsx | 16 + app/community/meetups/[id]/live/page.tsx | 25 + app/community/meetups/host/page.tsx | 10 + app/community/meetups/page.tsx | 24 + app/community/members/[id]/page.tsx | 18 + app/community/next-stop/page.tsx | 29 + app/community/not-found.tsx | 35 + app/community/notifications/page.tsx | 10 + app/community/page.tsx | 60 + app/community/plan/page.tsx | 43 + app/community/press/page.tsx | 10 + app/community/pricing/page.tsx | 10 + app/community/privacy/page.tsx | 54 + app/community/profile/page.tsx | 468 +++ app/community/report/page.tsx | 16 + app/community/robots.ts | 10 + app/community/safety/page.tsx | 19 + app/community/services/page.tsx | 18 + app/community/settings/notifications/page.tsx | 15 + app/community/sitemap.ts | 74 + app/community/submit/page.tsx | 15 + app/community/support/page.tsx | 10 + app/community/terms/page.tsx | 19 + app/community/tools/[id]/page.tsx | 44 + app/community/tools/page.tsx | 135 + app/community/videos/[slug]/page.tsx | 22 + app/community/videos/page.tsx | 18 + app/nav/layout.tsx | 5 + app/nav/page.tsx | 7 + apps/README.md | 52 +- apps/ebook/next.config.ts | 6 +- apps/ebook/src/app/admin/page.tsx | 2 +- .../ebook/src/app/api/creem/checkout/route.ts | 2 +- apps/ebook/src/app/api/creem/webhook/route.ts | 2 +- apps/ebook/src/app/api/feedback/route.ts | 4 +- apps/ebook/src/app/api/pay/invoice/route.ts | 2 +- apps/ebook/src/app/api/pay/ipn/route.ts | 2 +- apps/ebook/src/app/layout.tsx | 16 +- apps/ebook/src/app/opengraph-image.tsx | 2 +- apps/ebook/src/app/page.tsx | 12 +- apps/ebook/src/app/purchase/thanks/page.tsx | 2 +- apps/ebook/src/app/read/[slug]/page.tsx | 8 +- apps/ebook/src/app/read/opengraph-image.tsx | 2 +- apps/ebook/src/app/read/page.tsx | 12 +- apps/ebook/src/app/support/thanks/page.tsx | 2 +- apps/ebook/src/components/AdSlot.tsx | 4 +- apps/ebook/src/components/AdminConsole.tsx | 4 +- .../src/components/AnalyticsProvider.tsx | 6 +- apps/ebook/src/components/BookEnd.tsx | 14 +- apps/ebook/src/components/BookSearch.tsx | 6 +- apps/ebook/src/components/BookmarkButton.tsx | 4 +- apps/ebook/src/components/BuyEbook.tsx | 6 +- apps/ebook/src/components/ChapterHero.tsx | 4 +- apps/ebook/src/components/ChapterMenu.tsx | 4 +- apps/ebook/src/components/ChapterNav.tsx | 6 +- apps/ebook/src/components/ChapterReader.tsx | 2 +- apps/ebook/src/components/ChapterSidebar.tsx | 14 +- apps/ebook/src/components/ContinueReading.tsx | 12 +- .../ebook/src/components/ContinuousReader.tsx | 6 +- .../ebook/src/components/CoverChapterGrid.tsx | 6 +- apps/ebook/src/components/CoverPage.tsx | 14 +- apps/ebook/src/components/CryptoSupport.tsx | 6 +- apps/ebook/src/components/FeedbackPanel.tsx | 4 +- apps/ebook/src/components/GrowthKit.tsx | 12 +- .../ebook/src/components/HighlightPainter.tsx | 2 +- apps/ebook/src/components/InsightCarousel.tsx | 4 +- apps/ebook/src/components/KeyboardNav.tsx | 6 +- apps/ebook/src/components/LocaleProvider.tsx | 4 +- apps/ebook/src/components/MarkdownContent.tsx | 8 +- .../ebook/src/components/MobileChapterBar.tsx | 4 +- apps/ebook/src/components/Providers.tsx | 2 +- apps/ebook/src/components/ReaderLayout.tsx | 2 +- apps/ebook/src/components/ReaderSettings.tsx | 8 +- apps/ebook/src/components/ReaderShare.tsx | 8 +- apps/ebook/src/components/ReaderShortcuts.tsx | 4 +- apps/ebook/src/components/ReadingTracker.tsx | 2 +- .../src/components/ScrollReaderShell.tsx | 16 +- .../src/components/ScrollReadingTracker.tsx | 4 +- apps/ebook/src/components/ScrollToTop.tsx | 2 +- apps/ebook/src/components/SelectionShare.tsx | 8 +- apps/ebook/src/components/ShareQuoteCard.tsx | 4 +- apps/ebook/src/components/ShareToX.tsx | 6 +- apps/ebook/src/components/SkillRadar.tsx | 2 +- .../src/components/SupportThanksContent.tsx | 10 +- apps/ebook/src/components/ThemeToggle.tsx | 2 +- apps/ebook/src/lib/book.server.ts | 2 +- apps/ebook/src/lib/features.server.ts | 2 +- apps/ebook/src/lib/site-config.server.ts | 2 +- apps/ebook/src/lib/time.ts | 4 +- apps/ebook/src/middleware.ts | 2 +- apps/nomadweb/frontend/next.config.ts | 2 +- apps/nomadweb/frontend/src/app/about/page.tsx | 2 +- apps/nomadweb/frontend/src/app/ai/page.tsx | 6 +- .../frontend/src/app/blog/[slug]/page.tsx | 8 +- .../nomadweb/frontend/src/app/book/layout.tsx | 12 +- .../frontend/src/app/book/opengraph-image.tsx | 2 +- apps/nomadweb/frontend/src/app/book/page.tsx | 12 +- .../src/app/book/read/[slug]/page.tsx | 8 +- .../frontend/src/app/book/read/page.tsx | 12 +- .../frontend/src/app/book/thanks/page.tsx | 12 +- .../frontend/src/app/careers/page.tsx | 6 +- .../frontend/src/app/changelog/page.tsx | 8 +- .../frontend/src/app/chat/[id]/page.tsx | 4 +- apps/nomadweb/frontend/src/app/chat/page.tsx | 4 +- .../frontend/src/app/community/[id]/page.tsx | 6 +- .../frontend/src/app/community/new/page.tsx | 4 +- .../frontend/src/app/community/page.tsx | 6 +- .../frontend/src/app/compare/page.tsx | 8 +- .../frontend/src/app/contact/page.tsx | 6 +- .../frontend/src/app/cookies/page.tsx | 6 +- .../frontend/src/app/dating/likes/page.tsx | 4 +- .../nomadweb/frontend/src/app/dating/page.tsx | 4 +- .../src/app/destinations/[slug]/page.tsx | 10 +- .../src/app/digital/course/[m]/[l]/page.tsx | 4 +- .../frontend/src/app/digital/course/page.tsx | 6 +- .../src/app/digital/day/[id]/page.tsx | 6 +- .../frontend/src/app/digital/jobs/page.tsx | 6 +- .../frontend/src/app/digital/page.tsx | 6 +- apps/nomadweb/frontend/src/app/error.tsx | 6 +- .../frontend/src/app/feedback/page.tsx | 4 +- apps/nomadweb/frontend/src/app/gigs/page.tsx | 6 +- .../frontend/src/app/gigs/post/page.tsx | 4 +- .../frontend/src/app/guidelines/page.tsx | 6 +- apps/nomadweb/frontend/src/app/help/page.tsx | 6 +- apps/nomadweb/frontend/src/app/join/page.tsx | 4 +- .../frontend/src/app/join/paid/page.tsx | 4 +- apps/nomadweb/frontend/src/app/layout.tsx | 8 +- apps/nomadweb/frontend/src/app/login/page.tsx | 14 +- apps/nomadweb/frontend/src/app/map/page.tsx | 4 +- .../src/app/meetups/[id]/live/page.tsx | 6 +- .../frontend/src/app/meetups/host/page.tsx | 4 +- .../frontend/src/app/meetups/page.tsx | 6 +- .../frontend/src/app/members/[id]/page.tsx | 6 +- .../frontend/src/app/next-stop/page.tsx | 6 +- apps/nomadweb/frontend/src/app/not-found.tsx | 12 +- .../frontend/src/app/notifications/page.tsx | 4 +- apps/nomadweb/frontend/src/app/page.tsx | 4 +- apps/nomadweb/frontend/src/app/plan/page.tsx | 8 +- apps/nomadweb/frontend/src/app/press/page.tsx | 6 +- .../frontend/src/app/pricing/page.tsx | 4 +- .../frontend/src/app/privacy/page.tsx | 4 +- .../frontend/src/app/profile/page.tsx | 76 +- .../nomadweb/frontend/src/app/report/page.tsx | 4 +- .../nomadweb/frontend/src/app/safety/page.tsx | 6 +- .../frontend/src/app/services/page.tsx | 6 +- .../src/app/settings/notifications/page.tsx | 4 +- .../nomadweb/frontend/src/app/submit/page.tsx | 4 +- .../frontend/src/app/support/page.tsx | 6 +- apps/nomadweb/frontend/src/app/terms/page.tsx | 6 +- .../frontend/src/app/tools/[id]/page.tsx | 10 +- apps/nomadweb/frontend/src/app/tools/page.tsx | 14 +- .../frontend/src/app/videos/[slug]/page.tsx | 6 +- .../nomadweb/frontend/src/app/videos/page.tsx | 6 +- .../frontend/src/components/AboutClient.tsx | 10 +- .../src/components/AiAssistantClient.tsx | 28 +- .../src/components/AirportTransferPick.tsx | 2 +- .../src/components/ArrivalChecklist.tsx | 6 +- .../frontend/src/components/AtmCashGuide.tsx | 2 +- .../src/components/BlogDetailClient.tsx | 14 +- .../frontend/src/components/BlogSection.tsx | 4 +- .../frontend/src/components/CafeGuide.tsx | 2 +- .../frontend/src/components/Calculator.tsx | 12 +- .../frontend/src/components/Charts.tsx | 2 +- .../frontend/src/components/ChatClient.tsx | 24 +- .../src/components/ChatThreadClient.tsx | 30 +- .../frontend/src/components/CityNotes.tsx | 8 +- .../src/components/ColivingQuestions.tsx | 2 +- .../frontend/src/components/Community.tsx | 8 +- .../src/components/CommunityHubClient.tsx | 14 +- .../src/components/CommunityNewClient.tsx | 24 +- .../frontend/src/components/CompareClient.tsx | 38 +- .../frontend/src/components/CompareModal.tsx | 12 +- .../src/components/ContentSubmitClient.tsx | 20 +- .../frontend/src/components/CookieConsent.tsx | 6 +- .../frontend/src/components/CostCompare.tsx | 10 +- .../src/components/CoworkingGuide.tsx | 2 +- .../frontend/src/components/DatingClient.tsx | 38 +- .../src/components/DatingLikesClient.tsx | 22 +- .../src/components/DaylightWorkHours.tsx | 2 +- .../src/components/DepositReturnChecklist.tsx | 2 +- .../components/DestinationDetailClient.tsx | 26 +- .../src/components/DestinationMatcher.tsx | 18 +- .../frontend/src/components/Destinations.tsx | 6 +- .../src/components/DigitalCourseClient.tsx | 24 +- .../src/components/DigitalDayClient.tsx | 14 +- .../src/components/DigitalHomeClient.tsx | 18 +- .../src/components/DigitalJobsClient.tsx | 18 +- .../src/components/DigitalLessonClient.tsx | 26 +- .../src/components/DiscussionDetailClient.tsx | 22 +- .../src/components/EmergencyContacts.tsx | 2 +- .../src/components/ExpenseTracker.tsx | 2 +- .../frontend/src/components/FAQSection.tsx | 12 +- .../src/components/FavoriteButton.tsx | 8 +- .../src/components/FeedbackClient.tsx | 16 +- .../src/components/FeedbackWidget.tsx | 12 +- .../src/components/FirstMonthCost.tsx | 10 +- .../frontend/src/components/FlightCost.tsx | 4 +- .../frontend/src/components/FoodWaterTips.tsx | 2 +- .../frontend/src/components/Footer.tsx | 42 +- .../frontend/src/components/GigPostClient.tsx | 24 +- .../frontend/src/components/GigsClient.tsx | 30 +- .../frontend/src/components/GlobalSearch.tsx | 16 +- .../src/components/GoogleSignInButton.tsx | 2 +- .../nomadweb/frontend/src/components/Hero.tsx | 4 +- .../frontend/src/components/HomeClient.tsx | 6 +- .../frontend/src/components/HousingGuide.tsx | 4 +- .../src/components/HydrationTracker.tsx | 2 +- .../src/components/JetLagEstimator.tsx | 2 +- .../frontend/src/components/JoinClient.tsx | 30 +- .../src/components/JoinPaidClient.tsx | 18 +- .../frontend/src/components/JourneyStrip.tsx | 2 +- .../src/components/KeyboardShortcuts.tsx | 8 +- .../frontend/src/components/LaundryDay.tsx | 2 +- .../frontend/src/components/Lifestyle.tsx | 6 +- .../src/components/LocalScamAlerts.tsx | 2 +- .../frontend/src/components/MeetingWindow.tsx | 2 +- .../src/components/MeetupLiveClient.tsx | 28 +- .../frontend/src/components/MeetupsClient.tsx | 36 +- .../src/components/MeetupsHostClient.tsx | 24 +- .../src/components/MemberMapClient.tsx | 22 +- .../src/components/MemberProfileClient.tsx | 26 +- .../src/components/MovePlanClient.tsx | 36 +- .../frontend/src/components/Navbar.tsx | 18 +- .../src/components/NewsletterSubscribe.tsx | 6 +- .../src/components/NextStopClient.tsx | 22 +- .../frontend/src/components/NomadDigest.tsx | 28 +- .../frontend/src/components/NomadTips.tsx | 2 +- .../components/NotificationSettingsClient.tsx | 14 +- .../src/components/NotificationsClient.tsx | 22 +- .../src/components/OnboardingTour.tsx | 2 +- .../frontend/src/components/Phrasebook.tsx | 4 +- .../src/components/PowerPlugGuide.tsx | 2 +- .../frontend/src/components/PricingClient.tsx | 10 +- .../src/components/PwaInstallHint.tsx | 2 +- .../src/components/RainyDayBackup.tsx | 2 +- .../src/components/RecentlyViewed.tsx | 10 +- .../frontend/src/components/ReportClient.tsx | 30 +- .../frontend/src/components/RingNext.tsx | 2 +- .../src/components/RunwayCalculator.tsx | 10 +- .../frontend/src/components/SavingsGoal.tsx | 4 +- .../frontend/src/components/SeasonGuide.tsx | 2 +- .../frontend/src/components/SectionNav.tsx | 4 +- .../src/components/ServicesClient.tsx | 16 +- .../frontend/src/components/ShareButton.tsx | 4 +- .../frontend/src/components/SimGuide.tsx | 2 +- .../frontend/src/components/SiteShell.tsx | 2 +- .../frontend/src/components/SpinGlobe.tsx | 4 +- .../frontend/src/components/StaticPage.tsx | 6 +- .../frontend/src/components/TaxDayCounter.tsx | 2 +- .../frontend/src/components/TimezoneBoard.tsx | 2 +- .../frontend/src/components/TipGuide.tsx | 2 +- .../frontend/src/components/ToolCityExits.tsx | 10 +- .../src/components/ToolRunnerClient.tsx | 22 +- .../frontend/src/components/Tools.tsx | 2 +- .../frontend/src/components/ToolsStrip.tsx | 4 +- .../frontend/src/components/TripPlanner.tsx | 18 +- .../src/components/VideoDetailClient.tsx | 18 +- .../frontend/src/components/VideosClient.tsx | 16 +- .../frontend/src/components/VisaSection.tsx | 4 +- .../src/components/VisaStayCountdown.tsx | 4 +- .../frontend/src/components/VisaWizard.tsx | 10 +- .../frontend/src/components/WeekendIdeas.tsx | 4 +- .../frontend/src/components/WifiWorkScore.tsx | 4 +- .../frontend/src/components/WorkSpotCost.tsx | 2 +- .../frontend/src/components/WorldMap.tsx | 18 +- .../frontend/src/components/ebook/AdSlot.tsx | 4 +- .../src/components/ebook/AdminConsole.tsx | 4 +- .../components/ebook/AnalyticsProvider.tsx | 6 +- .../frontend/src/components/ebook/BookEnd.tsx | 10 +- .../src/components/ebook/BookSearch.tsx | 6 +- .../src/components/ebook/BookmarkButton.tsx | 4 +- .../src/components/ebook/BuyEbook.tsx | 12 +- .../src/components/ebook/ChapterHero.tsx | 4 +- .../src/components/ebook/ChapterMenu.tsx | 2 +- .../src/components/ebook/ChapterNav.tsx | 4 +- .../src/components/ebook/ChapterReader.tsx | 2 +- .../src/components/ebook/ChapterSidebar.tsx | 12 +- .../src/components/ebook/ContinueReading.tsx | 10 +- .../src/components/ebook/ContinuousReader.tsx | 6 +- .../src/components/ebook/CoverChapterGrid.tsx | 6 +- .../src/components/ebook/CoverPage.tsx | 16 +- .../src/components/ebook/CryptoSupport.tsx | 6 +- .../src/components/ebook/FeedbackPanel.tsx | 4 +- .../src/components/ebook/GrowthKit.tsx | 8 +- .../src/components/ebook/HighlightPainter.tsx | 2 +- .../src/components/ebook/InsightCarousel.tsx | 4 +- .../src/components/ebook/KeyboardNav.tsx | 2 +- .../src/components/ebook/LocaleProvider.tsx | 4 +- .../src/components/ebook/MarkdownContent.tsx | 8 +- .../src/components/ebook/MobileChapterBar.tsx | 2 +- .../src/components/ebook/Providers.tsx | 2 +- .../src/components/ebook/ReaderLayout.tsx | 2 +- .../src/components/ebook/ReaderSettings.tsx | 8 +- .../src/components/ebook/ReaderShare.tsx | 8 +- .../src/components/ebook/ReaderShortcuts.tsx | 4 +- .../src/components/ebook/ReadingTracker.tsx | 2 +- .../components/ebook/ScrollReaderShell.tsx | 14 +- .../components/ebook/ScrollReadingTracker.tsx | 4 +- .../src/components/ebook/ScrollToTop.tsx | 2 +- .../src/components/ebook/SelectionShare.tsx | 8 +- .../src/components/ebook/ShareQuoteCard.tsx | 4 +- .../src/components/ebook/ShareToX.tsx | 6 +- .../src/components/ebook/SkillRadar.tsx | 2 +- .../components/ebook/SupportThanksContent.tsx | 2 +- .../src/components/ebook/ThemeToggle.tsx | 2 +- apps/nomadweb/frontend/src/lib/auth.tsx | 6 +- apps/nomadweb/frontend/src/lib/authNext.ts | 2 +- .../nomadweb/frontend/src/lib/compareScore.ts | 2 +- apps/nomadweb/frontend/src/lib/ebook/time.ts | 4 +- apps/nomadweb/frontend/src/lib/meetupIcs.ts | 4 +- apps/nomadweb/frontend/src/lib/meetupLinks.ts | 2 +- .../frontend/src/lib/nextStopPrefs.ts | 2 +- apps/nomadweb/frontend/src/lib/planIcs.ts | 4 +- apps/nomadweb/frontend/src/lib/planSync.ts | 8 +- apps/nomadweb/frontend/src/lib/rings.ts | 6 +- apps/nomadweb/frontend/src/lib/savedGigs.ts | 2 +- apps/nomadweb/frontend/src/lib/savedJobs.ts | 2 +- apps/nomadweb/frontend/src/lib/toolCopy.ts | 4 +- .../frontend/src/lib/toolsRegistry.tsx | 98 +- apps/nomadweb/frontend/src/lib/tripActions.ts | 4 +- deploy/caddy/nomadro-portal.Caddyfile | 52 +- next.config.ts | 68 +- package.json | 19 +- pnpm-lock.yaml | 1876 ++++++++++ public/{nav => }/icons/1psim.webp | Bin public/{nav => }/icons/3x-ui.webp | Bin public/{nav => }/icons/9esim.webp | Bin public/{nav => }/icons/_brand.webp | Bin public/{nav => }/icons/aapanel.webp | Bin public/{nav => }/icons/action-cam.webp | Bin public/{nav => }/icons/adsense.webp | Bin public/{nav => }/icons/ai-glasses.webp | Bin public/{nav => }/icons/aliyun.webp | Bin public/{nav => }/icons/bmc.webp | Bin public/{nav => }/icons/bwh.webp | Bin public/{nav => }/icons/chatgpt.webp | Bin public/{nav => }/icons/cloud-phone.webp | Bin public/{nav => }/icons/cloudflare.webp | Bin public/{nav => }/icons/colocrossing.webp | Bin public/{nav => }/icons/creem.webp | Bin public/{nav => }/icons/drone.webp | Bin public/{nav => }/icons/dsx.webp | Bin public/{nav => }/icons/ffmpeg.webp | Bin public/{nav => }/icons/frp.webp | Bin public/{nav => }/icons/ga.webp | Bin public/{nav => }/icons/gpu.webp | Bin public/{nav => }/icons/grok.webp | Bin public/{nav => }/icons/iproyal.webp | Bin public/{nav => }/icons/jms.webp | Bin public/{nav => }/icons/lineageos.webp | Bin public/{nav => }/icons/lisa.webp | Bin public/{nav => }/icons/mihomo.webp | Bin public/{nav => }/icons/mini-pc.webp | Bin public/{nav => }/icons/namesilo.webp | Bin public/{nav => }/icons/nomad-book.webp | Bin public/{nav => }/icons/nomadcna.webp | Bin public/{nav => }/icons/nomadlist.webp | Bin public/{nav => }/icons/nomadro.webp | Bin public/{nav => }/icons/nowpayments.webp | Bin public/{nav => }/icons/obs.webp | Bin public/{nav => }/icons/okx.webp | Bin public/{nav => }/icons/paypal.webp | Bin public/{nav => }/icons/proxy-cheap.webp | Bin public/{nav => }/icons/qcloud.webp | Bin public/{nav => }/icons/racknerd.webp | Bin public/{nav => }/icons/rpi.webp | Bin public/{nav => }/icons/safepal.webp | Bin public/{nav => }/icons/smartproxy.webp | Bin public/{nav => }/icons/smmfollows.webp | Bin public/{nav => }/icons/srs.webp | Bin public/{nav => }/icons/stripe.webp | Bin public/{nav => }/icons/tello.webp | Bin public/{nav => }/icons/tiktok.webp | Bin public/{nav => }/icons/vcam.webp | Bin public/{nav => }/icons/voyracloud.webp | Bin public/{nav => }/icons/vultr.webp | Bin public/{nav => }/icons/wireguard.webp | Bin public/{nav => }/icons/wise.webp | Bin public/{nav => }/icons/xorpay.webp | Bin public/{nav => }/icons/yesim.webp | Bin public/{nav => }/icons/yidu.webp | Bin public/{nav => }/icons/ykk.webp | Bin public/{nav => }/icons/youtube.webp | Bin public/{nav => }/icons/yt-auto-dismiss.webp | Bin public/{nav => }/icons/zpay.webp | Bin public/nav/assets/index-B4Fuk-Vb.js | 9 - public/nav/assets/index-DCbPQU-0.css | 1 - public/nav/favicon.svg | 1 - public/nav/icons.svg | 24 - public/nav/index.html | 22 - scripts/integrate-apps.mjs | 251 ++ scripts/prefix-routes.mjs | 111 + tsconfig.json | 35 +- 448 files changed, 10309 insertions(+), 1440 deletions(-) create mode 100644 app/book/admin/page.tsx create mode 100644 app/book/api/creem/checkout/route.ts create mode 100644 app/book/api/creem/webhook/route.ts create mode 100644 app/book/api/feedback/route.ts create mode 100644 app/book/api/pay/invoice/route.ts create mode 100644 app/book/api/pay/ipn/route.ts create mode 100644 app/book/layout.tsx create mode 100644 app/book/opengraph-image.tsx create mode 100644 app/book/page.tsx create mode 100644 app/book/purchase/thanks/page.tsx create mode 100644 app/book/read/[slug]/page.tsx create mode 100644 app/book/read/opengraph-image.tsx create mode 100644 app/book/read/page.tsx create mode 100644 app/book/support/thanks/page.tsx create mode 100644 app/community/about/page.tsx create mode 100644 app/community/ai/page.tsx create mode 100644 app/community/blog/[slug]/page.tsx create mode 100644 app/community/book/ebook-globals.css create mode 100644 app/community/book/layout.tsx create mode 100644 app/community/book/loading.tsx create mode 100644 app/community/book/opengraph-image.tsx create mode 100644 app/community/book/page.tsx create mode 100644 app/community/book/read/[slug]/page.tsx create mode 100644 app/community/book/read/page.tsx create mode 100644 app/community/book/thanks/page.tsx create mode 100644 app/community/careers/page.tsx create mode 100644 app/community/changelog/page.tsx create mode 100644 app/community/chat/[id]/page.tsx create mode 100644 app/community/chat/page.tsx create mode 100644 app/community/community/[id]/page.tsx create mode 100644 app/community/community/new/page.tsx create mode 100644 app/community/community/page.tsx create mode 100644 app/community/compare/page.tsx create mode 100644 app/community/contact/page.tsx create mode 100644 app/community/cookies/page.tsx create mode 100644 app/community/dating/likes/page.tsx create mode 100644 app/community/dating/page.tsx create mode 100644 app/community/destinations/[slug]/page.tsx create mode 100644 app/community/digital/course/[m]/[l]/page.tsx create mode 100644 app/community/digital/course/page.tsx create mode 100644 app/community/digital/day/[id]/page.tsx create mode 100644 app/community/digital/jobs/page.tsx create mode 100644 app/community/digital/page.tsx create mode 100644 app/community/error.tsx create mode 100644 app/community/feedback/page.tsx create mode 100644 app/community/gigs/page.tsx create mode 100644 app/community/gigs/post/page.tsx create mode 100644 app/community/guidelines/page.tsx create mode 100644 app/community/help/page.tsx create mode 100644 app/community/join/page.tsx create mode 100644 app/community/join/paid/page.tsx create mode 100644 app/community/layout.tsx create mode 100644 app/community/loading.tsx create mode 100644 app/community/login/page.tsx create mode 100644 app/community/manifest.ts create mode 100644 app/community/map/page.tsx create mode 100644 app/community/meetups/[id]/live/page.tsx create mode 100644 app/community/meetups/host/page.tsx create mode 100644 app/community/meetups/page.tsx create mode 100644 app/community/members/[id]/page.tsx create mode 100644 app/community/next-stop/page.tsx create mode 100644 app/community/not-found.tsx create mode 100644 app/community/notifications/page.tsx create mode 100644 app/community/page.tsx create mode 100644 app/community/plan/page.tsx create mode 100644 app/community/press/page.tsx create mode 100644 app/community/pricing/page.tsx create mode 100644 app/community/privacy/page.tsx create mode 100644 app/community/profile/page.tsx create mode 100644 app/community/report/page.tsx create mode 100644 app/community/robots.ts create mode 100644 app/community/safety/page.tsx create mode 100644 app/community/services/page.tsx create mode 100644 app/community/settings/notifications/page.tsx create mode 100644 app/community/sitemap.ts create mode 100644 app/community/submit/page.tsx create mode 100644 app/community/support/page.tsx create mode 100644 app/community/terms/page.tsx create mode 100644 app/community/tools/[id]/page.tsx create mode 100644 app/community/tools/page.tsx create mode 100644 app/community/videos/[slug]/page.tsx create mode 100644 app/community/videos/page.tsx create mode 100644 app/nav/layout.tsx create mode 100644 app/nav/page.tsx rename public/{nav => }/icons/1psim.webp (100%) rename public/{nav => }/icons/3x-ui.webp (100%) rename public/{nav => }/icons/9esim.webp (100%) rename public/{nav => }/icons/_brand.webp (100%) rename public/{nav => }/icons/aapanel.webp (100%) rename public/{nav => }/icons/action-cam.webp (100%) rename public/{nav => }/icons/adsense.webp (100%) rename public/{nav => }/icons/ai-glasses.webp (100%) rename public/{nav => }/icons/aliyun.webp (100%) rename public/{nav => }/icons/bmc.webp (100%) rename public/{nav => }/icons/bwh.webp (100%) rename public/{nav => }/icons/chatgpt.webp (100%) rename public/{nav => }/icons/cloud-phone.webp (100%) rename public/{nav => }/icons/cloudflare.webp (100%) rename public/{nav => }/icons/colocrossing.webp (100%) rename public/{nav => }/icons/creem.webp (100%) rename public/{nav => }/icons/drone.webp (100%) rename public/{nav => }/icons/dsx.webp (100%) rename public/{nav => }/icons/ffmpeg.webp (100%) rename public/{nav => }/icons/frp.webp (100%) rename public/{nav => }/icons/ga.webp (100%) rename public/{nav => }/icons/gpu.webp (100%) rename public/{nav => }/icons/grok.webp (100%) rename public/{nav => }/icons/iproyal.webp (100%) rename public/{nav => }/icons/jms.webp (100%) rename public/{nav => }/icons/lineageos.webp (100%) rename public/{nav => }/icons/lisa.webp (100%) rename public/{nav => }/icons/mihomo.webp (100%) rename public/{nav => }/icons/mini-pc.webp (100%) rename public/{nav => }/icons/namesilo.webp (100%) rename public/{nav => }/icons/nomad-book.webp (100%) rename public/{nav => }/icons/nomadcna.webp (100%) rename public/{nav => }/icons/nomadlist.webp (100%) rename public/{nav => }/icons/nomadro.webp (100%) rename public/{nav => }/icons/nowpayments.webp (100%) rename public/{nav => }/icons/obs.webp (100%) rename public/{nav => }/icons/okx.webp (100%) rename public/{nav => }/icons/paypal.webp (100%) rename public/{nav => }/icons/proxy-cheap.webp (100%) rename public/{nav => }/icons/qcloud.webp (100%) rename public/{nav => }/icons/racknerd.webp (100%) rename public/{nav => }/icons/rpi.webp (100%) rename public/{nav => }/icons/safepal.webp (100%) rename public/{nav => }/icons/smartproxy.webp (100%) rename public/{nav => }/icons/smmfollows.webp (100%) rename public/{nav => }/icons/srs.webp (100%) rename public/{nav => }/icons/stripe.webp (100%) rename public/{nav => }/icons/tello.webp (100%) rename public/{nav => }/icons/tiktok.webp (100%) rename public/{nav => }/icons/vcam.webp (100%) rename public/{nav => }/icons/voyracloud.webp (100%) rename public/{nav => }/icons/vultr.webp (100%) rename public/{nav => }/icons/wireguard.webp (100%) rename public/{nav => }/icons/wise.webp (100%) rename public/{nav => }/icons/xorpay.webp (100%) rename public/{nav => }/icons/yesim.webp (100%) rename public/{nav => }/icons/yidu.webp (100%) rename public/{nav => }/icons/ykk.webp (100%) rename public/{nav => }/icons/youtube.webp (100%) rename public/{nav => }/icons/yt-auto-dismiss.webp (100%) rename public/{nav => }/icons/zpay.webp (100%) delete mode 100644 public/nav/assets/index-B4Fuk-Vb.js delete mode 100644 public/nav/assets/index-DCbPQU-0.css delete mode 100644 public/nav/favicon.svg delete mode 100644 public/nav/icons.svg delete mode 100644 public/nav/index.html create mode 100644 scripts/integrate-apps.mjs create mode 100644 scripts/prefix-routes.mjs diff --git a/app/book/admin/page.tsx b/app/book/admin/page.tsx new file mode 100644 index 0000000..9558c7e --- /dev/null +++ b/app/book/admin/page.tsx @@ -0,0 +1,11 @@ +import 'antd/dist/reset.css'; +import { AdminConsole } from '@ebook/components/AdminConsole'; + +export const metadata = { + title: 'Admin Console', + robots: { index: false, follow: false }, +}; + +export default function AdminPage() { + return ; +} diff --git a/app/book/api/creem/checkout/route.ts b/app/book/api/creem/checkout/route.ts new file mode 100644 index 0000000..81c3c8d --- /dev/null +++ b/app/book/api/creem/checkout/route.ts @@ -0,0 +1,17 @@ +import { NextResponse } from 'next/server'; +import { createCreemCheckout, isCreemConfigured } from '@ebook/lib/creem'; + +export async function POST() { + if (!isCreemConfigured()) { + return NextResponse.json({ ok: false, error: 'creem not configured' }, { status: 503 }); + } + + try { + const checkout = await createCreemCheckout(); + return NextResponse.json({ ok: true, checkoutUrl: checkout.checkoutUrl }); + } catch (error) { + const message = error instanceof Error ? error.message : 'checkout failed'; + console.error('Creem checkout', message); + return NextResponse.json({ ok: false, error: 'checkout failed' }, { status: 502 }); + } +} diff --git a/app/book/api/creem/webhook/route.ts b/app/book/api/creem/webhook/route.ts new file mode 100644 index 0000000..c5867ee --- /dev/null +++ b/app/book/api/creem/webhook/route.ts @@ -0,0 +1,88 @@ +import { NextResponse } from 'next/server'; +import { verifyCreemSignature } from '@ebook/lib/creem'; + +// Creem webhook payload shape per docs +// https://docs.creem.io/code/webhooks +type CreemCheckoutObject = { + id: string; + object: 'checkout'; + request_id?: string; + status: string; + order?: { + id: string; + customer: string; + product: string; + amount: number; + currency: string; + status: string; + }; + product?: { id: string; name: string }; + customer?: { id: string; email: string; name?: string }; + subscription?: { id: string; status: string }; + metadata?: Record; +}; + +type CreemWebhookEvent = { + id: string; + eventType: string; + created_at: number; + object: CreemCheckoutObject | Record; +}; + +export async function POST(req: Request) { + const raw = await req.text(); + // Creem always uses "creem-signature" header (HMAC-SHA256) + const signature = req.headers.get('creem-signature'); + + if (!verifyCreemSignature(raw, signature)) { + console.warn('Creem webhook: invalid signature'); + return NextResponse.json({ ok: false }, { status: 401 }); + } + + let payload: CreemWebhookEvent; + try { + payload = JSON.parse(raw) as CreemWebhookEvent; + } catch { + return NextResponse.json({ ok: false }, { status: 400 }); + } + + const { eventType, object: obj } = payload; + const checkout = obj as CreemCheckoutObject; + + console.info('Creem webhook received', { + id: payload.id, + eventType, + objectId: checkout.id, + status: checkout.status, + email: checkout.customer?.email, + orderId: checkout.order?.id, + amount: checkout.order?.amount, + currency: checkout.order?.currency, + }); + + switch (eventType) { + case 'checkout.completed': + // One-time ebook purchase confirmed — add post-purchase logic here + // e.g. send download email, unlock content, record in DB + console.info('Creem: checkout completed', { + checkoutId: checkout.id, + email: checkout.customer?.email, + orderId: checkout.order?.id, + }); + break; + + case 'refund.created': + console.info('Creem: refund created', { objectId: checkout.id }); + break; + + case 'dispute.created': + console.warn('Creem: dispute created', { objectId: checkout.id }); + break; + + default: + // subscription.* events — not relevant for one-time product, log and ignore + break; + } + + return NextResponse.json({ ok: true }); +} diff --git a/app/book/api/feedback/route.ts b/app/book/api/feedback/route.ts new file mode 100644 index 0000000..4e7cbf6 --- /dev/null +++ b/app/book/api/feedback/route.ts @@ -0,0 +1,35 @@ +import { NextResponse } from 'next/server'; +import { getBook } from '@ebook/lib/book.server'; +import { getSiteConfig } from '@ebook/lib/site-config.server'; + +export async function POST(req: Request) { + try { + const body = (await req.json()) as { email?: string; message?: string }; + const message = body.message?.trim(); + if (!message || message.length < 4) { + return NextResponse.json({ ok: false, error: 'message required' }, { status: 400 }); + } + + const book = getBook(); + const site = getSiteConfig(); + const payload = { + book: book.title, + email: body.email?.trim() || '', + message, + at: new Date().toISOString(), + }; + + const webhook = process.env.FEEDBACK_WEBHOOK_URL?.trim(); + if (webhook) { + await fetch(webhook, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(payload), + }); + } + + return NextResponse.json({ ok: true }); + } catch { + return NextResponse.json({ ok: false }, { status: 500 }); + } +} diff --git a/app/book/api/pay/invoice/route.ts b/app/book/api/pay/invoice/route.ts new file mode 100644 index 0000000..cc38202 --- /dev/null +++ b/app/book/api/pay/invoice/route.ts @@ -0,0 +1,27 @@ +import { NextResponse } from 'next/server'; +import { + createSupportInvoice, + isAllowedSupportAmount, + isNowPaymentsConfigured, +} from '@ebook/lib/nowpayments'; + +export async function POST(req: Request) { + if (!isNowPaymentsConfigured()) { + return NextResponse.json({ ok: false, error: 'payments not configured' }, { status: 503 }); + } + + try { + const body = (await req.json()) as { amount?: number }; + const amount = Number(body.amount); + if (!isAllowedSupportAmount(amount)) { + return NextResponse.json({ ok: false, error: 'invalid amount' }, { status: 400 }); + } + + const invoice = await createSupportInvoice(amount); + return NextResponse.json({ ok: true, invoiceUrl: invoice.invoiceUrl }); + } catch (error) { + const message = error instanceof Error ? error.message : 'invoice failed'; + console.error('NOWPayments invoice', message); + return NextResponse.json({ ok: false, error: 'invoice failed' }, { status: 502 }); + } +} diff --git a/app/book/api/pay/ipn/route.ts b/app/book/api/pay/ipn/route.ts new file mode 100644 index 0000000..eb87588 --- /dev/null +++ b/app/book/api/pay/ipn/route.ts @@ -0,0 +1,34 @@ +import { NextResponse } from 'next/server'; +import { verifyIpnSignature } from '@ebook/lib/nowpayments'; + +export async function POST(req: Request) { + const raw = await req.text(); + const signature = req.headers.get('x-nowpayments-sig'); + + if (!verifyIpnSignature(raw, signature)) { + return NextResponse.json({ ok: false }, { status: 401 }); + } + + try { + const payload = JSON.parse(raw) as { + payment_status?: string; + order_id?: string; + price_amount?: number; + pay_currency?: string; + actually_paid?: number; + invoice_id?: string | number; + }; + console.info('NOWPayments IPN', { + status: payload.payment_status, + orderId: payload.order_id, + amount: payload.price_amount, + payCurrency: payload.pay_currency, + paid: payload.actually_paid, + invoiceId: payload.invoice_id, + }); + } catch { + return NextResponse.json({ ok: false }, { status: 400 }); + } + + return NextResponse.json({ ok: true }); +} diff --git a/app/book/layout.tsx b/app/book/layout.tsx new file mode 100644 index 0000000..05d5183 --- /dev/null +++ b/app/book/layout.tsx @@ -0,0 +1,61 @@ +import { AntdRegistry } from "@ant-design/nextjs-registry"; +import { Providers } from "@ebook/components/Providers"; +import { getSiteConfig } from "@ebook/lib/site-config.server"; +import { getServerFeatures } from "@ebook/lib/features.server"; +import { getLocale } from "@ebook/lib/i18n/server"; +import "@ebook/app/globals.css"; + +export default async function BookLayout({ + children, +}: { + children: React.ReactNode; +}) { + const locale = await getLocale(); + const site = getSiteConfig(); + const f = getServerFeatures(); + + return ( +
+ + + {f.analytics.enabled ? : null} + {f.ads.enabled && f.ads.clientId ? : null} + {children} + {f.feedback.enabled ? ( + + ) : null} + + + - - - -
- - diff --git a/scripts/integrate-apps.mjs b/scripts/integrate-apps.mjs new file mode 100644 index 0000000..ffa7da2 --- /dev/null +++ b/scripts/integrate-apps.mjs @@ -0,0 +1,251 @@ +/** + * Integrate vertical apps into portal App Router as real routes. + * - apps/ebook/src → @ebook/* , routes under app/book + * - apps/nomadweb/frontend/src → @community/* , routes under app/community + * - apps/navmini/src → app/nav (client page) + * No iframe / webview / reverse-proxy. + */ +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); + +function walk(dir, out = []) { + if (!fs.existsSync(dir)) return out; + for (const ent of fs.readdirSync(dir, { withFileTypes: true })) { + if (ent.name === "node_modules" || ent.name === ".next" || ent.name === "dist") continue; + const p = path.join(dir, ent.name); + if (ent.isDirectory()) walk(p, out); + else out.push(p); + } + return out; +} + +function rewriteAlias(file, fromPrefix, toPrefix) { + let t = fs.readFileSync(file, "utf8"); + const before = t; + // from '@/x' or "@/x" or from '@/x/y' + const re = new RegExp(`([\"'])${fromPrefix}/`, "g"); + t = t.replace(re, `$1${toPrefix}/`); + if (t !== before) { + fs.writeFileSync(file, t); + return true; + } + return false; +} + +function ensureDir(p) { + fs.mkdirSync(p, { recursive: true }); +} + +function relPosix(from, to) { + return path.relative(from, to).split(path.sep).join("/"); +} + +/** Copy app route files into portal, skipping root layout.tsx/globals.css (handled separately). */ +function mirrorAppRoutes(srcAppDir, destAppDir, importAlias) { + const files = walk(srcAppDir).filter((f) => { + const base = path.basename(f); + const rel = path.relative(srcAppDir, f); + if (rel === "layout.tsx" || rel === "globals.css" || rel === "global.css") return false; + if (rel === "favicon.ico") return false; + return /\.(tsx|ts|jsx|js|css|mdx)$/.test(base); + }); + + let n = 0; + for (const src of files) { + const rel = path.relative(srcAppDir, src); + const dest = path.join(destAppDir, rel); + ensureDir(path.dirname(dest)); + + // For page/layout/route/loading/error/template/default files: keep as real route modules. + // Rewrite their @/ imports already done in source trees. + let body = fs.readFileSync(src, "utf8"); + + // If this is a page that was under apps and already uses @ebook/@community, fine. + // Also fix any remaining @/ that slipped through in this file only if still present. + body = body.replace(/(["'])@\//g, `$1${importAlias}/`); + + fs.writeFileSync(dest, body); + n++; + } + return n; +} + +function stripRootChrome(layoutSrc, outPath, cssImport, extraNote) { + let t = fs.readFileSync(layoutSrc, "utf8"); + // Remove html/body wrappers — nested segment layout only. + // Common patterns: return (...) + // We'll write a handcrafted layout instead if stripping is too fragile. + fs.writeFileSync(outPath, t); + return t; +} + +// --- 1) Rewrite aliases in source trees --- +const ebookSrc = path.join(root, "apps/ebook/src"); +const communitySrc = path.join(root, "apps/nomadweb/frontend/src"); + +let ebookRewrites = 0; +for (const f of walk(ebookSrc).filter((x) => /\.(ts|tsx|js|jsx)$/.test(x))) { + if (rewriteAlias(f, "@", "@ebook")) ebookRewrites++; +} +let communityRewrites = 0; +for (const f of walk(communitySrc).filter((x) => /\.(ts|tsx|js|jsx)$/.test(x))) { + if (rewriteAlias(f, "@", "@community")) communityRewrites++; +} + +console.log(`alias rewrite ebook files=${ebookRewrites}, community files=${communityRewrites}`); + +// --- 2) Fix ebook content root to apps/ebook/content --- +for (const f of walk(ebookSrc).filter((x) => /\.(ts|tsx)$/.test(x))) { + let t = fs.readFileSync(f, "utf8"); + const before = t; + // path.join(process.cwd(), 'content' ...) → path.join(process.cwd(), 'apps/ebook/content' ...) + t = t.replace( + /path\.join\(\s*process\.cwd\(\)\s*,\s*['\"]content['\"]/g, + "path.join(process.cwd(), 'apps/ebook/content'", + ); + t = t.replace( + /join\(\s*process\.cwd\(\)\s*,\s*['\"]content['\"]/g, + "join(process.cwd(), 'apps/ebook/content'", + ); + if (t !== before) { + fs.writeFileSync(f, t); + console.log("content path fix:", path.relative(root, f)); + } +} + +// --- 3) Mirror routes into portal app/ --- +const bookDest = path.join(root, "app/book"); +const communityDest = path.join(root, "app/community"); +fs.rmSync(bookDest, { recursive: true, force: true }); +fs.rmSync(communityDest, { recursive: true, force: true }); +ensureDir(bookDest); +ensureDir(communityDest); + +const bookCount = mirrorAppRoutes(path.join(ebookSrc, "app"), bookDest, "@ebook"); +const communityCount = mirrorAppRoutes( + path.join(communitySrc, "app"), + communityDest, + "@community", +); +console.log(`mirrored book routes=${bookCount}, community routes=${communityCount}`); + +// --- 4) Write nested layouts (no html/body) --- +const bookLayout = `import { AntdRegistry } from "@ant-design/nextjs-registry"; +import { Providers } from "@ebook/components/Providers"; +import { getSiteConfig } from "@ebook/lib/site-config.server"; +import { getServerFeatures } from "@ebook/lib/features.server"; +import { getLocale } from "@ebook/lib/i18n/server"; +import "@ebook/app/globals.css"; + +export default async function BookLayout({ + children, +}: { + children: React.ReactNode; +}) { + const locale = await getLocale(); + const site = getSiteConfig(); + const f = getServerFeatures(); + + return ( +
+ + + {f.analytics.enabled ? : null} + {f.ads.enabled && f.ads.clientId ? : null} + {children} + {f.feedback.enabled ? ( + + ) : null} + + +