From 8b8373b11ace67bcfa5dfab1726bc0916c4f8ef6 Mon Sep 17 00:00:00 2001 From: Rahul Varghese Date: Wed, 28 Oct 2026 21:06:43 +0530 Subject: [PATCH] SL1: the site on Workers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit strapi/LaunchPad next/ (c54b5c2, MIT as declared) in apps/web, built by @opennextjs/cloudflare 1.20.11 (next build --webpack) into one Worker with Static Assets: the R2 incremental cache (infra/terraform/cloudflare-r2), the sharded Durable Object tag cache and the Durable Object revalidation queue, as the commerce baseline has them — the static-assets cache refuses "use cache" entries. Cache Components off, experimental.useCache keeps every Strapi read's "use cache", cacheLife and cacheTag (a Cache Components page hangs on workerd, opennextjs-cloudflare#1450); Next is 16.3.8. With no STRAPI_URL (an optional build secret, inlined as the template's NEXT_PUBLIC_API_URL) every read answers from lib/strapi/sample.ts — the template's seed, recorded from a Strapi that imported its export, both locales, with the 40 images it names under public/uploads — and the template's demo bar says how to connect Strapi; nothing is fetched. SITE_NAME (lib/site.ts) is the one site-name seam; metadataBase per environment; /api/health; two upstream bugs fixed (a 500 for a request with no Accept-Language, a 200 for a missing page); lint is upstream's core-web-vitals in flat form. typecheck, lint, test (tests/web's 21) and build are green; the Worker is 2.13 MiB gzipped (Workers Free). Co-Authored-By: Claude Orun-Task: SL-2 --- README.md | 110 +- apps/web/.dev.vars.example | 3 + apps/web/.env.example | 15 + apps/web/LICENSE.md | 34 + apps/web/README.md | 16 + .../(marketing)/ClientSlugHandler.tsx | 22 + .../[locale]/(marketing)/[slug]/loading.tsx | 43 + .../app/[locale]/(marketing)/[slug]/page.tsx | 58 + .../(marketing)/blog/[slug]/loading.tsx | 33 + .../[locale]/(marketing)/blog/[slug]/page.tsx | 38 + .../app/[locale]/(marketing)/blog/loading.tsx | 31 + .../app/[locale]/(marketing)/blog/page.tsx | 74 + apps/web/app/[locale]/(marketing)/page.tsx | 54 + .../(marketing)/products/[slug]/loading.tsx | 27 + .../(marketing)/products/[slug]/page.tsx | 72 + .../[locale]/(marketing)/products/loading.tsx | 24 + .../[locale]/(marketing)/products/page.tsx | 74 + apps/web/app/[locale]/layout.tsx | 66 + apps/web/app/[locale]/sign-up/page.tsx | 11 + apps/web/app/api/exit-preview/route.ts | 9 + apps/web/app/api/health/route.ts | 13 + apps/web/app/api/preview/route.ts | 27 + apps/web/app/context/SlugContext.tsx | 44 + apps/web/app/favicon.ico | Bin 0 -> 25931 bytes apps/web/app/globals.css | 24 + apps/web/app/layout.tsx | 52 + apps/web/app/prism.css | 47 + apps/web/cloudflare-env.d.ts | 15 + apps/web/component.yaml | 120 + apps/web/components.json | 20 + apps/web/components/article-content.tsx | 32 + apps/web/components/banner.tsx | 49 + apps/web/components/beam/index.tsx | 70 + apps/web/components/beam/styles.module.css | 35 + apps/web/components/blog-card.tsx | 141 + apps/web/components/blog-layout.tsx | 100 + apps/web/components/blog-post-rows.tsx | 108 + apps/web/components/blur-image.tsx | 38 + apps/web/components/container.tsx | 17 + .../components/decorations/ambient-color.tsx | 46 + apps/web/components/decorations/cover.tsx | 45 + .../components/decorations/shooting-star.tsx | 129 + .../decorations/star-background.tsx | 147 + apps/web/components/draft-mode-banner.tsx | 46 + apps/web/components/dynamic-zone/brands.tsx | 92 + apps/web/components/dynamic-zone/cta.tsx | 51 + apps/web/components/dynamic-zone/faq.tsx | 39 + .../components/dynamic-zone/features/card.tsx | 75 + .../features/feature-icon-container.tsx | 37 + .../dynamic-zone/features/icon-container.tsx | 25 + .../dynamic-zone/features/index.tsx | 109 + .../dynamic-zone/features/skeletons/first.tsx | 469 + .../features/skeletons/fourth.tsx | 132 + .../features/skeletons/second.tsx | 271 + .../dynamic-zone/features/skeletons/third.tsx | 359 + .../dynamic-zone/form-next-to-section.tsx | 140 + apps/web/components/dynamic-zone/hero.tsx | 60 + .../dynamic-zone/how-it-works/card.tsx | 97 + .../dynamic-zone/how-it-works/index.tsx | 44 + apps/web/components/dynamic-zone/launches.tsx | 78 + apps/web/components/dynamic-zone/manager.tsx | 72 + apps/web/components/dynamic-zone/pricing.tsx | 258 + .../dynamic-zone/related-articles.tsx | 32 + .../dynamic-zone/related-products.tsx | 28 + .../dynamic-zone/testimonials/index.tsx | 45 + .../dynamic-zone/testimonials/slider.tsx | 156 + .../testimonials/testimonials-marquee.tsx | 131 + apps/web/components/elements/button.tsx | 48 + apps/web/components/elements/heading.tsx | 41 + apps/web/components/elements/subheading.tsx | 30 + apps/web/components/footer.tsx | 94 + apps/web/components/gradient-container.tsx | 73 + apps/web/components/icons/external-link.tsx | 20 + apps/web/components/icons/illustrations.tsx | 416 + apps/web/components/icons/x.tsx | 19 + apps/web/components/locale-switcher.tsx | 56 + apps/web/components/logo.tsx | 30 + apps/web/components/navbar/desktop-navbar.tsx | 108 + apps/web/components/navbar/index.tsx | 33 + apps/web/components/navbar/mobile-navbar.tsx | 129 + apps/web/components/navbar/navbar-item.tsx | 40 + apps/web/components/preview.tsx | 40 + apps/web/components/products/featured.tsx | 78 + apps/web/components/products/modal.tsx | 113 + .../web/components/products/product-items.tsx | 80 + .../components/products/single-product.tsx | 166 + apps/web/components/register.tsx | 64 + .../components/skeletons/page-skeleton.tsx | 26 + apps/web/components/toast.tsx | 58 + apps/web/components/ui/animated-modal.tsx | 243 + apps/web/components/ui/animated-tooltip.tsx | 95 + .../components/ui/canvas-reveal-effect.tsx | 311 + apps/web/components/ui/data/globe.json | 13000 +++++++++++++ apps/web/components/ui/globe.tsx | 432 + apps/web/components/ui/sparkles.tsx | 435 + apps/web/components/ui/sticky-scroll.tsx | 148 + apps/web/components/ui/strapi-media.tsx | 90 + apps/web/context/cart-context.tsx | 91 + apps/web/docs/architecture.md | 34 + apps/web/docs/overview.md | 20 + apps/web/docs/runbook.md | 40 + apps/web/eslint.config.mjs | 22 + apps/web/i18n.config.ts | 6 + apps/web/lib/next-metadata.ts | 30 + apps/web/lib/shared/PageContent.tsx | 17 + apps/web/lib/shared/metadata.ts | 23 + apps/web/lib/site.ts | 9 + apps/web/lib/strapi/client.ts | 281 + apps/web/lib/strapi/index.ts | 8 + apps/web/lib/strapi/sample-redirections.ts | 6 + apps/web/lib/strapi/sample.ts | 92 + apps/web/lib/strapi/sourceMap.ts | 64 + apps/web/lib/strapi/spreadStrapiData.ts | 11 + apps/web/lib/strapi/strapiImage.ts | 33 + apps/web/lib/utils.ts | 48 + apps/web/next.config.ts | 67 + apps/web/open-next.config.ts | 32 + apps/web/package.json | 68 + apps/web/postcss.config.mjs | 8 + apps/web/proxy.ts | 48 + apps/web/public/uploads/150_1_72b31e9d92.jpeg | Bin 0 -> 4466 bytes apps/web/public/uploads/150_3_92cafa8276.jpeg | Bin 0 -> 5638 bytes apps/web/public/uploads/150_4_735f9c676c.jpeg | Bin 0 -> 2956 bytes apps/web/public/uploads/150_6_6425ed4e29.jpeg | Bin 0 -> 6616 bytes apps/web/public/uploads/150_ec0263c9c6.jpeg | Bin 0 -> 6830 bytes ...4618a32311bcb30f8766f125410_3db99ce60b.png | Bin 0 -> 10373 bytes ...f698ee7a5b7fcad6703d90f4cc0_224039d0e6.png | Bin 0 -> 3436 bytes ...51f86a8779f1ac3fb687b305e50_a0b0a22418.png | Bin 0 -> 3238 bytes ...4ce0671c82b2dffba3aa6968f38_afa1e9fd29.png | Bin 0 -> 3928 bytes ...ast_global_content_deliver_1e5ad34267.webp | Bin 0 -> 227038 bytes ...Next_js_On_one_side_a_user_94b9fc7c0d.webp | Bin 0 -> 226836 bytes ...e_windows_overlooking_a_ci_165bacb7dd.webp | Bin 0 -> 195062 bytes apps/web/public/uploads/Blog_bd35597734.jpg | Bin 0 -> 39596 bytes .../web/public/uploads/Contact_ccff6af752.jpg | Bin 0 -> 32675 bytes apps/web/public/uploads/FAQ_576e799607.jpg | Bin 0 -> 27402 bytes .../public/uploads/Launch_Pad_2ce50f287f.jpg | Bin 0 -> 38907 bytes .../web/public/uploads/Pricing_8c8f61211e.jpg | Bin 0 -> 95456 bytes .../public/uploads/Products_e1d1d2b0bf.jpg | Bin 0 -> 42587 bytes .../web/public/uploads/alfred_7432e6015c.jpeg | Bin 0 -> 4932 bytes .../public/uploads/dashboard_106c0d6b4b.png | Bin 0 -> 364406 bytes .../public/uploads/dora_mirta_fb6c81be88.jpg | Bin 0 -> 4071 bytes .../public/uploads/enily_davis_44973ee0a0.jpg | Bin 0 -> 4824 bytes .../public/uploads/facebook_a2f158a34a.svg | 1 + ...ea8fe069eeaffc144d5f7323fe6_3fd70d3be4.png | Bin 0 -> 5267 bytes .../public/uploads/instagram_fa068d4893.svg | 1 + apps/web/public/uploads/jane_f553821308.jpeg | Bin 0 -> 4790 bytes .../public/uploads/jane_smith_5b7b8e75ef.jpg | Bin 0 -> 4462 bytes .../public/uploads/john_doe_1792821758.jpg | Bin 0 -> 2966 bytes .../public/uploads/linkedin_c7173b3a02.svg | 1 + apps/web/public/uploads/logo_6a13c79c4b.png | Bin 0 -> 122960 bytes .../uploads/robert_johnson_93b45a1112.jpg | Bin 0 -> 4491 bytes .../public/uploads/rocket_1_f4ba43fca0.png | Bin 0 -> 575752 bytes .../public/uploads/rocket_2_26370b67c0.png | Bin 0 -> 495865 bytes .../public/uploads/rocket_3_9a94bfe837.png | Bin 0 -> 552522 bytes .../public/uploads/rocket_4_55fae57ea4.png | Bin 0 -> 558981 bytes apps/web/public/uploads/slack_7cf9f40887.svg | 1 + apps/web/public/uploads/tiktok_da060f5c94.svg | 1 + .../public/uploads/twitterx_83bf8af0d3.svg | 1 + .../uploads/tyler_durden_77d84b929a.jpg | Bin 0 -> 2723 bytes .../web/public/uploads/youtube_42df1b73a9.svg | 1 + apps/web/sample/strapi/articles.en.json | 6019 ++++++ apps/web/sample/strapi/articles.fr.json | 15187 ++++++++++++++++ apps/web/sample/strapi/blog-page.en.json | 54 + apps/web/sample/strapi/blog-page.fr.json | 54 + apps/web/sample/strapi/global.en.json | 235 + apps/web/sample/strapi/global.fr.json | 235 + apps/web/sample/strapi/pages.en.json | 2583 +++ apps/web/sample/strapi/pages.fr.json | 2323 +++ apps/web/sample/strapi/product-page.en.json | 62 + apps/web/sample/strapi/product-page.fr.json | 62 + apps/web/sample/strapi/products.en.json | 2980 +++ apps/web/sample/strapi/products.fr.json | 3200 ++++ apps/web/sample/strapi/redirections.json | 10 + apps/web/tailwind.config.ts | 106 + apps/web/tsconfig.json | 41 + apps/web/turbo.json | 11 + apps/web/types/strapi.ts | 19 + apps/web/types/three-fiber.d.ts | 18 + apps/web/types/types.ts | 56 + apps/web/wiring.fixture.json | 11 + apps/web/wrangler.jsonc | 52 + apps/web/wrangler.template.jsonc | 60 + infra/terraform/cloudflare-r2/component.yaml | 62 + .../cloudflare-r2/docs/architecture.md | 29 + .../terraform/cloudflare-r2/docs/overview.md | 19 + infra/terraform/cloudflare-r2/docs/runbook.md | 20 + .../cloudflare-r2/terraform/adopt.tf | 38 + .../cloudflare-r2/terraform/backend.tf | 5 + .../terraform/cloudflare-r2/terraform/main.tf | 120 + .../cloudflare-r2/terraform/outputs.tf | 2 + .../cloudflare-r2/terraform/variables.tf | 2 + pnpm-lock.yaml | 9896 +++++++++- pnpm-workspace.yaml | 7 + specs/epics/README.md | 2 +- .../strapi-launchpad/IMPLEMENTATION-STATUS.md | 34 +- specs/epics/strapi-launchpad/README.md | 2 +- tests/web/component.yaml | 31 + tests/web/docs/architecture.md | 11 + tests/web/docs/overview.md | 20 + tests/web/docs/runbook.md | 26 + tests/web/eslint.config.js | 2 + tests/web/package.json | 24 + tests/web/src/client.test.ts | 35 + tests/web/src/proxy.test.ts | 27 + tests/web/src/routes.test.ts | 25 + tests/web/src/sample.test.ts | 69 + tests/web/src/site.test.ts | 60 + tests/web/tsconfig.json | 17 + tests/web/vitest.config.ts | 19 + tooling/catalog/gen-component-docs.py | 550 + 210 files changed, 66449 insertions(+), 643 deletions(-) create mode 100644 apps/web/.dev.vars.example create mode 100644 apps/web/.env.example create mode 100644 apps/web/LICENSE.md create mode 100644 apps/web/README.md create mode 100644 apps/web/app/[locale]/(marketing)/ClientSlugHandler.tsx create mode 100644 apps/web/app/[locale]/(marketing)/[slug]/loading.tsx create mode 100644 apps/web/app/[locale]/(marketing)/[slug]/page.tsx create mode 100644 apps/web/app/[locale]/(marketing)/blog/[slug]/loading.tsx create mode 100644 apps/web/app/[locale]/(marketing)/blog/[slug]/page.tsx create mode 100644 apps/web/app/[locale]/(marketing)/blog/loading.tsx create mode 100644 apps/web/app/[locale]/(marketing)/blog/page.tsx create mode 100644 apps/web/app/[locale]/(marketing)/page.tsx create mode 100644 apps/web/app/[locale]/(marketing)/products/[slug]/loading.tsx create mode 100644 apps/web/app/[locale]/(marketing)/products/[slug]/page.tsx create mode 100644 apps/web/app/[locale]/(marketing)/products/loading.tsx create mode 100644 apps/web/app/[locale]/(marketing)/products/page.tsx create mode 100644 apps/web/app/[locale]/layout.tsx create mode 100644 apps/web/app/[locale]/sign-up/page.tsx create mode 100644 apps/web/app/api/exit-preview/route.ts create mode 100644 apps/web/app/api/health/route.ts create mode 100644 apps/web/app/api/preview/route.ts create mode 100644 apps/web/app/context/SlugContext.tsx create mode 100644 apps/web/app/favicon.ico create mode 100644 apps/web/app/globals.css create mode 100644 apps/web/app/layout.tsx create mode 100644 apps/web/app/prism.css create mode 100644 apps/web/cloudflare-env.d.ts create mode 100644 apps/web/component.yaml create mode 100644 apps/web/components.json create mode 100644 apps/web/components/article-content.tsx create mode 100644 apps/web/components/banner.tsx create mode 100644 apps/web/components/beam/index.tsx create mode 100644 apps/web/components/beam/styles.module.css create mode 100644 apps/web/components/blog-card.tsx create mode 100644 apps/web/components/blog-layout.tsx create mode 100644 apps/web/components/blog-post-rows.tsx create mode 100644 apps/web/components/blur-image.tsx create mode 100644 apps/web/components/container.tsx create mode 100644 apps/web/components/decorations/ambient-color.tsx create mode 100644 apps/web/components/decorations/cover.tsx create mode 100644 apps/web/components/decorations/shooting-star.tsx create mode 100644 apps/web/components/decorations/star-background.tsx create mode 100644 apps/web/components/draft-mode-banner.tsx create mode 100644 apps/web/components/dynamic-zone/brands.tsx create mode 100644 apps/web/components/dynamic-zone/cta.tsx create mode 100644 apps/web/components/dynamic-zone/faq.tsx create mode 100644 apps/web/components/dynamic-zone/features/card.tsx create mode 100644 apps/web/components/dynamic-zone/features/feature-icon-container.tsx create mode 100644 apps/web/components/dynamic-zone/features/icon-container.tsx create mode 100644 apps/web/components/dynamic-zone/features/index.tsx create mode 100644 apps/web/components/dynamic-zone/features/skeletons/first.tsx create mode 100644 apps/web/components/dynamic-zone/features/skeletons/fourth.tsx create mode 100644 apps/web/components/dynamic-zone/features/skeletons/second.tsx create mode 100644 apps/web/components/dynamic-zone/features/skeletons/third.tsx create mode 100644 apps/web/components/dynamic-zone/form-next-to-section.tsx create mode 100644 apps/web/components/dynamic-zone/hero.tsx create mode 100644 apps/web/components/dynamic-zone/how-it-works/card.tsx create mode 100644 apps/web/components/dynamic-zone/how-it-works/index.tsx create mode 100644 apps/web/components/dynamic-zone/launches.tsx create mode 100644 apps/web/components/dynamic-zone/manager.tsx create mode 100644 apps/web/components/dynamic-zone/pricing.tsx create mode 100644 apps/web/components/dynamic-zone/related-articles.tsx create mode 100644 apps/web/components/dynamic-zone/related-products.tsx create mode 100644 apps/web/components/dynamic-zone/testimonials/index.tsx create mode 100644 apps/web/components/dynamic-zone/testimonials/slider.tsx create mode 100644 apps/web/components/dynamic-zone/testimonials/testimonials-marquee.tsx create mode 100644 apps/web/components/elements/button.tsx create mode 100644 apps/web/components/elements/heading.tsx create mode 100644 apps/web/components/elements/subheading.tsx create mode 100644 apps/web/components/footer.tsx create mode 100644 apps/web/components/gradient-container.tsx create mode 100644 apps/web/components/icons/external-link.tsx create mode 100644 apps/web/components/icons/illustrations.tsx create mode 100644 apps/web/components/icons/x.tsx create mode 100644 apps/web/components/locale-switcher.tsx create mode 100644 apps/web/components/logo.tsx create mode 100644 apps/web/components/navbar/desktop-navbar.tsx create mode 100644 apps/web/components/navbar/index.tsx create mode 100644 apps/web/components/navbar/mobile-navbar.tsx create mode 100644 apps/web/components/navbar/navbar-item.tsx create mode 100644 apps/web/components/preview.tsx create mode 100644 apps/web/components/products/featured.tsx create mode 100644 apps/web/components/products/modal.tsx create mode 100644 apps/web/components/products/product-items.tsx create mode 100644 apps/web/components/products/single-product.tsx create mode 100644 apps/web/components/register.tsx create mode 100644 apps/web/components/skeletons/page-skeleton.tsx create mode 100644 apps/web/components/toast.tsx create mode 100644 apps/web/components/ui/animated-modal.tsx create mode 100644 apps/web/components/ui/animated-tooltip.tsx create mode 100644 apps/web/components/ui/canvas-reveal-effect.tsx create mode 100644 apps/web/components/ui/data/globe.json create mode 100644 apps/web/components/ui/globe.tsx create mode 100644 apps/web/components/ui/sparkles.tsx create mode 100644 apps/web/components/ui/sticky-scroll.tsx create mode 100644 apps/web/components/ui/strapi-media.tsx create mode 100644 apps/web/context/cart-context.tsx create mode 100644 apps/web/docs/architecture.md create mode 100644 apps/web/docs/overview.md create mode 100644 apps/web/docs/runbook.md create mode 100644 apps/web/eslint.config.mjs create mode 100644 apps/web/i18n.config.ts create mode 100644 apps/web/lib/next-metadata.ts create mode 100644 apps/web/lib/shared/PageContent.tsx create mode 100644 apps/web/lib/shared/metadata.ts create mode 100644 apps/web/lib/site.ts create mode 100644 apps/web/lib/strapi/client.ts create mode 100644 apps/web/lib/strapi/index.ts create mode 100644 apps/web/lib/strapi/sample-redirections.ts create mode 100644 apps/web/lib/strapi/sample.ts create mode 100644 apps/web/lib/strapi/sourceMap.ts create mode 100644 apps/web/lib/strapi/spreadStrapiData.ts create mode 100644 apps/web/lib/strapi/strapiImage.ts create mode 100644 apps/web/lib/utils.ts create mode 100644 apps/web/next.config.ts create mode 100644 apps/web/open-next.config.ts create mode 100644 apps/web/package.json create mode 100644 apps/web/postcss.config.mjs create mode 100644 apps/web/proxy.ts create mode 100644 apps/web/public/uploads/150_1_72b31e9d92.jpeg create mode 100644 apps/web/public/uploads/150_3_92cafa8276.jpeg create mode 100644 apps/web/public/uploads/150_4_735f9c676c.jpeg create mode 100644 apps/web/public/uploads/150_6_6425ed4e29.jpeg create mode 100644 apps/web/public/uploads/150_ec0263c9c6.jpeg create mode 100644 apps/web/public/uploads/1c29a4618a32311bcb30f8766f125410_3db99ce60b.png create mode 100644 apps/web/public/uploads/6a212f698ee7a5b7fcad6703d90f4cc0_224039d0e6.png create mode 100644 apps/web/public/uploads/7ee6c51f86a8779f1ac3fb687b305e50_a0b0a22418.png create mode 100644 apps/web/public/uploads/8fe214ce0671c82b2dffba3aa6968f38_afa1e9fd29.png create mode 100644 apps/web/public/uploads/A_futuristic_scene_showing_digital_content_being_launched_into_space_with_high_tech_satellites_orbiting_Earth_symbolizing_fast_global_content_deliver_1e5ad34267.webp create mode 100644 apps/web/public/uploads/A_futuristic_web_development_scene_showing_the_integration_of_a_content_management_system_Strapi_with_a_web_framework_Next_js_On_one_side_a_user_94b9fc7c0d.webp create mode 100644 apps/web/public/uploads/A_natural_setting_where_a_team_of_professionals_is_launching_a_marketing_campaign_The_scene_shows_a_modern_office_with_large_windows_overlooking_a_ci_165bacb7dd.webp create mode 100644 apps/web/public/uploads/Blog_bd35597734.jpg create mode 100644 apps/web/public/uploads/Contact_ccff6af752.jpg create mode 100644 apps/web/public/uploads/FAQ_576e799607.jpg create mode 100644 apps/web/public/uploads/Launch_Pad_2ce50f287f.jpg create mode 100644 apps/web/public/uploads/Pricing_8c8f61211e.jpg create mode 100644 apps/web/public/uploads/Products_e1d1d2b0bf.jpg create mode 100644 apps/web/public/uploads/alfred_7432e6015c.jpeg create mode 100644 apps/web/public/uploads/dashboard_106c0d6b4b.png create mode 100644 apps/web/public/uploads/dora_mirta_fb6c81be88.jpg create mode 100644 apps/web/public/uploads/enily_davis_44973ee0a0.jpg create mode 100644 apps/web/public/uploads/facebook_a2f158a34a.svg create mode 100644 apps/web/public/uploads/fe031ea8fe069eeaffc144d5f7323fe6_3fd70d3be4.png create mode 100644 apps/web/public/uploads/instagram_fa068d4893.svg create mode 100644 apps/web/public/uploads/jane_f553821308.jpeg create mode 100644 apps/web/public/uploads/jane_smith_5b7b8e75ef.jpg create mode 100644 apps/web/public/uploads/john_doe_1792821758.jpg create mode 100644 apps/web/public/uploads/linkedin_c7173b3a02.svg create mode 100644 apps/web/public/uploads/logo_6a13c79c4b.png create mode 100644 apps/web/public/uploads/robert_johnson_93b45a1112.jpg create mode 100644 apps/web/public/uploads/rocket_1_f4ba43fca0.png create mode 100644 apps/web/public/uploads/rocket_2_26370b67c0.png create mode 100644 apps/web/public/uploads/rocket_3_9a94bfe837.png create mode 100644 apps/web/public/uploads/rocket_4_55fae57ea4.png create mode 100644 apps/web/public/uploads/slack_7cf9f40887.svg create mode 100644 apps/web/public/uploads/tiktok_da060f5c94.svg create mode 100644 apps/web/public/uploads/twitterx_83bf8af0d3.svg create mode 100644 apps/web/public/uploads/tyler_durden_77d84b929a.jpg create mode 100644 apps/web/public/uploads/youtube_42df1b73a9.svg create mode 100644 apps/web/sample/strapi/articles.en.json create mode 100644 apps/web/sample/strapi/articles.fr.json create mode 100644 apps/web/sample/strapi/blog-page.en.json create mode 100644 apps/web/sample/strapi/blog-page.fr.json create mode 100644 apps/web/sample/strapi/global.en.json create mode 100644 apps/web/sample/strapi/global.fr.json create mode 100644 apps/web/sample/strapi/pages.en.json create mode 100644 apps/web/sample/strapi/pages.fr.json create mode 100644 apps/web/sample/strapi/product-page.en.json create mode 100644 apps/web/sample/strapi/product-page.fr.json create mode 100644 apps/web/sample/strapi/products.en.json create mode 100644 apps/web/sample/strapi/products.fr.json create mode 100644 apps/web/sample/strapi/redirections.json create mode 100644 apps/web/tailwind.config.ts create mode 100644 apps/web/tsconfig.json create mode 100644 apps/web/turbo.json create mode 100644 apps/web/types/strapi.ts create mode 100644 apps/web/types/three-fiber.d.ts create mode 100644 apps/web/types/types.ts create mode 100644 apps/web/wiring.fixture.json create mode 100644 apps/web/wrangler.jsonc create mode 100644 apps/web/wrangler.template.jsonc create mode 100644 infra/terraform/cloudflare-r2/component.yaml create mode 100644 infra/terraform/cloudflare-r2/docs/architecture.md create mode 100644 infra/terraform/cloudflare-r2/docs/overview.md create mode 100644 infra/terraform/cloudflare-r2/docs/runbook.md create mode 100644 infra/terraform/cloudflare-r2/terraform/adopt.tf create mode 100644 infra/terraform/cloudflare-r2/terraform/backend.tf create mode 100644 infra/terraform/cloudflare-r2/terraform/main.tf create mode 100644 infra/terraform/cloudflare-r2/terraform/outputs.tf create mode 100644 infra/terraform/cloudflare-r2/terraform/variables.tf create mode 100644 tests/web/component.yaml create mode 100644 tests/web/docs/architecture.md create mode 100644 tests/web/docs/overview.md create mode 100644 tests/web/docs/runbook.md create mode 100644 tests/web/eslint.config.js create mode 100644 tests/web/package.json create mode 100644 tests/web/src/client.test.ts create mode 100644 tests/web/src/proxy.test.ts create mode 100644 tests/web/src/routes.test.ts create mode 100644 tests/web/src/sample.test.ts create mode 100644 tests/web/src/site.test.ts create mode 100644 tests/web/tsconfig.json create mode 100644 tests/web/vitest.config.ts create mode 100644 tooling/catalog/gen-component-docs.py diff --git a/README.md b/README.md index a28212b..6461ec1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,104 @@ # strapi-launchpad -[Vercel's LaunchPad: Next.js × Strapi Starter](https://github.com/strapi/LaunchPad) on -**Cloudflare Workers**, deployed by [Orun](https://github.com/sourceplane/orun) to stage -and prod on every merge, and then packaged as an Orun baseline. - -This commit is the repository's frame: `intent.yaml` (with the placeholder -workspace `ws_CHANGE_ME`, so CI plans nothing until it is linked), the Orun -CI workflow, the shared TypeScript and ESLint configuration, and the spec -index. The work is tracked as an epic under [`specs/epics`](specs/epics/README.md). +The Next.js front end of [LaunchPad](https://github.com/strapi/LaunchPad) +(the template Vercel lists as LaunchPad: Next.js × Strapi Starter) — a +marketing site whose home page is built from Strapi's dynamic zones, with +pricing, FAQ and contact pages, a blog and a product catalogue, in English +and French, every Strapi read a `"use cache"` entry, and draft mode for +Strapi's preview — running on **Cloudflare Workers + Static Assets** through +[`@opennextjs/cloudflare`](https://opennext.js.org/cloudflare), with the +Next.js data cache in an **R2 bucket** provisioned by Terraform through +[Orun](https://github.com/sourceplane/orun) and the tag cache and revalidation +queue in **Durable Objects** the Worker itself exports, deployed by +[Orun](https://github.com/sourceplane/orun) to stage and prod on every merge. +Packaging it as an Orun baseline is the next milestone (SL2). + +The Strapi server is not part of it: running Strapi needs a long-lived Node +server (a container), which this baseline does not carry. A fresh build needs +no Strapi project: until its owner connects one — a Strapi Cloud project +running LaunchPad's `strapi/` app — the site renders the template's own seed +as sample content, under a bar that says how to connect one, never a 500. The +owner connects a project by setting its URL as an Orun secret and +redeploying. See [`specs/epics/strapi-launchpad`](specs/epics/strapi-launchpad/README.md) +for the design, the milestones and the as-built status. + +## What is here (the product) + +| Surface | Where | +|---|---| +| The pages: `/[locale]`, `/[locale]/[slug]`, `/[locale]/blog/…`, `/[locale]/products/…`, sign-up; `/api/preview`, `/api/exit-preview`, `/api/health` | `apps/web/app` | +| The site's name and source link | `apps/web/lib/site.ts` (`SITE_NAME`, `SOURCE_URL`) | +| Strapi's cached reads; whether a project is connected | `apps/web/lib/strapi/client.ts` | +| The sample content — the template's seed, as a Strapi that imported it returns it — and its images | `apps/web/sample/strapi`, `apps/web/public/uploads`, `apps/web/lib/strapi/sample.ts` | +| Workers build, cache bindings and deploy contract | `apps/web/next.config.ts`, `open-next.config.ts`, `wrangler.template.jsonc` + `wiring.fixture.json` (→ the committed `wrangler.jsonc`), `component.yaml` | +| The R2 bucket (stage, prod) | `infra/terraform/cloudflare-r2` | +| The wrangler renderer | `tooling/wire` | +| Tests | `tests/web` (the port's seams) | + +## Getting started + +```bash +pnpm install +pnpm run wire:fixture # render apps/web/wrangler.jsonc from the offline fixture +pnpm typecheck +pnpm lint +pnpm test +pnpm build # next build + opennextjs-cloudflare build → apps/web/.open-next +``` + +```bash +pnpm --filter @app/web dev # http://localhost:3000, Next's dev server +pnpm --filter @app/web preview # wrangler dev over the built Worker, a local R2 bucket and local Durable Objects +``` + +With no `STRAPI_URL` both serve the sample content. To run against a project, +put its URL in `apps/web/.env.local` (from `apps/web/.env.example`). Offline, +the e2e's stand-in Strapi answers the site's reads from the same seed: +`python3 testing/lib/fake-strapi.py --sample apps/web/sample/strapi --uploads apps/web/public/uploads --port 4010`. + +## How it maps to Vercel + +| Vercel | Here | +|---|---| +| Next.js hosting (SSR, route handlers, the proxy, draft mode) | One Cloudflare Worker (`.open-next/worker.js`) + Static Assets (`ASSETS`) | +| Cache Components with `"use cache"`, `cacheLife` and `cacheTag` | `"use cache"`, its profile and its tags kept through `experimental.useCache`; every page renders per request from those cached reads | +| Data Cache entries | The R2 bucket bound as `NEXT_INC_CACHE_R2_BUCKET` | +| `revalidateTag` | A sharded Durable Object tag cache (`NEXT_TAG_CACHE_DO_SHARDED`) consulted on every cache read | +| Stale-while-revalidate | A Durable Object queue (`NEXT_CACHE_DO_QUEUE`) that re-renders stale entries through the Worker's `WORKER_SELF_REFERENCE` binding | +| Image Optimization (`sharp`) | Off (`images.unoptimized`): Strapi's media are served as uploaded | +| `NEXT_PUBLIC_API_URL` | The Orun secret `STRAPI_URL` (optional build env) — and, unset, the template's own seed as sample content instead of a failed build | +| `PREVIEW_SECRET` | A Worker secret | +| The Strapi server (`strapi/`) | Not carried: Strapi Cloud (or the owner's own Strapi), connected after the build | +| Deploy on push | Orun applies the bucket and deploys `-web-{stage,prod}` on merge to `main` (`apps/web/component.yaml`) | +| "Deploy with Vercel" (clone the template) | `orun new --blueprint repo-blueprint.yaml` — a new repository, branded, deployed | + +Cache Components are off: `@opennextjs/cloudflare` 1.20 cannot run Next 16's +Cache Components on workerd yet (a Cache Components page answers 500 and then +hangs — opennextjs-cloudflare#1450), so the site keeps upstream's `"use cache"` +reads through `experimental.useCache` and renders every page at request time. +The epic's [IMPLEMENTATION-STATUS](specs/epics/strapi-launchpad/IMPLEMENTATION-STATUS.md) +has the evidence. + +## How the bucket reaches the Worker + +``` +infra/terraform/cloudflare-r2 ──apply (r2-data token)──► orun secret WIRING_CLOUDFLARE_R2 (stage, prod) + │ (each deploy resolves it as it starts; + │ a missing one fails the lane) + ▼ +apps/web dependsOn cloudflare-r2 (enforced on main) · secretEnv WIRING_CLOUDFLARE_R2_ + build: tooling/wire/live.mjs → wrangler.jsonc with the environment's bucket name + (dev, verify-only, renders the fixture) → next build → opennextjs-cloudflare + deploy: workers-deploy token → -web-, its Durable Objects migrated on first deploy +``` + +`wrangler.jsonc` is committed as the fixture render of +`wrangler.template.jsonc`, because the deploy lane's `verify-app-structure` +step checks the config exists before it builds; `testing/e2e.test.sh` fails +if the two disagree. + +## CI + +| Workflow | What it runs | Ships to a product | +|---|---|---| +| `ci.yml` | the Orun pipeline, and the only workflow a product carries: `orun plan --changed`, then one job per lane. A pull request runs the verify lanes (the R2 root planned for stage and prod, the site built and dry-deployed per environment; they neither lint nor run the tests, which `baseline.yml`'s e2e tier runs before every tag), except the bootstrap's own landings (`orun/BASE-*`), where `plan` alone runs and nothing waits for it (the landing checked its commit in the box); a merge applies the R2 bucket, then deploys stage → prod. It plans nothing while `intent.yaml` names the placeholder workspace `ws_CHANGE_ME`, as this repository does. A manual run (Orunbase's Deploy button, or Run workflow on `main`) plans the environment and components it names under the push-to-main trigger, so they deploy as a merge deploys them | yes | diff --git a/apps/web/.dev.vars.example b/apps/web/.dev.vars.example new file mode 100644 index 0000000..c48c8a8 --- /dev/null +++ b/apps/web/.dev.vars.example @@ -0,0 +1,3 @@ +# Worker secrets for `pnpm --filter @app/web preview` (wrangler dev) — copy to +# .dev.vars. Deployed Workers take theirs from `wrangler secret put`. +PREVIEW_SECRET= diff --git a/apps/web/.env.example b/apps/web/.env.example new file mode 100644 index 0000000..1a058b7 --- /dev/null +++ b/apps/web/.env.example @@ -0,0 +1,15 @@ +# Local settings for `pnpm --filter @app/web dev` — copy to .env.local. +# Deployed environments take theirs from Orun secrets (component.yaml); never +# commit a .env.local. + +# Your Strapi project's public URL (e.g. https://.strapiapp.com, or +# http://localhost:1337 for a local Strapi running LaunchPad's strapi/ app). +# Empty: the site renders its bundled sample content. +STRAPI_URL= + +# Strapi's preview secret: /api/preview?secret=… turns on draft mode. Empty: +# preview is refused. +PREVIEW_SECRET= + +# The origin the Open Graph images resolve against. +NEXT_PUBLIC_SITE_URL=http://localhost:3000 diff --git a/apps/web/LICENSE.md b/apps/web/LICENSE.md new file mode 100644 index 0000000..dcf3140 --- /dev/null +++ b/apps/web/LICENSE.md @@ -0,0 +1,34 @@ +# Licence + +The site is the Next.js front end of [strapi/LaunchPad](https://github.com/strapi/LaunchPad) +(`next/`), and its sample content and images are that repository's seed +(`strapi/data/export_20250116105447.tar.gz`). LaunchPad is published under the +MIT License: its `next/README.md` says so and its `strapi/package.json` +declares `"license": "MIT"`. The repository carries no LICENSE file of its +own, so the text below is the standard MIT License, with LaunchPad's authors +— Strapi, the company the template's footer credits, and its contributors — +as the copyright holders. + +--- + +MIT License + +Copyright (c) 2024 Strapi, Inc. and the LaunchPad contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/apps/web/README.md b/apps/web/README.md new file mode 100644 index 0000000..74b0176 --- /dev/null +++ b/apps/web/README.md @@ -0,0 +1,16 @@ +# apps/web + +The site: LaunchPad's Next.js front end ([strapi/LaunchPad](https://github.com/strapi/LaunchPad) +`next/`, MIT — `LICENSE.md`) on Cloudflare Workers + Static Assets through +`@opennextjs/cloudflare`. The repository's README has how to run, connect +Strapi and deploy it; `docs/` describes the component (generated from what it +declares). + +| | | +|---|---| +| The pages and route handlers | `app/` | +| The blocks Strapi's dynamic zones render, the navbar, the footer | `components/` | +| Strapi's cached reads, and the switch to the sample | `lib/strapi/` | +| The sample content and its images | `sample/strapi/`, `public/uploads/` | +| The site's name | `lib/site.ts` | +| The build on Workers | `next.config.ts`, `open-next.config.ts`, `wrangler.template.jsonc` | diff --git a/apps/web/app/[locale]/(marketing)/ClientSlugHandler.tsx b/apps/web/app/[locale]/(marketing)/ClientSlugHandler.tsx new file mode 100644 index 0000000..b12c77b --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/ClientSlugHandler.tsx @@ -0,0 +1,22 @@ +'use client'; + +import { useRouter } from 'next/navigation'; +import { useEffect } from 'react'; + +import { useSlugContext } from '@/app/context/SlugContext'; + +export default function ClientSlugHandler({ + localizedSlugs, +}: { + localizedSlugs: Record; +}) { + const { dispatch } = useSlugContext(); + + useEffect(() => { + if (localizedSlugs) { + dispatch({ type: 'SET_SLUGS', payload: localizedSlugs }); + } + }, [localizedSlugs, dispatch]); + + return null; // This component only handles the state and doesn't render anything. +} diff --git a/apps/web/app/[locale]/(marketing)/[slug]/loading.tsx b/apps/web/app/[locale]/(marketing)/[slug]/loading.tsx new file mode 100644 index 0000000..0ebc568 --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/[slug]/loading.tsx @@ -0,0 +1,43 @@ +import { Container } from '@/components/container'; +import { + PageHeroSkeleton, + SkeletonBlock, +} from '@/components/skeletons/page-skeleton'; + +// The `[slug]` route renders dynamic-zone pages (e.g. /pricing). This fallback +// mirrors the real Pricing layout: a centered hero followed by a 4-column grid +// of plan cards, so the skeleton lines up with the content that replaces it. +export default function Loading() { + return ( +
+ + +
+ {[...Array(4)].map((_, index) => ( + + ))} +
+
+
+ ); +} + +function PlanCardSkeleton() { + return ( +
+
+ + + +
+
+ {[...Array(4)].map((_, index) => ( +
+ + +
+ ))} +
+
+ ); +} diff --git a/apps/web/app/[locale]/(marketing)/[slug]/page.tsx b/apps/web/app/[locale]/(marketing)/[slug]/page.tsx new file mode 100644 index 0000000..799293f --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/[slug]/page.tsx @@ -0,0 +1,58 @@ +import { Metadata } from 'next'; +import { notFound } from 'next/navigation'; + +import ClientSlugHandler from '../ClientSlugHandler'; +import PageContent from '@/lib/shared/PageContent'; +import { generateMetadataObject } from '@/lib/shared/metadata'; +import { fetchCollectionType } from '@/lib/strapi'; +import type { LocaleSlugParamsProps } from '@/types/types'; + +export async function generateMetadata({ + params, +}: LocaleSlugParamsProps): Promise { + const { slug, locale } = await params; + const [pageData] = await fetchCollectionType('pages', { + filters: { + slug: { + $eq: slug, + }, + locale: locale, + }, + }); + + // A slug with no page is a 404 (upstream read `.seo` of undefined). + if (!pageData) notFound(); + + const seo = pageData.seo; + const metadata = generateMetadataObject(seo); + return metadata; +} + +export default async function Page({ params }: LocaleSlugParamsProps) { + const { slug, locale } = await params; + const [pageData] = await fetchCollectionType('pages', { + filters: { + slug: { + $eq: slug, + }, + locale: locale, + }, + }); + + if (!pageData) notFound(); + + const localizedSlugs = pageData.localizations?.reduce( + (acc: Record, localization: any) => { + acc[localization.locale] = localization.slug; + return acc; + }, + { [locale]: slug } + ); + + return ( + <> + + + + ); +} diff --git a/apps/web/app/[locale]/(marketing)/blog/[slug]/loading.tsx b/apps/web/app/[locale]/(marketing)/blog/[slug]/loading.tsx new file mode 100644 index 0000000..63819ba --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/blog/[slug]/loading.tsx @@ -0,0 +1,33 @@ +import { Container } from '@/components/container'; +import { SkeletonBlock } from '@/components/skeletons/page-skeleton'; + +export default function Loading() { + return ( +
+ +
+ {/* Title */} + + + {/* Meta info */} +
+ + +
+ + {/* Featured image */} + + + {/* Content */} +
+ {['w-full', 'w-11/12', 'w-10/12', 'w-full', 'w-9/12', 'w-11/12'].map( + (width, index) => ( + + ) + )} +
+
+
+
+ ); +} diff --git a/apps/web/app/[locale]/(marketing)/blog/[slug]/page.tsx b/apps/web/app/[locale]/(marketing)/blog/[slug]/page.tsx new file mode 100644 index 0000000..f6c9b99 --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/blog/[slug]/page.tsx @@ -0,0 +1,38 @@ +import ClientSlugHandler from '../../ClientSlugHandler'; +import { ArticleContent } from '@/components/article-content'; +import { BlogLayout } from '@/components/blog-layout'; +import { fetchCollectionType } from '@/lib/strapi'; +import type { Article, LocaleSlugParamsProps } from '@/types/types'; + +export default async function SingleArticlePage({ + params, +}: LocaleSlugParamsProps) { + const { slug, locale } = await params; + const [article] = await fetchCollectionType('articles', { + filters: { + slug: { + $eq: slug, + }, + }, + locale, + }); + + if (!article) { + return
Blog not found
; + } + + const localizedSlugs = article.localizations.reduce( + (acc: Record, localization: any) => { + acc[localization.locale] = localization.slug; + return acc; + }, + { [locale]: slug } + ); + + return ( + + + + + ); +} diff --git a/apps/web/app/[locale]/(marketing)/blog/loading.tsx b/apps/web/app/[locale]/(marketing)/blog/loading.tsx new file mode 100644 index 0000000..7bad7df --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/blog/loading.tsx @@ -0,0 +1,31 @@ +import { Container } from '@/components/container'; +import { + PageHeroSkeleton, + SkeletonBlock, +} from '@/components/skeletons/page-skeleton'; + +export default function Loading() { + return ( +
+ + + + {/* Featured article card */} + + + {/* Article rows */} +
+ {[...Array(4)].map((_, index) => ( +
+ +
+ + +
+
+ ))} +
+
+
+ ); +} diff --git a/apps/web/app/[locale]/(marketing)/blog/page.tsx b/apps/web/app/[locale]/(marketing)/blog/page.tsx new file mode 100644 index 0000000..8ed363f --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/blog/page.tsx @@ -0,0 +1,74 @@ +import { IconClipboardText } from '@tabler/icons-react'; +import { type Metadata } from 'next'; + +import ClientSlugHandler from '../ClientSlugHandler'; +import { BlogCard } from '@/components/blog-card'; +import { BlogPostRows } from '@/components/blog-post-rows'; +import { Container } from '@/components/container'; +import { AmbientColor } from '@/components/decorations/ambient-color'; +import { FeatureIconContainer } from '@/components/dynamic-zone/features/feature-icon-container'; +import { Heading } from '@/components/elements/heading'; +import { Subheading } from '@/components/elements/subheading'; +import { generateMetadataObject } from '@/lib/shared/metadata'; +import { fetchCollectionType, fetchSingleType } from '@/lib/strapi'; +import type { Article, LocaleParamsProps } from '@/types/types'; + +export async function generateMetadata({ + params, +}: LocaleParamsProps): Promise { + const { locale } = await params; + const pageData = await fetchSingleType('blog-page', { locale }); + + const seo = pageData.seo; + const metadata = generateMetadataObject(seo); + return metadata; +} + +export default async function Blog({ params }: LocaleParamsProps) { + const { locale } = await params; + const pageData = await fetchSingleType('blog-page', { + locale: locale, + }); + const [firstArticle, ...articles] = await fetchCollectionType( + 'articles', + { + filters: { locale: { $eq: locale } }, + } + ); + + const localizedSlugs = pageData.localizations.reduce( + (acc: Record, localization: any) => { + acc[localization.locale] = 'blog'; + return acc; + }, + { [locale]: 'blog' } + ); + + return ( +
+ + + +
+ + + + + {pageData.heading} + + + {pageData.sub_heading} + +
+ + + + +
+
+ ); +} diff --git a/apps/web/app/[locale]/(marketing)/page.tsx b/apps/web/app/[locale]/(marketing)/page.tsx new file mode 100644 index 0000000..715ffc3 --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/page.tsx @@ -0,0 +1,54 @@ +import { Metadata } from 'next'; + +import ClientSlugHandler from './ClientSlugHandler'; +import PageContent from '@/lib/shared/PageContent'; +import { generateMetadataObject } from '@/lib/shared/metadata'; +import { fetchCollectionType } from '@/lib/strapi'; +import type { LocaleParamsProps } from '@/types/types'; + +export async function generateMetadata({ + params, +}: LocaleParamsProps): Promise { + const { locale } = await params; + + const [pageData] = await fetchCollectionType('pages', { + filters: { + slug: { + $eq: 'homepage', + }, + locale: locale, + }, + }); + + const seo = pageData.seo; + const metadata = generateMetadataObject(seo); + return metadata; +} + +export default async function HomePage({ params }: LocaleParamsProps) { + const { locale } = await params; + + const [pageData] = await fetchCollectionType('pages', { + filters: { + slug: { + $eq: 'homepage', + }, + locale: locale, + }, + }); + + const localizedSlugs = pageData.localizations?.reduce( + (acc: Record, localization: any) => { + acc[localization.locale] = ''; + return acc; + }, + { [locale]: '' } + ); + + return ( + <> + + + + ); +} diff --git a/apps/web/app/[locale]/(marketing)/products/[slug]/loading.tsx b/apps/web/app/[locale]/(marketing)/products/[slug]/loading.tsx new file mode 100644 index 0000000..efde9d2 --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/products/[slug]/loading.tsx @@ -0,0 +1,27 @@ +import { Container } from '@/components/container'; +import { SkeletonBlock } from '@/components/skeletons/page-skeleton'; + +export default function Loading() { + return ( +
+ +
+ {/* Image */} + + + {/* Details */} +
+ + +
+ {[...Array(4)].map((_, index) => ( + + ))} +
+ +
+
+
+
+ ); +} diff --git a/apps/web/app/[locale]/(marketing)/products/[slug]/page.tsx b/apps/web/app/[locale]/(marketing)/products/[slug]/page.tsx new file mode 100644 index 0000000..0a74b11 --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/products/[slug]/page.tsx @@ -0,0 +1,72 @@ +import { Metadata } from 'next'; +import { redirect } from 'next/navigation'; + +import { Container } from '@/components/container'; +import ClientSlugHandler from '../../ClientSlugHandler'; +import { AmbientColor } from '@/components/decorations/ambient-color'; +import DynamicZoneManager from '@/components/dynamic-zone/manager'; +import { SingleProduct } from '@/components/products/single-product'; +import { generateMetadataObject } from '@/lib/shared/metadata'; +import { fetchCollectionType, fetchSingleType } from '@/lib/strapi'; +import type { LocaleSlugParamsProps, Product } from '@/types/types'; + +export async function generateMetadata({ + params, +}: LocaleSlugParamsProps): Promise { + const { slug, locale } = await params; + + const [pageData] = await fetchCollectionType('products', { + filters: { slug: { $eq: slug } }, + locale, + }); + + const seo = pageData; + const metadata = generateMetadataObject(seo); + return metadata; +} + +export default async function SingleProductPage({ + params, +}: LocaleSlugParamsProps) { + const { slug, locale } = await params; + + const [pageData] = await fetchCollectionType('products', { + filters: { slug: { $eq: slug } }, + locale, + }); + + const globalData = await fetchSingleType('global', { locale }); + + if (!pageData) { + redirect('/products'); + } + + const localizedSlugs = pageData.localizations?.reduce( + (acc: Record, localization: any) => { + acc[localization.locale] = localization.slug; + return acc; + }, + { [locale]: slug } + ) || {}; + + return ( +
+ + + + + {pageData?.dynamic_zone && ( + + )} + +
+ ); +} diff --git a/apps/web/app/[locale]/(marketing)/products/loading.tsx b/apps/web/app/[locale]/(marketing)/products/loading.tsx new file mode 100644 index 0000000..71686b0 --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/products/loading.tsx @@ -0,0 +1,24 @@ +import { Container } from '@/components/container'; +import { + PageHeroSkeleton, + SkeletonBlock, +} from '@/components/skeletons/page-skeleton'; + +export default function Loading() { + return ( +
+ + +
+ {[...Array(8)].map((_, index) => ( +
+ + + +
+ ))} +
+
+
+ ); +} diff --git a/apps/web/app/[locale]/(marketing)/products/page.tsx b/apps/web/app/[locale]/(marketing)/products/page.tsx new file mode 100644 index 0000000..34b5b22 --- /dev/null +++ b/apps/web/app/[locale]/(marketing)/products/page.tsx @@ -0,0 +1,74 @@ +import { IconShoppingCartUp } from '@tabler/icons-react'; +import { Metadata } from 'next'; + +import ClientSlugHandler from '../ClientSlugHandler'; +import { Container } from '@/components/container'; +import { AmbientColor } from '@/components/decorations/ambient-color'; +import { FeatureIconContainer } from '@/components/dynamic-zone/features/feature-icon-container'; +import { Heading } from '@/components/elements/heading'; +import { Subheading } from '@/components/elements/subheading'; +import { Featured } from '@/components/products/featured'; +import { ProductItems } from '@/components/products/product-items'; +import { generateMetadataObject } from '@/lib/shared/metadata'; +import { fetchCollectionType, fetchSingleType } from '@/lib/strapi'; +import { LocaleParamsProps, Product } from '@/types/types'; + +export async function generateMetadata({ + params, +}: LocaleParamsProps): Promise { + const { locale } = await params; + const pageData = await fetchSingleType('product-page', { locale }); + + const seo = pageData?.seo; + const metadata = generateMetadataObject(seo); + return metadata; +} + +export default async function Products({ params }: LocaleParamsProps) { + const { locale } = await params; + + // Fetch the product-page and products data + const pageData = await fetchSingleType('product-page', { locale }); + const products = await fetchCollectionType('products', { locale }); + + const localizedSlugs = pageData.localizations.reduce( + (acc: Record, localization: any) => { + acc[localization.locale] = 'products'; + return acc; + }, + { [locale]: 'products' } + ); + const featured = products.filter( + (product: { featured?: boolean }) => product.featured + ); + + return ( +
+ + + + + + + + {pageData.heading} + + + {pageData.sub_heading} + + + + +
+ ); +} diff --git a/apps/web/app/[locale]/layout.tsx b/apps/web/app/[locale]/layout.tsx new file mode 100644 index 0000000..ae2e50f --- /dev/null +++ b/apps/web/app/[locale]/layout.tsx @@ -0,0 +1,66 @@ +import { Metadata } from 'next'; +import { ViewTransitions } from 'next-view-transitions'; +import { Inter } from 'next/font/google'; +import { draftMode } from 'next/headers'; +import type { PropsWithChildren } from 'react'; +import React from 'react'; + +import { Banner } from '@/components/banner'; +import { DraftModeBanner } from '@/components/draft-mode-banner'; +import { Footer } from '@/components/footer'; +import { Navbar } from '@/components/navbar'; +import { AIToast } from '@/components/toast'; +import { CartProvider } from '@/context/cart-context'; +import { generateMetadataObject } from '@/lib/shared/metadata'; +import { fetchSingleType, isStrapiConnected } from '@/lib/strapi'; +import { cn } from '@/lib/utils'; +import type { LocaleParamsProps } from '@/types/types'; + +const inter = Inter({ + subsets: ['latin'], + display: 'swap', + weight: ['400', '500', '600', '700', '800', '900'], +}); + +// Default Global SEO for pages without them +export async function generateMetadata({ + params, +}: PropsWithChildren): Promise { + const { locale } = await params; + const pageData = await fetchSingleType('global', { locale }); + + const seo = pageData.seo; + const metadata = generateMetadataObject(seo); + return metadata; +} + +export default async function LocaleLayout({ + children, + params, +}: PropsWithChildren) { + const { isEnabled: isDraftMode } = await draftMode(); + const { locale } = await params; + const pageData = await fetchSingleType('global', { locale }); + const isDemo = process.env.NEXT_IS_DEMO === 'true'; + const isSample = !isStrapiConnected(); + + return ( + + +
+ {(isDemo || isSample) && } + + {children} +
+ + {isDraftMode && } +
+
+
+ ); +} diff --git a/apps/web/app/[locale]/sign-up/page.tsx b/apps/web/app/[locale]/sign-up/page.tsx new file mode 100644 index 0000000..f80693d --- /dev/null +++ b/apps/web/app/[locale]/sign-up/page.tsx @@ -0,0 +1,11 @@ +import { AmbientColor } from '@/components/decorations/ambient-color'; +import { Register } from '@/components/register'; + +export default function RegisterPage() { + return ( +
+ + +
+ ); +} diff --git a/apps/web/app/api/exit-preview/route.ts b/apps/web/app/api/exit-preview/route.ts new file mode 100644 index 0000000..81ddc79 --- /dev/null +++ b/apps/web/app/api/exit-preview/route.ts @@ -0,0 +1,9 @@ +import { draftMode } from 'next/headers'; +import { NextResponse } from 'next/server'; + +export async function GET() { + const draft = await draftMode(); + draft.disable(); + + return NextResponse.json({ success: true }); +} \ No newline at end of file diff --git a/apps/web/app/api/health/route.ts b/apps/web/app/api/health/route.ts new file mode 100644 index 0000000..cf53e1d --- /dev/null +++ b/apps/web/app/api/health/route.ts @@ -0,0 +1,13 @@ +import { isStrapiConnected } from '@/lib/strapi'; + +// The deploy's smoke test and the deployment record's probe: answered by the +// Worker itself (no static file can), saying whether a Strapi project is +// connected or the site is serving its bundled sample content. Names no URL. +export const dynamic = 'force-dynamic'; + +export function GET() { + return Response.json({ + ok: true, + content: isStrapiConnected() ? 'strapi' : 'sample', + }); +} diff --git a/apps/web/app/api/preview/route.ts b/apps/web/app/api/preview/route.ts new file mode 100644 index 0000000..9612435 --- /dev/null +++ b/apps/web/app/api/preview/route.ts @@ -0,0 +1,27 @@ +import { draftMode } from 'next/headers'; +import { redirect } from 'next/navigation'; + +export const GET = async (request: Request) => { + const { searchParams } = new URL(request.url); + const secret = searchParams.get('secret'); + const url = searchParams.get('url') ?? '/'; + const status = searchParams.get('status'); + + // Check the secret and next parameters + // This secret should only be known to this route handler and the CMS + if (secret !== process.env.PREVIEW_SECRET) { + return new Response('Invalid token', { status: 401 }); + } + + const draft = await draftMode(); + + if (status === 'published') { + // Make sure draft mode is disabled so we only query published content + draft.disable(); + } else { + // Enable draft mode so we can query draft content + draft.enable(); + } + + redirect(url); +}; diff --git a/apps/web/app/context/SlugContext.tsx b/apps/web/app/context/SlugContext.tsx new file mode 100644 index 0000000..e4c8b5d --- /dev/null +++ b/apps/web/app/context/SlugContext.tsx @@ -0,0 +1,44 @@ +'use client'; + +import React, { createContext, useContext, useReducer } from 'react'; + +type State = { + localizedSlugs: Record; +}; + +type Action = { + type: 'SET_SLUGS'; + payload: Record; +}; + +const SlugContext = createContext<{ + state: State; + dispatch: React.Dispatch; +} | null>(null); + +const slugReducer = (state: State, action: Action): State => { + switch (action.type) { + case 'SET_SLUGS': + return { ...state, localizedSlugs: action.payload }; + default: + return state; + } +}; + +export const SlugProvider = ({ children }: { children: React.ReactNode }) => { + const [state, dispatch] = useReducer(slugReducer, { localizedSlugs: {} }); + + return ( + + {children} + + ); +}; + +export const useSlugContext = () => { + const context = useContext(SlugContext); + if (!context) { + throw new Error('useSlugContext must be used within a SlugProvider'); + } + return context; +}; diff --git a/apps/web/app/favicon.ico b/apps/web/app/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..718d6fea4835ec2d246af9800eddb7ffb276240c GIT binary patch literal 25931 zcmeHv30#a{`}aL_*G&7qml|y<+KVaDM2m#dVr!KsA!#An?kSQM(q<_dDNCpjEux83 zLb9Z^XxbDl(w>%i@8hT6>)&Gu{h#Oeyszu?xtw#Zb1mO{pgX9699l+Qppw7jXaYf~-84xW z)w4x8?=youko|}Vr~(D$UXIbiXABHh`p1?nn8Po~fxRJv}|0e(BPs|G`(TT%kKVJAdg5*Z|x0leQq0 zkdUBvb#>9F()jo|T~kx@OM8$9wzs~t2l;K=woNssA3l6|sx2r3+kdfVW@e^8e*E}v zA1y5{bRi+3Z`uD3{F7LgFJDdvm;nJilkzDku>BwXH(8ItVCXk*-lSJnR?-2UN%hJ){&rlvg`CDTj z)Bzo!3v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diff --git a/apps/web/app/globals.css b/apps/web/app/globals.css new file mode 100644 index 0000000..6c74b36 --- /dev/null +++ b/apps/web/app/globals.css @@ -0,0 +1,24 @@ +@import './prism.css'; +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --foreground-rgb: 255, 255, 255; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + } +} + +body { + color: rgb(var(--foreground-rgb)); +} + +@layer utilities { + .text-balance { + text-wrap: balance; + } +} diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx new file mode 100644 index 0000000..28e8e31 --- /dev/null +++ b/apps/web/app/layout.tsx @@ -0,0 +1,52 @@ +import type { Metadata, Viewport } from 'next'; +import { Suspense } from 'react'; + +import { i18n } from '@/i18n.config'; + +import './globals.css'; + +import { SlugProvider } from '@/app/context/SlugContext'; +import { Preview } from '@/components/preview'; + +// The site's own origin, which relative Open Graph and Twitter image URLs (the +// sample's /uploads/…) resolve against: each build is for one environment +// (NEXT_PUBLIC_SITE_URL — its SITE_URL, else its workers.dev URL; component.yaml). +export const metadata: Metadata = { + metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'), +}; + +export const viewport: Viewport = { + themeColor: [ + { media: '(prefers-color-scheme: light)', color: '#06b6d4' }, + { media: '(prefers-color-scheme: dark)', color: '#06b6d4' }, + ], +}; + +export async function generateStaticParams() { + return i18n.locales.map((locale) => ({ lang: locale })); +} + +function RootLoading() { + return ( +
+
+
+ ); +} + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + + + + }>{children} + + + + ); +} diff --git a/apps/web/app/prism.css b/apps/web/app/prism.css new file mode 100644 index 0000000..dcd8a13 --- /dev/null +++ b/apps/web/app/prism.css @@ -0,0 +1,47 @@ +pre[class*='language-'] { + color: theme('colors.zinc.100'); +} + +.token.tag, +.token.class-name, +.token.selector, +.token.selector .class, +.token.selector.class, +.token.function { + color: theme('colors.blue.400'); +} + +.token.attr-name, +.token.keyword, +.token.rule, +.token.pseudo-class, +.token.important { + color: theme('colors.slate.300'); +} + +.token.module { + color: theme('colors.emerald.400'); +} + +.token.attr-value, +.token.class, +.token.string, +.token.property { + color: theme('colors.teal.300'); +} + +.token.punctuation, +.token.attr-equals { + color: theme('colors.zinc.500'); +} + +.token.unit, +.language-css .token.function { + color: theme('colors.sky.200'); +} + +.token.comment, +.token.operator, +.token.combinator { + color: theme('colors.zinc.400'); +} diff --git a/apps/web/cloudflare-env.d.ts b/apps/web/cloudflare-env.d.ts new file mode 100644 index 0000000..1116f21 --- /dev/null +++ b/apps/web/cloudflare-env.d.ts @@ -0,0 +1,15 @@ +// The bindings the app reads through getCloudflareContext(). `wrangler types` +// would generate this from wrangler.jsonc; the one binding the code touches +// is kept by hand so the build needs no rendered config. +declare global { + interface CloudflareEnv { + ASSETS: { + fetch( + input: string | URL | Request, + init?: RequestInit, + ): Promise; + }; + } +} + +export {}; diff --git a/apps/web/component.yaml b/apps/web/component.yaml new file mode 100644 index 0000000..f621365 --- /dev/null +++ b/apps/web/component.yaml @@ -0,0 +1,120 @@ +apiVersion: sourceplane.io/v1 +kind: Component +metadata: + name: web + description: The LaunchPad marketing site (Next.js on Cloudflare Workers + Static Assets via @opennextjs/cloudflare, per environment; R2 + Durable Objects as the Next.js cache for its Strapi reads; the template's own sample content until a Strapi project is connected) +spec: + type: cloudflare-workers-assets-turbo + lifecycle: production + owner: platform + # Its pages, attached to it in the workspace's catalog: what the Docs + # library shows for it, and what the catalog's docs and runbook checks read. + # Generated from what this manifest and its sources declare. + docs: + overview: docs/overview.md + pages: + - { path: docs/architecture.md, role: architecture, title: Architecture } + - { path: docs/runbook.md, role: runbook, title: Runbook } + # `app`, not `web`: a domain and a component share one name space in the + # catalog, and a domain called `web` hid this component from it. + domain: app + path: apps/web + # Its own lane per environment: the Next.js build is the longest job in the + # plan, and a shared lane would wait on it. + lane: isolated + # INFRA BEFORE APP. The R2 bucket is the Worker's incremental cache, bound + # by name, and the name is rendered into its config during the build from + # the wiring document the cloudflare-r2 root lease-publishes after its + # apply. A job resolves its secrets when it STARTS, so on a merge to main + # this deploy waits for that environment's apply (enforced) and the document + # is there; a pull request deploys nothing, so nothing on one waits + # (advisory). The Durable Objects (tag cache, revalidation queue) need no + # root — the Worker exports their classes and the migration creates them on + # deploy. + dependsOn: + - component: cloudflare-r2 + mode: enforced + modeRules: + - mode: advisory + when: + triggerRef: github-pull-request + secretEnv: + WIRING_CLOUDFLARE_R2_STAGE: "secret://strapi-launchpad/strapi-launchpad/stage/WIRING_CLOUDFLARE_R2" + WIRING_CLOUDFLARE_R2_PROD: "secret://strapi-launchpad/strapi-launchpad/prod/WIRING_CLOUDFLARE_R2" + # The Strapi project, connected after the build by its owner: its public URL + # (https://.strapiapp.com), per environment. The build inlines it + # as the template's NEXT_PUBLIC_API_URL (next.config.ts) — server and + # browser code both read it — so it is build env, not a Worker secret, and + # it is not a credential. BEST-EFFORT, wire-now-seed-later: a key nobody has + # stored yet is skipped when the job resolves its secrets, and a build + # without it is the site on its bundled sample content (the template's own + # seed) with a "connect your Strapi project" bar — so a fresh product + # deploys and serves before its owner has a Strapi project at all. The + # preview secret is read at request time: a Worker secret the owner sets + # (README → Connecting Strapi). + optionalSecretEnv: + STRAPI_URL: "secret://strapi-launchpad/strapi-launchpad/{{ .environment }}/STRAPI_URL" + subscribe: + environments: + - name: dev + profile: verify + - name: stage + profile: verify + profileRules: + - profile: deploy + when: + triggerRef: github-push-main + - name: prod + profile: verify + profileRules: + - profile: deploy + when: + triggerRef: github-push-main + parameters: + nodeVersion: "22" + pnpmVersion: "10.12.1" + + workspaceDir: ../.. + appDir: . + + turboFilter: "@app/web" + wranglerConfig: wrangler.jsonc + + # @opennextjs/cloudflare emits a Worker entrypoint plus a static-assets + # directory bound via ASSETS — both deploy in one `wrangler deploy`. + workerEntrypoint: .open-next/worker.js + assetsDir: .open-next/assets + + # Per-env worker name: strapi-launchpad-web-{dev,stage,prod}. The rendered + # wrangler.jsonc names the same Worker (its self-reference binding needs it). + workerName: strapi-launchpad-web + environmentAwareWorkerName: true + + # The account's workers.dev subdomain; exported to the smoke step as + # ${WORKERS_DEV_SUBDOMAIN} and used to build ${DEPLOYED_URL}. + workersDevSubdomain: your-workers-subdomain + + installCommand: pnpm install --frozen-lockfile + # Render this environment's wrangler config, then build. stage and prod + # render from the wiring document their cloudflare-r2 apply published + # (secretEnv above, resolved before the job's first step); dev, which no + # root applies to and which only verifies, renders from the committed + # fixture. The committed wrangler.jsonc (the fixture render) is what the + # composition's verify-app-structure step finds before this runs. The + # build is for this environment's origin: NEXT_PUBLIC_SITE_URL (the + # metadataBase relative Open Graph images resolve against) is the + # environment's SITE_URL (intent.yaml), else its workers.dev URL. + buildCommand: node ../../tooling/wire/live.mjs --template wrangler.template.jsonc --out wrangler.jsonc --components cloudflare-r2 --env "${ORUN_ENVIRONMENT}" --fixture wiring.fixture.json --fixture-envs dev && NEXT_PUBLIC_SITE_URL="${SITE_URL:-https://strapi-launchpad-web-${ORUN_ENVIRONMENT}.your-workers-subdomain.workers.dev}" pnpm exec turbo run build --filter=@app/web + + # Smoke: `/` redirects to the visitor's locale and the English home page + # renders the site's navigation (its "Pricing" link: in the sample and in + # the template's seed a connected Strapi starts from — not the site's + # name, which is the owner's to change and HTML-escaped when it carries an + # `&` or `'`); and the Worker itself answers /api/health, which no static + # file can. Buffered before grep so an early match cannot SIGPIPE curl. + smokeCommand: 'html=$(curl -sfL "${DEPLOYED_URL}/") && echo "${html}" | grep -q "/en/pricing" && health=$(curl -sf "${DEPLOYED_URL}/api/health") && echo "${health}" | grep -q "\"ok\":true"' + labels: + team: platform + layer: delivery + surface: web + runtime: cloudflare diff --git a/apps/web/components.json b/apps/web/components.json new file mode 100644 index 0000000..926abbb --- /dev/null +++ b/apps/web/components.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "app/globals.css", + "baseColor": "neutral", + "cssVariables": false, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "examples": "@/components/examples", + "blocks": "@/components/blocks" + } +} diff --git a/apps/web/components/article-content.tsx b/apps/web/components/article-content.tsx new file mode 100644 index 0000000..d91caab --- /dev/null +++ b/apps/web/components/article-content.tsx @@ -0,0 +1,32 @@ +'use client'; + +import { + BlocksRenderer, + type BlocksContent, +} from '@strapi/blocks-react-renderer'; +import type { ComponentProps } from 'react'; + +import { BlurImage } from './blur-image'; +import { normalizeStrapiMediaUrl, stripStegaMarkers } from '@/lib/utils'; +import { getStrapiSource } from '@/lib/strapi/sourceMap'; + +type BlockComponents = NonNullable< + ComponentProps['blocks'] +>; + +const ImageBlock: BlockComponents['image'] = ({ image }) => ( + +); + +export const ArticleContent = ({ content }: { content: BlocksContent }) => { + return ; +}; diff --git a/apps/web/components/banner.tsx b/apps/web/components/banner.tsx new file mode 100644 index 0000000..7914b9c --- /dev/null +++ b/apps/web/components/banner.tsx @@ -0,0 +1,49 @@ +import Link from 'next/link'; + +import { SOURCE_URL } from '@/lib/site'; + +/** + * The bar over the navbar. Upstream shows it on its hosted demo + * (NEXT_IS_DEMO); this site also shows it, with how to connect, while it + * renders the bundled sample content because no Strapi project is connected. + */ +export function Banner({ sample = false }: { sample?: boolean }) { + if (sample) { + return ( +
+
+ + Sample content · connect your Strapi project to publish your own ·{' '} + + How to connect Strapi + + +
+
+ ); + } + + return ( +
+
+ + You're exploring the Strapi Launchpad demo ·{' '} + + View the code on GitHub, stars, PRs, and issues are always welcome + + +
+
+ ); +} diff --git a/apps/web/components/beam/index.tsx b/apps/web/components/beam/index.tsx new file mode 100644 index 0000000..77b19df --- /dev/null +++ b/apps/web/components/beam/index.tsx @@ -0,0 +1,70 @@ +'use client'; + +import React, { useEffect, useRef } from 'react'; + +import styles from './styles.module.css'; +import { cn } from '@/lib/utils'; + +const Beam = ({ + showBeam = true, + className, +}: { + showBeam?: boolean; + className?: string; +}) => { + const meteorRef = useRef(null); + + useEffect(() => { + const meteor = meteorRef.current; + + if (showBeam && meteor) { + const handleAnimationEnd = () => { + meteor.style.visibility = 'hidden'; + const animationDelay = Math.floor(Math.random() * (2 - 0) + 0); + const animationDuration = Math.floor(Math.random() * (4 - 0) + 0); + const meteorWidth = Math.floor(Math.random() * (150 - 80) + 80); + meteor.style.setProperty('--meteor-delay', `${animationDelay}s`); + meteor.style.setProperty('--meteor-duration', `${animationDuration}s`); + meteor.style.setProperty('--meteor-width', `${meteorWidth}px`); + + restartAnimation(); + }; + + const handleAnimationStart = () => { + meteor.style.visibility = 'visible'; + }; + + meteor.addEventListener('animationend', handleAnimationEnd); + meteor.addEventListener('animationstart', handleAnimationStart); + + return () => { + // Using the same meteor variable captured in the effect + meteor.removeEventListener('animationend', handleAnimationEnd); + meteor.removeEventListener('animationstart', handleAnimationStart); + }; + } + }, [showBeam]); + + const restartAnimation = () => { + const meteor = meteorRef.current; + if (!meteor) return; + meteor.style.animation = 'none'; + void meteor.offsetWidth; // This forces a reflow, restarting the animation + meteor.style.animation = ''; + }; + + return ( + showBeam && ( + + ) + ); +}; + +export default Beam; diff --git a/apps/web/components/beam/styles.module.css b/apps/web/components/beam/styles.module.css new file mode 100644 index 0000000..2ec4ae0 --- /dev/null +++ b/apps/web/components/beam/styles.module.css @@ -0,0 +1,35 @@ +.meteor { + transform: rotate(-180deg); + animation: meteor 3s linear; + animation-delay: var(--meteor-delay, 0s); + animation-duration: var(--meteor-duration, 2s); +} + +.meteor::before { + content: ''; + position: absolute; + top: 50%; + transform: translateY(-50%); + width: var(--meteor-width, 50px); + height: 1px; + background: linear-gradient( + 90deg, + var(--cyan-500), + var(--blue-500), + transparent + ); +} + +@keyframes meteor { + 0% { + left: 0; + opacity: 0; + } + 70% { + opacity: 1; + } + 100% { + left: 100%; + opacity: 0; + } +} diff --git a/apps/web/components/blog-card.tsx b/apps/web/components/blog-card.tsx new file mode 100644 index 0000000..73512a3 --- /dev/null +++ b/apps/web/components/blog-card.tsx @@ -0,0 +1,141 @@ +import { format } from 'date-fns'; +import { Link } from 'next-view-transitions'; +import Image from 'next/image'; +import React from 'react'; +import Balancer from 'react-wrap-balancer'; + +import { Logo } from './logo'; +import { BlurImage } from '@/components/blur-image'; +import { resolveStrapiMedia } from '@/lib/strapi/strapiImage'; +import { truncate } from '@/lib/utils'; +import { Article } from '@/types/types'; + +export const BlogCard = ({ + article, + locale, +}: { + article: Article; + locale: string; +}) => { + return ( + +
+ {article.image ? ( + + ) : ( +
+ {/* */} +
+ )} +
+
+
+
+ {article.categories?.map((category, idx) => ( +

+ {category.name} +

+ ))} +
+

+ {article.title} +

+

+ {truncate(article.description, 500)} +

+
+
+ {/* {article.author} */} + {/*

{article.author}

*/} +
+

+ {format(new Date(article.publishedAt), 'MMMM dd, yyyy')} +

+
+
+ + ); +}; + +export const BlogCardVertical = ({ + article, + locale, +}: { + article: Article; + locale: string; +}) => { + return ( + +
+ {article.image ? ( + + ) : ( +
+ {/* */} +
+ )} +
+
+
+
+ {article.categories?.map((category, idx) => ( +

+ {category.name} +

+ ))} +
+

+ {article.title} +

+

+ {truncate(article.description, 500)} +

+
+
+ {/* {article.author} +

{article.author}

*/} +
+

+ {format(new Date(article.publishedAt), 'MMMM dd, yyyy')} +

+
+
+ + ); +}; diff --git a/apps/web/components/blog-layout.tsx b/apps/web/components/blog-layout.tsx new file mode 100644 index 0000000..de84b95 --- /dev/null +++ b/apps/web/components/blog-layout.tsx @@ -0,0 +1,100 @@ +import { IconArrowLeft } from '@tabler/icons-react'; +import { format } from 'date-fns'; +import { Link } from 'next-view-transitions'; + +import { Container } from './container'; +import { AmbientColor } from './decorations/ambient-color'; +import DynamicZoneManager from './dynamic-zone/manager'; +import { StrapiMedia } from '@/components/ui/strapi-media'; +import { Article } from '@/types/types'; + +export async function BlogLayout({ + article, + locale, + children, +}: Readonly<{ + article: Article; + locale: string; + children: React.ReactNode; +}>) { + return ( +
+ + +
+ + + Back + +
+
+ {article?.image ? ( + + ) : ( +
+ {/* */} +
+ )} +
+
+
+
+
+ {article.categories?.map((category, idx) => ( +

+ {category.name} +

+ ))} +
+
+

+ {article.title} +

+
+
{children}
+
+
+ {/* +

+ {article.author} +

*/} +
+
+ +
+
+
+
+ {article?.dynamic_zone && ( + + )} +
+
+ ); +} diff --git a/apps/web/components/blog-post-rows.tsx b/apps/web/components/blog-post-rows.tsx new file mode 100644 index 0000000..4a1dc3f --- /dev/null +++ b/apps/web/components/blog-post-rows.tsx @@ -0,0 +1,108 @@ +'use client'; + +import { format } from 'date-fns'; +import FuzzySearch from 'fuzzy-search'; +import { Link } from 'next-view-transitions'; +import React, { useEffect, useState } from 'react'; + +import { truncate } from '@/lib/utils'; +import { Article } from '@/types/types'; + +export const BlogPostRows = ({ + articles, + locale, +}: { + articles: Article[]; + locale: string; +}) => { + const [search, setSearch] = useState(''); + + const searcher = new FuzzySearch(articles, ['title'], { + caseSensitive: false, + }); + + const [results, setResults] = useState(articles); + useEffect(() => { + const results = searcher.search(search); + setResults(results); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [search]); + + return ( +
+
+

More Posts

+ setSearch(e.target.value)} + placeholder="Search articles" + className="text-sm min-w-full sm:min-w-96 p-2 rounded-md bg-neutral-800 border-none focus:ring-0 focus:outline-none outline-none text-neutral-200 placeholder-neutral-400" + /> +
+ +
+ {results.length === 0 ? ( +

No results found

+ ) : ( + results.map((article, index) => ( + + )) + )} +
+
+ ); +}; + +export const BlogPostRow = ({ + article, + locale, +}: { + article: Article; + locale: string; +}) => { + return ( + +
+

+ {article.title} +

+

+ {truncate(article.description, 80)} +

+ +
+

+ {format(new Date(article.publishedAt), 'MMMM dd, yyyy')} +

+
+
+ {article.categories?.map((category, idx) => ( +

+ {category.name} +

+ ))} +
+
+
+ {/* {blog.author} */} + + ); +}; diff --git a/apps/web/components/blur-image.tsx b/apps/web/components/blur-image.tsx new file mode 100644 index 0000000..beb566a --- /dev/null +++ b/apps/web/components/blur-image.tsx @@ -0,0 +1,38 @@ +'use client'; + +import Image from 'next/image'; +import React, { useState } from 'react'; + +import { cn } from '@/lib/utils'; + +export const BlurImage = ({ + src, + width, + height, + alt, + layout, + className, + ...rest +}: React.ComponentProps) => { + const [isLoading, setLoading] = useState(true); + + return ( + setLoading(false)} + src={src} + width={width} + height={height} + loading="lazy" + decoding="async" + blurDataURL={src as string} + layout={layout} + alt={alt ? alt : 'Avatar'} + {...rest} + /> + ); +}; diff --git a/apps/web/components/container.tsx b/apps/web/components/container.tsx new file mode 100644 index 0000000..671e937 --- /dev/null +++ b/apps/web/components/container.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +import { cn } from '@/lib/utils'; + +export const Container = ({ + children, + className, +}: { + children: React.ReactNode; + className?: string; +}) => { + return ( +
+ {children} +
+ ); +}; diff --git a/apps/web/components/decorations/ambient-color.tsx b/apps/web/components/decorations/ambient-color.tsx new file mode 100644 index 0000000..6b015e2 --- /dev/null +++ b/apps/web/components/decorations/ambient-color.tsx @@ -0,0 +1,46 @@ +import React from 'react'; + +export const AmbientColor = () => { + return ( +
+
+ +
+ +
+
+ ); +}; diff --git a/apps/web/components/decorations/cover.tsx b/apps/web/components/decorations/cover.tsx new file mode 100644 index 0000000..ae18443 --- /dev/null +++ b/apps/web/components/decorations/cover.tsx @@ -0,0 +1,45 @@ +'use client'; + +import { HTMLMotionProps, motion } from 'framer-motion'; +import React from 'react'; + +export const Cover = ({ children }: { children?: React.ReactNode }) => { + return ( +
+ {children} + + + + +
+ ); +}; + +export const CircleIcon = ({ + className, + delay, +}: { + className?: string; + delay?: number; +}) => { + return ( + + ); +}; diff --git a/apps/web/components/decorations/shooting-star.tsx b/apps/web/components/decorations/shooting-star.tsx new file mode 100644 index 0000000..854478f --- /dev/null +++ b/apps/web/components/decorations/shooting-star.tsx @@ -0,0 +1,129 @@ +'use client'; + +import React, { useEffect, useRef, useState } from 'react'; + +interface ShootingStar { + id: number; + x: number; + y: number; + angle: number; + scale: number; + speed: number; + distance: number; +} + +const getRandomStartPoint = () => { + const side = Math.floor(Math.random() * 4); + const offset = Math.random() * window.innerWidth; + + switch (side) { + case 0: + return { x: offset, y: 0, angle: 45 }; + case 1: + return { x: window.innerWidth, y: offset, angle: 135 }; + case 2: + return { x: offset, y: window.innerHeight, angle: 225 }; + case 3: + return { x: 0, y: offset, angle: 315 }; + default: + return { x: 0, y: 0, angle: 45 }; + } +}; + +const ShootingStars: React.FC = () => { + const [star, setStar] = useState(null); + const svgRef = useRef(null); + + useEffect(() => { + const createStar = () => { + const { x, y, angle } = getRandomStartPoint(); + const newStar: ShootingStar = { + id: Date.now(), + x, + y, + angle, + scale: 1, + speed: Math.random() * 20 + 10, + distance: 0, + }; + setStar(newStar); + + const randomDelay = Math.random() * 4500 + 4200; + setTimeout(createStar, randomDelay); + }; + + createStar(); + + return () => {}; + }, []); + + useEffect(() => { + const moveStar = () => { + if (star) { + setStar((prevStar) => { + if (!prevStar) return null; + const newX = + prevStar.x + + prevStar.speed * Math.cos((prevStar.angle * Math.PI) / 180); + const newY = + prevStar.y + + prevStar.speed * Math.sin((prevStar.angle * Math.PI) / 180); + const newDistance = prevStar.distance + prevStar.speed; + const newScale = 1 + newDistance / 100; + if ( + newX < -20 || + newX > window.innerWidth + 20 || + newY < -20 || + newY > window.innerHeight + 20 + ) { + return null; + } + return { + ...prevStar, + x: newX, + y: newY, + distance: newDistance, + scale: newScale, + }; + }); + } + }; + + const animationFrame = requestAnimationFrame(moveStar); + return () => cancelAnimationFrame(animationFrame); + }, [star]); + + return ( + + {star && ( + + )} + + + + + + + + ); +}; + +export default ShootingStars; diff --git a/apps/web/components/decorations/star-background.tsx b/apps/web/components/decorations/star-background.tsx new file mode 100644 index 0000000..b5a3a5f --- /dev/null +++ b/apps/web/components/decorations/star-background.tsx @@ -0,0 +1,147 @@ +'use client'; + +import React, { + RefObject, + useCallback, + useEffect, + useRef, + useState, +} from 'react'; + +import { cn } from '@/lib/utils'; + +interface StarProps { + x: number; + y: number; + radius: number; + opacity: number; + twinkleSpeed: number | null; +} + +interface StarBackgroundProps { + starDensity?: number; + allStarsTwinkle?: boolean; + twinkleProbability?: number; + minTwinkleSpeed?: number; + maxTwinkleSpeed?: number; + className?: string; +} + +const StarBackground: React.FC = ({ + starDensity = 0.00015, + allStarsTwinkle = true, + twinkleProbability = 0.7, + minTwinkleSpeed = 0.5, + maxTwinkleSpeed = 1, + className, +}) => { + const [stars, setStars] = useState([]); + const canvasRef = useRef(null); + + const generateStars = useCallback( + (width: number, height: number): StarProps[] => { + const area = width * height; + const numStars = Math.floor(area * starDensity); + return Array.from({ length: numStars }, () => { + const shouldTwinkle = + allStarsTwinkle || Math.random() < twinkleProbability; + return { + x: Math.random() * width, + y: Math.random() * height, + radius: Math.random() * 0.05 + 0.5, + opacity: Math.random() * 0.5 + 0.5, + twinkleSpeed: shouldTwinkle + ? minTwinkleSpeed + + Math.random() * (maxTwinkleSpeed - minTwinkleSpeed) + : null, + }; + }); + }, + [ + starDensity, + allStarsTwinkle, + twinkleProbability, + minTwinkleSpeed, + maxTwinkleSpeed, + ] + ); + + useEffect(() => { + const updateStars = () => { + const canvas = canvasRef.current; + if (canvas) { + const ctx = canvas.getContext('2d'); + if (!ctx) return; + + const { width, height } = canvas.getBoundingClientRect(); + canvas.width = width; + canvas.height = height; + setStars(generateStars(width, height)); + } + }; + + updateStars(); + + const resizeObserver = new ResizeObserver(updateStars); + const canvas = canvasRef.current; + if (canvas) { + resizeObserver.observe(canvas); + } + + return () => { + if (canvas) { + resizeObserver.unobserve(canvas); + } + }; + }, [ + starDensity, + allStarsTwinkle, + twinkleProbability, + minTwinkleSpeed, + maxTwinkleSpeed, + generateStars, + ]); + + useEffect(() => { + const canvas = canvasRef.current; + if (!canvas) return; + + const ctx = canvas.getContext('2d'); + if (!ctx) return; + + let animationFrameId: number; + + const render = () => { + ctx.clearRect(0, 0, canvas.width, canvas.height); + stars.forEach((star) => { + ctx.beginPath(); + ctx.arc(star.x, star.y, star.radius, 0, Math.PI * 2); + ctx.fillStyle = `rgba(255, 255, 255, ${star.opacity})`; + ctx.fill(); + + if (star.twinkleSpeed !== null) { + star.opacity = + 0.5 + + Math.abs(Math.sin((Date.now() * 0.001) / star.twinkleSpeed) * 0.5); + } + }); + + animationFrameId = requestAnimationFrame(render); + }; + + render(); + + return () => { + cancelAnimationFrame(animationFrameId); + }; + }, [stars]); + + return ( + + ); +}; + +export default StarBackground; diff --git a/apps/web/components/draft-mode-banner.tsx b/apps/web/components/draft-mode-banner.tsx new file mode 100644 index 0000000..381ba18 --- /dev/null +++ b/apps/web/components/draft-mode-banner.tsx @@ -0,0 +1,46 @@ +'use client'; + +import { usePathname, useRouter } from 'next/navigation'; +import { useEffect, useState } from 'react'; + +export function DraftModeBanner() { + const router = useRouter(); + const pathname = usePathname(); + const [isExiting, setIsExiting] = useState(false); + const [isIframe, setIsIframe] = useState(true); + + useEffect(() => { + setIsIframe(window !== window.top); + }, []); + + const handleExitDraft = async () => { + setIsExiting(true); + try { + await fetch('/api/exit-preview'); + router.refresh(); + } catch (error) { + console.error('Failed to exit draft mode:', error); + setIsExiting(false); + } + }; + + if (isIframe) { + return null; + } + + return ( +
+
+ + Draft Mode +
+ +
+ ); +} \ No newline at end of file diff --git a/apps/web/components/dynamic-zone/brands.tsx b/apps/web/components/dynamic-zone/brands.tsx new file mode 100644 index 0000000..7291230 --- /dev/null +++ b/apps/web/components/dynamic-zone/brands.tsx @@ -0,0 +1,92 @@ +'use client'; + +import { AnimatePresence, motion } from 'framer-motion'; +import { useEffect, useState } from 'react'; + +import { Heading } from '../elements/heading'; +import { Subheading } from '../elements/subheading'; +import { StrapiMedia } from '@/components/ui/strapi-media'; + +export const Brands = ({ + heading, + sub_heading, + logos, +}: { + heading: string; + sub_heading: string; + logos: any[]; +}) => { + const middleIndex = Math.floor(logos.length / 2); + const firstHalf = logos.slice(0, middleIndex); + const secondHalf = logos.slice(middleIndex); + const logosArraySplitInHalf = [firstHalf, secondHalf]; + + // State to track the current logo set + let [stateLogos, setLogos] = useState(logosArraySplitInHalf); + const [activeLogoSet, setActiveLogoSet] = useState(stateLogos[0]); + + const flipLogos = () => { + // Shift the logos array and update the active logo set + setLogos((currentLogos) => { + const newLogos = [...currentLogos.slice(1), currentLogos[0]]; + setActiveLogoSet(newLogos[0]); // Update the active set + return newLogos; + }); + }; + + useEffect(() => { + // Flip logos every 3 seconds + const timer = setTimeout(() => { + flipLogos(); + }, 3000); + + return () => clearTimeout(timer); // Clear timeout on component unmount or state update + }, [activeLogoSet]); // Depend on activeLogoSet to trigger flip every time it changes + + return ( +
+ {heading} + {sub_heading} + +
+ + {activeLogoSet.map((logo, idx) => ( + + + + ))} + +
+
+ ); +}; diff --git a/apps/web/components/dynamic-zone/cta.tsx b/apps/web/components/dynamic-zone/cta.tsx new file mode 100644 index 0000000..94508f1 --- /dev/null +++ b/apps/web/components/dynamic-zone/cta.tsx @@ -0,0 +1,51 @@ +'use client'; + +import { motion } from 'framer-motion'; +import Link from 'next/link'; +import React from 'react'; + +import { Container } from '../container'; +import { AmbientColor } from '../decorations/ambient-color'; +import { Button } from '../elements/button'; + +export const CTA = ({ + heading, + sub_heading, + CTAs, + locale, +}: { + heading: string; + sub_heading: string; + CTAs: any[]; + locale: string; +}) => { + return ( +
+ + +
+ + {heading} + +

+ {sub_heading} +

+
+
+ {CTAs && + CTAs.map((cta, index) => ( + + ))} +
+
+
+ ); +}; diff --git a/apps/web/components/dynamic-zone/faq.tsx b/apps/web/components/dynamic-zone/faq.tsx new file mode 100644 index 0000000..9cbcc54 --- /dev/null +++ b/apps/web/components/dynamic-zone/faq.tsx @@ -0,0 +1,39 @@ +import { IconHelpHexagonFilled } from '@tabler/icons-react'; + +import { FeatureIconContainer } from './features/feature-icon-container'; +import { Container } from '@/components/container'; +import { Heading } from '@/components/elements/heading'; + +export const FAQ = ({ + heading, + sub_heading, + faqs, +}: { + heading: string; + sub_heading: string; + faqs: any[]; +}) => { + return ( + +
+ + + + + {heading} + +
+
+ {faqs && + faqs.map((faq: { question: string; answer: string }) => ( +
+

+ {faq.question} +

+

{faq.answer}

+
+ ))} +
+
+ ); +}; diff --git a/apps/web/components/dynamic-zone/features/card.tsx b/apps/web/components/dynamic-zone/features/card.tsx new file mode 100644 index 0000000..d213105 --- /dev/null +++ b/apps/web/components/dynamic-zone/features/card.tsx @@ -0,0 +1,75 @@ +import React from 'react'; + +import { cn } from '@/lib/utils'; + +export const Card = ({ + className, + children, +}: { + className?: string; + children: React.ReactNode; +}) => { + return ( +
+ {children} +
+ ); +}; + +export const CardTitle = ({ + children, + className, +}: { + children: React.ReactNode; + className?: string; +}) => { + return ( +

+ {children} +

+ ); +}; + +export const CardDescription = ({ + children, + className, +}: { + children: React.ReactNode; + className?: string; +}) => { + return ( +

+ {children} +

+ ); +}; + +export const CardSkeletonContainer = ({ + className, + children, + showGradient = true, +}: { + className?: string; + children: React.ReactNode; + showGradient?: boolean; +}) => { + return ( +
+ {children} +
+ ); +}; diff --git a/apps/web/components/dynamic-zone/features/feature-icon-container.tsx b/apps/web/components/dynamic-zone/features/feature-icon-container.tsx new file mode 100644 index 0000000..bca1f7e --- /dev/null +++ b/apps/web/components/dynamic-zone/features/feature-icon-container.tsx @@ -0,0 +1,37 @@ +import React from 'react'; + +import { cn } from '@/lib/utils'; + +export const FeatureIconContainer = ({ + children, + className, +}: { + children: React.ReactNode; + className?: string; +}) => { + return ( +
+
+
+ {children} +
+
+
+
+
+
+ ); +}; diff --git a/apps/web/components/dynamic-zone/features/icon-container.tsx b/apps/web/components/dynamic-zone/features/icon-container.tsx new file mode 100644 index 0000000..9b01131 --- /dev/null +++ b/apps/web/components/dynamic-zone/features/icon-container.tsx @@ -0,0 +1,25 @@ +import React, { HTMLAttributes } from 'react'; + +import { cn } from '@/lib/utils'; + +export const IconContainer: React.FC> = ({ + children, + className, + ...props +}) => { + return ( +
+
{children}
+
+ ); +}; diff --git a/apps/web/components/dynamic-zone/features/index.tsx b/apps/web/components/dynamic-zone/features/index.tsx new file mode 100644 index 0000000..33a1bca --- /dev/null +++ b/apps/web/components/dynamic-zone/features/index.tsx @@ -0,0 +1,109 @@ +import { IconRocket } from '@tabler/icons-react'; +import React from 'react'; + +import { Container } from '../../container'; +import { Heading } from '../../elements/heading'; +import { Subheading } from '../../elements/subheading'; +import { GradientContainer } from '../../gradient-container'; +import { + Card, + CardDescription, + CardSkeletonContainer, + CardTitle, +} from './card'; +import { FeatureIconContainer } from './feature-icon-container'; +import { SkeletonOne } from './skeletons/first'; +import { SkeletonFour } from './skeletons/fourth'; +import { SkeletonTwo } from './skeletons/second'; +import { SkeletonThree } from './skeletons/third'; + +const wordToNumber: { [key: string]: number } = { + one: 1, + two: 2, + three: 3, +}; + +function convertWordToNumber(word: string) { + return wordToNumber[word.toLowerCase()] || null; +} + +export const Features = ({ + heading, + sub_heading, + globe_card, + ray_card, + graph_card, + social_media_card, +}: { + heading: string; + sub_heading: string; + globe_card: any; + ray_card: any; + graph_card: any; + social_media_card: any; +}) => { + return ( + + + + + + {heading} + {sub_heading} + +
+ {globe_card && ( + + {globe_card.title} + {globe_card.description} + + + + + )} + + {ray_card && ( + + + + + {ray_card.title} + {ray_card.description} + + )} + + {graph_card && ( + + + + + {graph_card.title} + {graph_card.description} + + )} + + {social_media_card && ( + + + + + {social_media_card.title} + {social_media_card.description} + + )} +
+
+
+ ); +}; diff --git a/apps/web/components/dynamic-zone/features/skeletons/first.tsx b/apps/web/components/dynamic-zone/features/skeletons/first.tsx new file mode 100644 index 0000000..f8bedd7 --- /dev/null +++ b/apps/web/components/dynamic-zone/features/skeletons/first.tsx @@ -0,0 +1,469 @@ +'use client'; + +import dynamic from 'next/dynamic'; +import React from 'react'; + +import { IconContainer } from '../icon-container'; +import { + FacebookIcon, + InstagramIcon, + LinkedInIcon, + MetaIcon, + SlackIcon, + TiktokIcon, + TwitterIcon, +} from '@/components/icons/illustrations'; + +const World = dynamic( + () => import('@/components/ui/globe').then((m) => m.World), + { + ssr: false, + } +); + +export function SkeletonOne() { + const globeConfig = { + pointSize: 4, + globeColor: '#09090b', + showAtmosphere: true, + atmosphereColor: '#e2e8f0', + atmosphereAltitude: 0.1, + emissive: '#062056', + emissiveIntensity: 0.1, + shininess: 0.9, + polygonColor: 'rgba(255,255,255,1)', + ambientLight: '#38bdf8', + directionalLeftLight: '#ffffff', + directionalTopLight: '#ffffff', + pointLight: '#ffffff', + arcTime: 1000, + arcLength: 0.9, + rings: 1, + maxRings: 3, + initialPosition: { lat: 22.3193, lng: 114.1694 }, + autoRotate: true, + autoRotateSpeed: 0.5, + }; + const colors = ['#d4d4d4', '#d4d4d4', '#d4d4d4']; + const sampleArcs = [ + { + order: 1, + startLat: -19.885592, + startLng: -43.951191, + endLat: -22.9068, + endLng: -43.1729, + arcAlt: 0.1, + color: colors[0], + }, + { + order: 1, + startLat: 28.6139, + startLng: 77.209, + endLat: 3.139, + endLng: 101.6869, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 1, + startLat: -19.885592, + startLng: -43.951191, + endLat: -1.303396, + endLng: 36.852443, + arcAlt: 0.5, + color: colors[0], + }, + { + order: 2, + startLat: 1.3521, + startLng: 103.8198, + endLat: 35.6762, + endLng: 139.6503, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 2, + startLat: 51.5072, + startLng: -0.1276, + endLat: 3.139, + endLng: 101.6869, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 2, + startLat: -15.785493, + startLng: -47.909029, + endLat: 36.162809, + endLng: -115.119411, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 3, + startLat: -33.8688, + startLng: 151.2093, + endLat: 22.3193, + endLng: 114.1694, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 3, + startLat: 21.3099, + startLng: -157.8581, + endLat: 40.7128, + endLng: -74.006, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 3, + startLat: -6.2088, + startLng: 106.8456, + endLat: 51.5072, + endLng: -0.1276, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 4, + startLat: 11.986597, + startLng: 8.571831, + endLat: -15.595412, + endLng: -56.05918, + arcAlt: 0.5, + color: colors[0], + }, + { + order: 4, + startLat: -34.6037, + startLng: -58.3816, + endLat: 22.3193, + endLng: 114.1694, + arcAlt: 0.7, + color: colors[0], + }, + { + order: 4, + startLat: 51.5072, + startLng: -0.1276, + endLat: 48.8566, + endLng: -2.3522, + arcAlt: 0.1, + color: colors[0], + }, + { + order: 5, + startLat: 14.5995, + startLng: 120.9842, + endLat: 51.5072, + endLng: -0.1276, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 5, + startLat: 1.3521, + startLng: 103.8198, + endLat: -33.8688, + endLng: 151.2093, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 5, + startLat: 34.0522, + startLng: -118.2437, + endLat: 48.8566, + endLng: -2.3522, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 6, + startLat: -15.432563, + startLng: 28.315853, + endLat: 1.094136, + endLng: -63.34546, + arcAlt: 0.7, + color: colors[0], + }, + { + order: 6, + startLat: 37.5665, + startLng: 126.978, + endLat: 35.6762, + endLng: 139.6503, + arcAlt: 0.1, + color: colors[0], + }, + { + order: 6, + startLat: 22.3193, + startLng: 114.1694, + endLat: 51.5072, + endLng: -0.1276, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 7, + startLat: -19.885592, + startLng: -43.951191, + endLat: -15.595412, + endLng: -56.05918, + arcAlt: 0.1, + color: colors[0], + }, + { + order: 7, + startLat: 48.8566, + startLng: -2.3522, + endLat: 52.52, + endLng: 13.405, + arcAlt: 0.1, + color: colors[0], + }, + { + order: 7, + startLat: 52.52, + startLng: 13.405, + endLat: 34.0522, + endLng: -118.2437, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 8, + startLat: -8.833221, + startLng: 13.264837, + endLat: -33.936138, + endLng: 18.436529, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 8, + startLat: 49.2827, + startLng: -123.1207, + endLat: 52.3676, + endLng: 4.9041, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 8, + startLat: 1.3521, + startLng: 103.8198, + endLat: 40.7128, + endLng: -74.006, + arcAlt: 0.5, + color: colors[0], + }, + { + order: 9, + startLat: 51.5072, + startLng: -0.1276, + endLat: 34.0522, + endLng: -118.2437, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 9, + startLat: 22.3193, + startLng: 114.1694, + endLat: -22.9068, + endLng: -43.1729, + arcAlt: 0.7, + color: colors[0], + }, + { + order: 9, + startLat: 1.3521, + startLng: 103.8198, + endLat: -34.6037, + endLng: -58.3816, + arcAlt: 0.5, + color: colors[0], + }, + { + order: 10, + startLat: -22.9068, + startLng: -43.1729, + endLat: 28.6139, + endLng: 77.209, + arcAlt: 0.7, + color: colors[0], + }, + { + order: 10, + startLat: 34.0522, + startLng: -118.2437, + endLat: 31.2304, + endLng: 121.4737, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 10, + startLat: -6.2088, + startLng: 106.8456, + endLat: 52.3676, + endLng: 4.9041, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 11, + startLat: 41.9028, + startLng: 12.4964, + endLat: 34.0522, + endLng: -118.2437, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 11, + startLat: -6.2088, + startLng: 106.8456, + endLat: 31.2304, + endLng: 121.4737, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 11, + startLat: 22.3193, + startLng: 114.1694, + endLat: 1.3521, + endLng: 103.8198, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 12, + startLat: 34.0522, + startLng: -118.2437, + endLat: 37.7749, + endLng: -122.4194, + arcAlt: 0.1, + color: colors[0], + }, + { + order: 12, + startLat: 35.6762, + startLng: 139.6503, + endLat: 22.3193, + endLng: 114.1694, + arcAlt: 0.2, + color: colors[0], + }, + { + order: 12, + startLat: 22.3193, + startLng: 114.1694, + endLat: 34.0522, + endLng: -118.2437, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 13, + startLat: 52.52, + startLng: 13.405, + endLat: 22.3193, + endLng: 114.1694, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 13, + startLat: 11.986597, + startLng: 8.571831, + endLat: 35.6762, + endLng: 139.6503, + arcAlt: 0.3, + color: colors[0], + }, + { + order: 13, + startLat: -22.9068, + startLng: -43.1729, + endLat: -34.6037, + endLng: -58.3816, + arcAlt: 0.1, + color: colors[0], + }, + { + order: 14, + startLat: -33.936138, + startLng: 18.436529, + endLat: 21.395643, + endLng: 39.883798, + arcAlt: 0.3, + color: colors[0], + }, + ]; + + return ( +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+ ); +} diff --git a/apps/web/components/dynamic-zone/features/skeletons/fourth.tsx b/apps/web/components/dynamic-zone/features/skeletons/fourth.tsx new file mode 100644 index 0000000..d736e67 --- /dev/null +++ b/apps/web/components/dynamic-zone/features/skeletons/fourth.tsx @@ -0,0 +1,132 @@ +'use client'; + +import { motion } from 'framer-motion'; +import React, { useEffect, useMemo, useState } from 'react'; + +import { IconContainer } from '../icon-container'; +import ShootingStars from '@/components/decorations/shooting-star'; +import StarBackground from '@/components/decorations/star-background'; +import { + FacebookIcon, + InstagramIcon, + LinkedInIcon, + MetaIcon, + SlackIcon, + TiktokIcon, + TwitterIcon, +} from '@/components/icons/illustrations'; +import { cn } from '@/lib/utils'; + +var loopInterval: NodeJS.Timeout; +export const SkeletonFour = () => { + const icons = useMemo( + () => [ + { + title: 'Twitter', + icon: TwitterIcon, + className: 'left-2 top-2', + }, + { + title: 'Meta2', + icon: MetaIcon, + className: 'left-32 top-32', + }, + { + title: 'Instagram', + icon: InstagramIcon, + className: 'left-1/2 top-1/2', + }, + { + title: 'LinkedIn2', + icon: LinkedInIcon, + className: 'left-1/2 top-20', + }, + { + title: 'Facebook', + icon: FacebookIcon, + className: 'right-20 top-20', + }, + { + title: 'Slack2', + icon: SlackIcon, + className: 'right-20 bottom-0', + }, + { + title: 'Tiktok', + icon: TiktokIcon, + className: 'left-52 bottom-10', + }, + { + title: 'Meta', + icon: MetaIcon, + className: 'left-32 bottom-60', + }, + { + title: 'Twitter2', + icon: TwitterIcon, + className: 'right-96 top-24', + }, + { + title: 'Instagram2', + icon: InstagramIcon, + className: 'left-10 bottom-0', + }, + { + title: 'LinkedIn', + icon: LinkedInIcon, + className: 'right-40 top-0', + }, + { + title: 'Facebook2', + icon: FacebookIcon, + className: 'right-40 top-40', + }, + { + title: 'Slack', + icon: SlackIcon, + className: 'right-0 bottom-60', + }, + { + title: 'Tiktok2', + icon: TiktokIcon, + className: 'right-10 bottom-80', + }, + ], + [] + ); + + const [active, setActive] = useState(icons[0]); + + useEffect(() => { + loopInterval = setInterval(() => { + setActive(icons[Math.floor(Math.random() * icons.length)]); + }, 3000); + return () => clearInterval(loopInterval); + }, [icons]); + + return ( +
+ + + + {icons.map((icon) => ( + + {} + {active.title === icon.title && ( + + )} + + ))} +
+ ); +}; diff --git a/apps/web/components/dynamic-zone/features/skeletons/second.tsx b/apps/web/components/dynamic-zone/features/skeletons/second.tsx new file mode 100644 index 0000000..b7e3916 --- /dev/null +++ b/apps/web/components/dynamic-zone/features/skeletons/second.tsx @@ -0,0 +1,271 @@ +'use client'; + +import React, { useCallback, useId, useRef, useState } from 'react'; + +import { SparklesCore } from '@/components/ui/sparkles'; +import { cn } from '@/lib/utils'; + +export const SkeletonTwo = () => { + const [sliderXPercent, setSliderXPercent] = useState(50); + + const sliderRef = useRef(null); + + const handleMouseMove = useCallback( + (event: React.MouseEvent) => { + if (!sliderRef.current) return; + + const rect = sliderRef.current.getBoundingClientRect(); + const x = event.clientX - rect.left; + + const percent = (x / rect.width) * 100; + setSliderXPercent(Math.max(0, Math.min(100, percent))); + }, + + [] + ); + + return ( +
setSliderXPercent(50)} + > +
+
+
+
+
+ +
+
+ +
+ + 2,052 + satellite + + + 8,230,002 + Starlinks + + + 7,224 + rockets + + +
+
+ + 1 satellite + + + 7 satellites + + + 4 rockets + + + +
+
+ ); +}; + +const Cover = ({ + children, + className, +}: { + children: React.ReactNode; + className?: string; +}) => { + return ( + + {children} + + ); +}; + +const BackgroundLines = () => { + return ( +
+ + + + + + + + + +
+ ); +}; + +const Cursor = ({ + className, + textClassName, + text, + ...props +}: React.HTMLAttributes & { + className?: string; + textClassName?: string; + text?: string; +}) => { + return ( +
+ + + +
+ {text ?? 'Manu Arora'} +
+
+ ); +}; + +const Container = ({ + className, + children, + ...props +}: React.HTMLAttributes & { + className?: string; + children: React.ReactNode; +}) => { + return ( +
+
+ {children} +
+
+ ); +}; + +const CircleWithLine = ({ + className, + index = 0, +}: { + className?: string; + index?: number; +}) => { + const id = `circle-line-${index}`; + return ( +
+
+ + + + + + + + + + +
+ ); +}; + +const MemoizedSparklesCore = React.memo(SparklesCore); diff --git a/apps/web/components/dynamic-zone/features/skeletons/third.tsx b/apps/web/components/dynamic-zone/features/skeletons/third.tsx new file mode 100644 index 0000000..4049aac --- /dev/null +++ b/apps/web/components/dynamic-zone/features/skeletons/third.tsx @@ -0,0 +1,359 @@ +'use client'; + +import { motion, useAnimate } from 'framer-motion'; +import React, { useState } from 'react'; + +import { cn } from '@/lib/utils'; + +export const SkeletonThree = () => { + const [scope, animate] = useAnimate(); + const [animating, setAnimating] = useState(false); + const enterAnimation = async () => { + if (animating) return; + + setAnimating(true); + await animate( + '.message', + { + scale: [0, 1], + }, + { + duration: 0.4, + } + ); + setAnimating(false); + }; + + return ( +
+
+
+ 6,092 + Last Month +
+
+ 72K + Modules delivered +
+
+
+
+

+ +8,008 launched +

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ ); +}; + +const Cover = ({ + children, + className, +}: { + children: React.ReactNode; + className?: string; +}) => { + return ( + + {children} + + ); +}; diff --git a/apps/web/components/dynamic-zone/form-next-to-section.tsx b/apps/web/components/dynamic-zone/form-next-to-section.tsx new file mode 100644 index 0000000..d68fc82 --- /dev/null +++ b/apps/web/components/dynamic-zone/form-next-to-section.tsx @@ -0,0 +1,140 @@ +'use client'; + +import { + IconBrandGithub, + IconBrandLinkedin, + IconBrandX, +} from '@tabler/icons-react'; +import Link from 'next/link'; + +import { Button } from '../elements/button'; +import ShootingStars from '@/components/decorations/shooting-star'; +import StarBackground from '@/components/decorations/star-background'; +import { AnimatedTooltip } from '@/components/ui/animated-tooltip'; + +export function FormNextToSection({ + heading, + sub_heading, + form, + section, + social_media_icon_links, +}: { + heading: string; + sub_heading: string; + form: any; + section: any; + social_media_icon_links: any; +}) { + const socials = [ + { + title: 'twitter', + href: 'https://twitter.com/strapijs', + icon: ( + + ), + }, + { + title: 'github', + href: 'https://github.com/strapi', + icon: ( + + ), + }, + { + title: 'linkedin', + href: 'https://linkedin.com/strapi', + icon: ( + + ), + }, + ]; + + return ( +
+
+
+
+

+ {heading} +

+

{sub_heading}

+
+ +
+
+
+ {form && + form?.inputs?.map((input: any, index: number) => ( +
+ {input.type !== 'submit' && ( + + )} + +
+ {input.type === 'textarea' ? ( +