Skip to content

Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.

chore: refactor middleware for root redirection and update configuration (#100)

Vlad Sazonau8ba995d27692
diff --git a/.cursor/rules/error-handling.mdc b/.cursor/rules/error-handling.mdc
index 27f1857..bb51a4b 100644
--- a/.cursor/rules/error-handling.mdc
+++ b/.cursor/rules/error-handling.mdc
@@ -1,7 +1,7 @@
---
description:
globs:
-alwaysApply: false
+alwaysApply: true
---
Error Handling and Validation Guidelines
diff --git a/.cursor/rules/project-structure.mdc b/.cursor/rules/project-structure.mdc
index f5f381a..bf61a4e 100644
--- a/.cursor/rules/project-structure.mdc
+++ b/.cursor/rules/project-structure.mdc
@@ -1,7 +1,7 @@
---
description:
globs:
-alwaysApply: false
+alwaysApply: true
---
Project Structure and Architecture Guidelines
diff --git a/.cursor/rules/testing.mdc b/.cursor/rules/testing.mdc
index 9d306ab..6ca3dda 100644
--- a/.cursor/rules/testing.mdc
+++ b/.cursor/rules/testing.mdc
@@ -1,7 +1,7 @@
---
description:
globs:
-alwaysApply: false
+alwaysApply: true
---
Testing Guidelines
diff --git a/e2e/about.test.ts b/e2e/about.test.ts
index 41a1ae1..3f1fcd4 100644
--- a/e2e/about.test.ts
+++ b/e2e/about.test.ts
@@ -26,7 +26,7 @@ test.describe("About page", () => {
await expect(
heroSection.getByText(
- "EasyInvoicePDF is a free, open-source tool that lets you create, customize, and download professional PDF invoices with real-time preview."
+ "EasyInvoicePDF is a free, open-source tool that lets you create, customize, and download professional invoices with real-time preview."
)
).toBeVisible();
diff --git a/e2e/invoice-form.test.ts b/e2e/invoice-form.test.ts
index 5cb3c4c..5cd4918 100644
--- a/e2e/invoice-form.test.ts
+++ b/e2e/invoice-form.test.ts
@@ -24,7 +24,7 @@ test.describe("Invoice Generator Page", () => {
// Check title and branding
await expect(page).toHaveTitle(
- "Invoice PDF Generator with Live Preview | No Sign-Up"
+ "Invoice Generator with Live Preview | No Sign-Up"
);
const header = page.getByTestId("header");
diff --git a/messages/en.json b/messages/en.json
index 4340bcd..64a5c72 100644
--- a/messages/en.json
+++ b/messages/en.json
@@ -3,7 +3,7 @@
"tagline": "Free Invoice Generator with Live PDF Preview",
"hero": {
"title": "Create professional invoices in seconds",
- "description": "EasyInvoicePDF is a free, open-source tool that lets you create, customize, and download professional PDF invoices with real-time preview.",
+ "description": "EasyInvoicePDF is a free, open-source tool that lets you create, customize, and download professional invoices with real-time preview.",
"noSignup": "No sign-up required. 100% free and open-source."
},
"features": {
diff --git a/next.config.mjs b/next.config.mjs
index 1bc53df..42fe672 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -139,15 +139,6 @@ const nextConfig = {
},
];
},
- async redirects() {
- return [
- {
- source: "/",
- destination: "/en/app",
- permanent: true,
- },
- ];
- },
};
export default withSentryConfig(withNextIntl(nextConfig), {
diff --git a/package.json b/package.json
index cf2845d..fabc78e 100644
--- a/package.json
+++ b/package.json
@@ -92,6 +92,7 @@
"prettier": "3.5.3",
"prettier-plugin-tailwindcss": "0.6.11",
"react-email": "4.0.4",
+ "schema-dts": "1.1.5",
"tailwindcss": "3.4.14",
"typescript": "5.8.2",
"typescript-eslint": "8.28.0"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4d887cc..95e1cf8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -203,6 +203,9 @@ importers:
react-email:
specifier: 4.0.4
+ schema-dts:
+ specifier: 1.1.5
+ version: 1.1.5
tailwindcss:
specifier: 3.4.14
version: 3.4.14
@@ -7707,6 +7710,12 @@ packages:
integrity: sha512-pFwF6H1XrSdYYNLfOcGlM28/j8CGLu8IvdrxqhjWULe2bPcKiKW4CV+OWqR/9fT52mywx65l7ysNkjLKBda7eA==,
}
+ resolution:
+ {
+ integrity: sha512-RJr9EaCmsLzBX2NDiO5Z3ux2BVosNZN5jo0gWgsyKvxKIUL5R3swNvoorulAeL9kLB0iTSX7V6aokhla2m7xbg==,
+ }
+
resolution:
{
@@ -14126,6 +14135,8 @@ snapshots:
+
dependencies:
"@types/json-schema": 7.0.15
diff --git a/src/app/[locale]/about/page.tsx b/src/app/[locale]/about/page.tsx
index c4deb42..ca0f85d 100644
--- a/src/app/[locale]/about/page.tsx
+++ b/src/app/[locale]/about/page.tsx
@@ -18,11 +18,84 @@ import {
FileText,
GlobeIcon,
Share2,
+ ArrowRight,
} from "lucide-react";
import { useTranslations, type Locale } from "next-intl";
import { setRequestLocale } from "next-intl/server";
+import { type Graph } from "schema-dts";
import { LanguageSwitcher } from "./components/language-switcher";
+const JSON_LD: Graph = {
+ "@context": "https://schema.org",
+ "@graph": [
+ {
+ "@type": "WebPage",
+ "@id": "https://easyinvoicepdf.com/en/about",
+ url: "https://easyinvoicepdf.com/en/about",
+ name: "About | Free Invoice Generator – Live Preview, No Sign-Up",
+ description:
+ "EasyInvoicePDF is a free, open-source tool to create professional invoices with real-time PDF preview, no sign-up required.",
+ mainEntity: {
+ "@id": "https://easyinvoicepdf.com/en/about",
+ },
+ },
+ {
+ "@type": "FAQPage",
+ "@id": "https://easyinvoicepdf.com/en/about#faq",
+ mainEntity: [
+ {
+ "@type": "Question",
+ name: "What is EasyInvoicePDF?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "EasyInvoicePDF is a free, open-source tool that helps you create professional invoices instantly. It features a live preview, customizable templates, and supports multiple languages and currencies.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Is it really free?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "Yes, EasyInvoicePDF is completely free to use. The entire project is open-source and available on GitHub.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Do I need to create an account?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "No, you don't need to create an account or sign up. You can start creating invoices immediately without any registration process.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Can I customize the invoice template?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "Yes, you can customize various aspects of your invoice including company details, currency, and language. More customization options are being added regularly.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Is my data secure?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "Your privacy is important to us. All invoice data is processed entirely in your browser - we don't store any of your information on our servers. You can even use the tool offline once loaded.",
+ },
+ },
+ {
+ "@type": "Question",
+ name: "Can I share invoices with others?",
+ acceptedAnswer: {
+ "@type": "Answer",
+ text: "Yes, you can generate shareable links for your invoices that others can view and download. These links are secure and only accessible to people you share them with.",
+ },
+ },
+ ],
+ },
+ ],
+};
+
export default function AboutPage({ params }: { params: { locale: Locale } }) {
const { locale } = params;
@@ -31,6 +104,13 @@ export default function AboutPage({ params }: { params: { locale: Locale } }) {
return (
<TooltipProvider>
+ <script
+ id="json-ld"
+ type="application/ld+json"
+ dangerouslySetInnerHTML={{
+ __html: JSON.stringify(JSON_LD),
+ }}
+ />
<div className="flex min-h-screen flex-col bg-slate-50">
<Header locale={locale} />
<main>
@@ -62,7 +142,7 @@ function Header({ locale }: { locale: Locale }) {
locale={locale}
buttonText={t("switchLanguage")}
/>
- <GoToAppButton className="" />
+ <BlackGoToAppButton />
</div>
</div>
</div>
@@ -77,42 +157,77 @@ function HeroSection() {
return (
<section
id="hero"
- className="flex w-full items-center justify-center bg-white py-12 md:py-24 lg:py-32 lg:pb-44"
+ className="relative flex w-full items-center justify-center overflow-hidden bg-gradient-to-b from-white to-slate-50 py-10 md:py-16 lg:py-24"
>
- <div className="container px-4 md:px-6">
- <div className="grid gap-6 lg:grid-cols-2">
- <div className="flex flex-col justify-center space-y-4">
- <div className="space-y-2">
- <h1 className="text-balance pb-3 text-3xl font-bold tracking-tighter text-slate-900 sm:text-[54px]/[1]">
+ {/* Background decorative elements */}
+ <div className="absolute inset-0 overflow-hidden">
+ <div className="absolute -right-40 -top-40 h-80 w-80 rounded-full bg-indigo-50/50 blur-3xl" />
+ <div className="absolute bottom-0 left-1/4 h-64 w-64 rounded-full bg-emerald-50/40 blur-3xl" />
+ </div>
+
+ <div className="container relative z-10 px-4 md:px-6">
+ <div className="grid gap-8 lg:grid-cols-2 lg:gap-12">
+ <div className="flex flex-col justify-center space-y-5 md:space-y-6">
+ <div className="space-y-3 md:space-y-4">
+ <h1 className="text-balance text-3xl font-bold tracking-tight text-slate-900 sm:text-4xl md:text-5xl lg:text-6xl">
{t("hero.title")}
</h1>
- <p className="max-w-[450px] text-balance text-slate-600 md:text-lg">
+
+ <p className="text-balance text-base text-slate-600 sm:text-lg md:max-w-[500px] md:text-xl">
{t("hero.description")}
</p>
</div>
- <div className="flex flex-col gap-2 md:flex-row">
- <GoToAppButton />
- <Button _size="lg" _variant="outline" className="px-8" asChild>
+
+ <div className="flex w-full flex-col gap-3 sm:flex-row sm:flex-wrap">
+ <BlackGoToAppButton className="px-10 py-6 text-lg" />
+
+ <Button
+ _size="lg"
+ _variant="outline"
+ className="group relative overflow-hidden border-slate-200 px-10 py-6 text-lg shadow-sm transition-all duration-300 hover:border-slate-300 hover:shadow-md"
+ asChild
+ >
<Link
href="https://github.com/VladSez/easy-invoice-pdf"
target="_blank"
rel="noopener noreferrer"
>
- <GithubIcon className="mr-2 h-5 w-5" />
+ <GithubIcon className="mr-2 h-6 w-6 transition-transform group-hover:scale-110" />
{t("buttons.viewOnGithub")}
</Link>
</Button>
</div>
- <p className="text-sm font-bold text-slate-500">
- {t("hero.noSignup")}
- </p>
+ <div className="mx-auto flex max-w-fit cursor-pointer items-center justify-center gap-x-2 rounded-full border border-amber-300 bg-amber-50 px-4 py-1.5 text-sm font-medium text-amber-800 shadow-sm transition-all hover:scale-105 md:mx-0">
+ <span className="" role="img" aria-label="checkmark">
+ ✅
+ </span>
+ <span>{t("hero.noSignup")}</span>
+ </div>
</div>
- <Video
- src="https://ik.imagekit.io/fl2lbswwo/easy-invoice/easy-invoice-demo.mp4"
- fallbackImg="https://ik.imagekit.io/fl2lbswwo/easy-invoice/easy-invoice-hero.webp"
- testId="hero-about-page-video"
- />
+ <div className="relative mx-auto w-full max-w-[600px] lg:mx-0">
+ {/* Mac OS Frame around the video */}
+ <div className="relative overflow-hidden rounded-xl border border-slate-200 bg-white shadow-lg md:rounded-2xl md:shadow-xl">
+ {/* Browser chrome bar */}
+ <div className="h-8 w-full rounded-t-xl bg-gradient-to-b from-[#F3F3F3] to-[#E9E9E9] px-4 shadow-sm md:h-12 md:rounded-t-2xl">
+ <div className="flex h-full items-center">
+ <div className="flex space-x-2">
+ <div className="h-2.5 w-2.5 rounded-full bg-[#FF5F57] md:h-3 md:w-3"></div>
+ <div className="h-2.5 w-2.5 rounded-full bg-[#FEBC2E] md:h-3 md:w-3"></div>
+ <div className="h-2.5 w-2.5 rounded-full bg-[#28C840] md:h-3 md:w-3"></div>
+ </div>
+ </div>
+ </div>
+ {/* Video container */}
+ <div className="w-full">
+ <Video
+ src="https://ik.imagekit.io/fl2lbswwo/easy-invoice/easy-invoice-demo.mp4"
+ fallbackImg="https://ik.imagekit.io/fl2lbswwo/easy-invoice/easy-invoice-hero.webp"
+ testId="hero-about-page-video"
+ />
+ </div>
+ </div>
+ </div>
</div>
</div>
</section>
@@ -530,14 +645,36 @@ function GoToAppButton({ className }: { className?: string }) {
return (
<Button
_size="lg"
- className={cn("bg-slate-950 px-8 hover:bg-slate-950/85", className)}
+ _variant="outline"
+ className={cn(
+ "group relative overflow-hidden border-slate-200 px-8 shadow-sm transition-all duration-300 hover:border-slate-200/80 hover:shadow-lg",
+ className
+ )}
asChild
>
- <Link href="/app">{t("buttons.goToApp")}</Link>
+ {/**
+ * scroll={false} is used to disable the default behavior of the link because it doesn't work for some reason
+ * the page is already scrolled to the top on mount at /en/app
+ */}
+ <Link href="/app" scroll={false}>
+ <ArrowRight className="mr-2 h-5 w-5 transition-transform group-hover:scale-110" />
+ {t("buttons.goToApp")}
+ </Link>
</Button>
);
}
+function BlackGoToAppButton({ className }: { className?: string }) {
+ return (
+ <GoToAppButton
+ className={cn(
+ "relative overflow-hidden bg-zinc-900 text-white transition-all duration-300 hover:scale-[1.02] hover:bg-zinc-800 hover:text-white active:scale-[0.98]",
+ className
+ )}
+ />
+ );
+}
+
function Logo() {
const t = useTranslations("About");
diff --git a/src/app/[locale]/app/page.client.tsx b/src/app/[locale]/app/page.client.tsx
index 7a5c192..b9d4bac 100644
--- a/src/app/[locale]/app/page.client.tsx
+++ b/src/app/[locale]/app/page.client.tsx
@@ -1,13 +1,29 @@
"use client";
+import { InvoiceClientPage } from "@/app/components";
+import { InvoicePDFDownloadLink } from "@/app/components/invoice-pdf-download-link";
+import { INITIAL_INVOICE_DATA } from "@/app/constants";
import {
invoiceSchema,
PDF_DATA_LOCAL_STORAGE_KEY,
SUPPORTED_LANGUAGES,
type InvoiceData,
} from "@/app/schema";
+import { TRANSLATIONS } from "@/app/schema/translations";
+import { GithubIcon } from "@/components/etc/github-logo";
+import { ProjectLogo } from "@/components/etc/project-logo";
+import { SubscribeInput } from "@/components/subscribe-input";
import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
import { CustomTooltip, TooltipProvider } from "@/components/ui/tooltip";
+import { useDeviceContext } from "@/contexts/device-context";
+import { Link, useRouter } from "@/i18n/navigation";
import { isLocalStorageAvailable } from "@/lib/check-local-storage";
import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";
import * as Sentry from "@sentry/nextjs";
@@ -15,28 +31,11 @@ import {
compressToEncodedURIComponent,
decompressFromEncodedURIComponent,
} from "lz-string";
-// eslint-disable-next-line no-restricted-imports
-import { useRouter, useSearchParams } from "next/navigation";
+import type { Locale } from "next-intl";
+import { useSearchParams } from "next/navigation";
import { useEffect, useState } from "react";
import { toast } from "sonner";
-import { InvoicePDFDownloadLink } from "@/app/components/invoice-pdf-download-link";
-import { INITIAL_INVOICE_DATA } from "@/app/constants";
-import { useDeviceContext } from "@/contexts/device-context";
-import { Link } from "@/i18n/navigation";
-import { ProjectLogo } from "@/components/etc/project-logo";
-import { GithubIcon } from "@/components/etc/github-logo";
-import type { Locale } from "next-intl";
-import { SubscribeInput } from "@/components/subscribe-input";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
import { z } from "zod";
-import { TRANSLATIONS } from "@/app/schema/translations";
-import { InvoiceClientPage } from "@/app/components";
// import { InvoicePDFDownloadMultipleLanguages } from "./components/invoice-pdf-download-multiple-languages";
/**
@@ -108,6 +107,11 @@ export function AppPageClient({ params }: { params: { locale: Locale } }) {
null
);
+ // Scroll to top on mount
+ useEffect(() => {
+ window.scrollTo({ top: 0, behavior: "smooth" });
+ }, []);
+
// Initialize data from URL or localStorage on mount
useEffect(() => {
const compressedInvoiceDataInUrl = searchParams.get("data");
@@ -220,7 +224,7 @@ export function AppPageClient({ params }: { params: { locale: Locale } }) {
);
// Clean URL if data differs
- router.replace("/");
+ router.replace("/app");
}
} catch (error) {
console.error("Failed to compare with URL data:", error);
@@ -236,7 +240,7 @@ export function AppPageClient({ params }: { params: { locale: Locale } }) {
_variant="outline"
_size="sm"
onClick={() => {
- router.replace("/");
+ router.replace("/app");
toast.dismiss();
}}
>
@@ -271,10 +275,12 @@ export function AppPageClient({ params }: { params: { locale: Locale } }) {
const stringified = JSON.stringify(newInvoiceDataValidated);
const compressed = compressToEncodedURIComponent(stringified);
- // Use push instead of replace to maintain history
- router.push(`/?data=${compressed}`);
+ router.push(`/app?data=${compressed}`);
+
+ // Construct full URL with locale and compressed data
+ const newFullUrl = `${window.location.origin}/${locale}/app?data=${compressed}`;
- const newFullUrl = `${window.location.origin}/?data=${compressed}`;
+ // Copy to clipboard
await navigator.clipboard.writeText(newFullUrl);
toast.success("Invoice link copied to clipboard!", {
diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx
index bc3d818..f8a3f32 100644
--- a/src/app/[locale]/layout.tsx
+++ b/src/app/[locale]/layout.tsx
@@ -6,6 +6,7 @@ import { routing } from "@/i18n/routing";
import { hasLocale, type Locale } from "next-intl";
import { notFound } from "next/navigation";
import { Toaster } from "sonner";
+import { type WebSite, type WithContext } from "schema-dts";
import { APP_URL } from "@/config";
@@ -18,30 +19,70 @@ export const viewport: Viewport = {
export const metadata: Metadata = {
metadataBase: new URL(APP_URL),
- title: "Invoice PDF Generator with Live Preview | No Sign-Up",
+ title: "Invoice Generator with Live Preview | No Sign-Up",
description:
- "Create and download professional PDF invoices instantly with real-time preview. Free and open-source. No signup required.",
+ "Create and download professional invoices instantly with real-time preview. Free and open-source. No signup required.",
keywords:
"invoice generator, pdf invoice, invoice maker, invoice template, online invoice, billing software, open-source, free invoice generator",
authors: [{ name: "Uladzislau Sazonau" }],
creator: "Uladzislau Sazonau",
publisher: "Uladzislau Sazonau",
openGraph: {
- title: "Invoice PDF Generator with Live Preview | No Sign-Up",
+ title: "Invoice Generator with Live Preview | No Sign-Up",
description:
- "Create and download professional PDF invoices instantly with real-time preview. Free and open-source. No signup required.",
+ "Create and download professional invoices instantly with real-time preview. Free and open-source. No signup required.",
locale: "en_US",
type: "website",
},
twitter: {
card: "summary_large_image",
- title: "Invoice PDF Generator with Live Preview | No Sign-Up",
+ title: "Invoice Generator with Live Preview | No Sign-Up",
description:
- "Create and download professional PDF invoices instantly with real-time preview. Free and open-source. No signup required.",
+ "Create and download professional invoices instantly with real-time preview. Free and open-source. No signup required.",
creator: "@vlad_sazon",
},
};
+const JSONLD: WithContext<WebSite> = {
+ "@context": "https://schema.org",
+ "@type": "WebSite",
+ url: "https://easyinvoicepdf.com/en/app",
+ name: "EasyInvoicePDF.com",
+ description: "Invoice Generator with Live Preview | No Sign-Up",
+ keywords: [
+ "invoice",
+ "invoice generator",
+ "invoice generating",
+ "invoice app",
+ "invoice generator app",
+ "free invoice generator",
+ ],
+ image: "https://ik.imagekit.io/fl2lbswwo/opengraph-image.png",
+ mainEntityOfPage: {
+ "@type": "SoftwareApplication",
+ "@id": `https://easyinvoicepdf.com/en/app`,
+ name: "EasyInvoicePDF.com",
+ description: "Invoice Generator with Live Preview | No Sign-Up",
+ featureList: [
+ "Live preview invoice generation",
+ "No sign-up required",
+ "Customizable templates",
+ "Instant PDF download",
+ "Support for multiple languages and currencies",
+ "European VAT support",
+ "Secure shareable invoice links",
+ "Offline support",
+ ],
+ operatingSystem: "All",
+ applicationCategory: "BusinessApplication",
+ },
+ author: {
+ "@type": "Person",
+ name: "Uladzislau Sazonau",
+ url: "https://vladsazon.com",
+ },
+};
+
export default async function RootLayout({
children,
params,
@@ -92,6 +133,11 @@ export default async function RootLayout({
/>
</>
)}
+ <script
+ id="json-ld"
+ type="application/ld+json"
+ dangerouslySetInnerHTML={{ __html: JSON.stringify(JSONLD) }}
+ />
</>
);
}
diff --git a/src/app/[locale]/opengraph-image.png b/src/app/[locale]/opengraph-image.png
index bf4f710..a1fe9fd 100644
Binary files a/src/app/[locale]/opengraph-image.png and b/src/app/[locale]/opengraph-image.png differ
diff --git a/src/app/robots.ts b/src/app/robots.ts
index d56b412..58ef57f 100644
--- a/src/app/robots.ts
+++ b/src/app/robots.ts
@@ -8,14 +8,14 @@ export default function robots(): MetadataRoute.Robots {
{
userAgent: "*",
allow: [
- // Allow root
- "/",
// Allow about pages in all languages
...SUPPORTED_LANGUAGES.map((locale) => `/${locale}/about`),
// Allow main app page (/en/app) for now
"/en/app",
],
disallow: [
+ // Disallow root as it redirects to /en/app
+ "/",
// Disallow shared invoice URLs, like /en/app?data=*
"/*app?data=*",
"/*app?*data=*",
diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts
index 93cfbbc..61079f3 100644
--- a/src/app/sitemap.ts
+++ b/src/app/sitemap.ts
@@ -6,13 +6,6 @@ export default function sitemap(): MetadataRoute.Sitemap {
const lastModified = new Date().toISOString().split("T")[0];
const sitemapEntries: MetadataRoute.Sitemap = [
- // Root URL (will be redirected to /en/app)
- {
- url: APP_URL,
- lastModified,
- changeFrequency: "daily",
- priority: 1,
- },
// Main app page (non-shared version)
{
url: `${APP_URL}/en/app`,
diff --git a/src/components/video.tsx b/src/components/video.tsx
index 7d806db..baebda2 100644
--- a/src/components/video.tsx
+++ b/src/components/video.tsx
@@ -74,7 +74,8 @@ export const Video = ({ src, fallbackImg, testId = "" }: VideoProps) => {
<div className="relative">
<div
style={{
- paddingBottom: (2 / 2.67) * 100 + "%", // keeps aspect ratio
+ // paddingBottom: (2 / 2.67) * 100 + "%", // keeps aspect ratio
+ paddingBottom: "56.3%", // keeps aspect ratio for 16:9
}}
className=""
/>
diff --git a/src/middleware.ts b/src/middleware.ts
index ce56808..269f960 100644
--- a/src/middleware.ts
+++ b/src/middleware.ts
@@ -1,9 +1,24 @@
import createMiddleware from "next-intl/middleware";
import { routing } from "./i18n/routing";
+import { NextResponse } from "next/server";
+import type { NextRequest } from "next/server";
-export default createMiddleware({
- ...routing,
-});
+// Create the middleware handler
+const intlMiddleware = createMiddleware(routing);
+
+// Custom middleware handler that adds the redirect logic
+export default function middleware(request: NextRequest) {
+ // Redirect from root to /en/app
+ if (request.nextUrl.pathname === "/") {
+ console.log("___Redirecting from root to /en/app___");
+ return NextResponse.redirect(new URL("/en/app", request.url), {
+ status: 308, // Permanent redirect that preserves the request method
+ });
+ }
+
+ // For all other routes, use the intl middleware
+ return intlMiddleware(request);
+}
export const config = {
// Match all pathnames except for
@@ -11,6 +26,7 @@ export const config = {
// - … the ones containing a dot (e.g. `favicon.ico`)
matcher: [
"/((?!api|trpc|_next|_vercel|.*\\..*).*)",
- // Also match the specific about page path to include locale
+ // Include the root path explicitly for the redirect
+ "/",
],
};