Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.
TypeScript fintechinvoiceinvoice-generatorinvoice-pdfinvoice-templateinvoicesnextjsopen-sourcequotesreactreact-pdf-rendererself-hostedshadcn-uitailwindcsstypescript
chore: update routing and configuration for improved SEO and user exp… (#102)
Vlad Sazonau87534e4f17af
diff --git a/README.md b/README.mdindex ba48190..acad52f 100644--- a/README.md+++ b/README.md@@ -6,6 +6,15 @@ If you found this project helpful, you can support my work here: [Buy Me a Coffe+## Features++- **Live Preview**: See your invoice update in real-time as you make changes, ensuring it looks exactly how you want.+- **Shareable Links**: Generate links to share your invoices directly with clients without sending attachments.+- **Instant Download**: Download your invoice as a PDF file with one click, ready to be sent or printed.+- **Browser Only**: Runs entirely in your browser—no server-side processing or data storage. Your data stays private and secure.+- **Multiple Languages & Currencies**: Create invoices in multiple languages with support for all major currencies and automatic formatting.+- **European VAT Support**: Automatically calculate European VAT rates and totals for your invoices.+## Demohttps://github.com/user-attachments/assets/9e3194e0-3072-4c95-ae99-e66db1301dc6diff --git a/e2e/about.test.ts b/e2e/about.test.tsindex 3f1fcd4..7ffd837 100644--- a/e2e/about.test.ts+++ b/e2e/about.test.ts@@ -39,7 +39,7 @@ test.describe("About page", () => {await expect(video).toBeVisible();await expect(video).toHaveAttribute("poster",- "https://ik.imagekit.io/fl2lbswwo/easy-invoice/easy-invoice-hero.webp"+ "https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-video-placeholder.webp?v=1");await expect(video).toHaveAttribute("muted");await expect(video).toHaveAttribute("loop");@@ -50,7 +50,7 @@ test.describe("About page", () => {const videoSource = video.locator("source");await expect(videoSource).toHaveAttribute("src",- "https://ik.imagekit.io/fl2lbswwo/easy-invoice/easy-invoice-demo.mp4#t=0.001"+ "https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-demo.mp4#t=0.001");await expect(videoSource).toHaveAttribute("type", "video/mp4");@@ -184,7 +184,7 @@ test.describe("About page", () => {const appLink = footerLinks.getByRole("link", { name: "App" });await expect(appLink).toBeVisible();- await expect(appLink).toHaveAttribute("href", "/en/app");+ await expect(appLink).toHaveAttribute("href", "/");await expect(appLink).not.toHaveAttribute("target", "_blank");const featuresLink = footerLinks.getByRole("link", {@@ -325,7 +325,7 @@ test.describe("About page", () => {const appLink = footerLinks.getByRole("link", { name: "App" });await expect(appLink).toBeVisible();- await expect(appLink).toHaveAttribute("href", "/fr/app");+ await expect(appLink).toHaveAttribute("href", "/");await expect(appLink).not.toHaveAttribute("target", "_blank");const featuresLink = footerLinks.getByRole("link", {@@ -442,6 +442,6 @@ test.describe("About page", () => {const headerGoToAppButton = header.getByRole("link", { name: "Go to app" });await headerGoToAppButton.click();- await expect(page).toHaveURL("/en/app");+ await expect(page).toHaveURL("/");});});diff --git a/e2e/invoice-form.test.ts b/e2e/invoice-form.test.tsindex 5cd4918..ffb1345 100644--- a/e2e/invoice-form.test.ts+++ b/e2e/invoice-form.test.ts@@ -18,9 +18,14 @@ test.describe("Invoice Generator Page", () => {await page.goto("/");});+ test("should redirect from /:locale/app to /", async ({ page }) => {+ await page.goto("/en/app");+ await expect(page).toHaveURL("/");+ });+test("displays correct buttons and links in header", async ({ page }) => {// Check URL is correct- await expect(page).toHaveURL("/en/app");+ await expect(page).toHaveURL("/");// Check title and brandingawait expect(page).toHaveTitle(@@ -82,7 +87,7 @@ test.describe("Invoice Generator Page", () => {await expect(video).toHaveAttribute("src",- "https://ik.imagekit.io/fl2lbswwo/easy-invoice/easy-invoice-demo.mp4"+ "https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-demo.mp4");await expect(video).toHaveAttribute("autoplay", "");await expect(video).toHaveAttribute("controls", "");@@ -1147,7 +1152,7 @@ test.describe("Invoice Generator Page", () => {test("shows notification when invoice link is broken", async ({ page }) => {// Navigate to page with invalid data parameter- await page.goto("/en/app?data=invalid-data-string");+ await page.goto("/?data=invalid-data-string");// Verify error toast appearsawait expect(@@ -1173,7 +1178,7 @@ test.describe("Invoice Generator Page", () => {).toBeHidden();// Verify URL is cleared- expect(page.url()).toContain("/en/app");+ expect(page.url()).toContain("/");expect(page.url()).not.toContain("?data=");});});diff --git a/e2e/not-found-page.test.ts b/e2e/not-found-page.test.tsindex d868a81..9c96c6f 100644--- a/e2e/not-found-page.test.ts+++ b/e2e/not-found-page.test.ts@@ -6,6 +6,9 @@ test.describe("Not Found page", () => {}) => {await page.goto("/non-existent-page");+ // Verify URL is correct+ await expect(page).toHaveURL("/non-existent-page");+// Verify error message is displayedawait expect(page.getByText("404")).toBeVisible();await expect(@@ -17,7 +20,7 @@ test.describe("Not Found page", () => {await expect(homeLink).toBeVisible();await homeLink.click();- await expect(page).toHaveURL("/en/app");+ await expect(page).toHaveURL("/");});test("should display not found page in Spanish under [locale] root layout", async ({@@ -25,97 +28,20 @@ test.describe("Not Found page", () => {}) => {await page.goto("/es/non-existent-page");- // Verify error message is displayed- await expect(page.getByText("404")).toBeVisible();- await expect(- page.getByRole("heading", { name: "No se pudo encontrar esta página." })- ).toBeVisible();-- // Check return home link- const homeLink = page.getByRole("link", {- name: "Volver a la página principal",- });- await expect(homeLink).toBeVisible();- await homeLink.click();+ // Verify URL is correct+ await expect(page).toHaveURL("/es/non-existent-page");- await expect(page).toHaveURL("/es/app");- });-- test("should display not found page in French under [locale]/about layout", async ({- page,- }) => {- await page.goto("/fr/about/non-existent-page");-- // Verify error message is displayed in French- await expect(page.getByText("404")).toBeVisible();- const returnHomeLink = page.getByRole("link", {- name: "Retour à l'accueil",- });- await expect(returnHomeLink).toBeVisible();- await returnHomeLink.click();-- await expect(page).toHaveURL("/fr/app");- });-- test("should display not found page in German under [locale]/app root layout", async ({- page,- }) => {- await page.goto("/de/app/non-existent-page");-- // Verify error message is displayed in German- await expect(page.getByText("404")).toBeVisible();- const returnHomeLink = page.getByRole("link", {- name: "Zur Startseite zurückkehren",- });- await expect(returnHomeLink).toBeVisible();- await returnHomeLink.click();-- await expect(page).toHaveURL("/de/app");- });-- test("should display not found page in Portuguese under [locale]/app layout", async ({- page,- }) => {- await page.goto("pt/app/non-existent-page");-- // Verify error message is displayed- await expect(page.getByText("404")).toBeVisible();- await expect(- page.getByRole("heading", {- name: "Esta página não pôde ser encontrada.",- })- ).toBeVisible();-- // Check return home link- const homeLink = page.getByRole("link", {- name: "Voltar à página inicial",- });- await expect(homeLink).toBeVisible();- await homeLink.click();-- await expect(page).toHaveURL("/pt/app");- });-- test("should display not found page in Polish under root layout with multiple levels", async ({- page,- }) => {- await page.goto("pl/non-exist/404/non-exist/404");-- // Verify error message is displayed+ // Verify error message is displayed in English (default locale)await expect(page.getByText("404")).toBeVisible();await expect(- page.getByRole("heading", {- name: "Nie można znaleźć tej strony.",- })+ page.getByRole("heading", { name: "This page could not be found." })).toBeVisible();// Check return home link- const homeLink = page.getByRole("link", {- name: "Wróć do strony głównej",- });+ const homeLink = page.getByRole("link", { name: "Return to homepage" });await expect(homeLink).toBeVisible();await homeLink.click();- await expect(page).toHaveURL("/pl/app");+ await expect(page).toHaveURL("/");});});diff --git a/e2e/pdf.test.ts b/e2e/pdf.test.tsindex f6f64b3..203fd9b 100644--- a/e2e/pdf.test.ts+++ b/e2e/pdf.test.ts@@ -542,10 +542,12 @@ Reste à payer: 184.50 GBPMontant en lettres: cent quatre-vingt-quatre GBP 50/100`);// Verify toast appears after download- await expect(page.getByText("Consider Supporting Us!")).toBeVisible();+ await expect(+ page.getByText("❤️ Enjoying EasyInvoicePDF? Help Keep It Free!")+ ).toBeVisible();await expect(page.getByText(- "If you find this tool helpful, please consider making a small donation to support our work."+ "This tool is free and ad-free thanks to user support. If it’s helped you, consider a small donation to keep it running and growing. Every bit counts—thank you!")).toBeVisible();await expect(page.getByRole("button", { name: "Donate" })).toBeVisible();@@ -727,7 +729,9 @@ Montant en lettres: cent quatre-vingt-quatre GBP 50/100`);const pdfData = await pdf(dataBuffer);// Verify PDF content- expect(pdfData.text).toContain("Fatura TEST PORTUGUESE N°: 1/04-2025");+ expect(pdfData.text).toContain(+ `Fatura TEST PORTUGUESE N°: 1/${CURRENT_MONTH_AND_YEAR}`+ );expect(pdfData.text).toContain("Data de emissão");});});diff --git a/eslint.config.mjs b/eslint.config.mjsindex 9600c5e..a0ecc6e 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -51,22 +51,6 @@ export default tseslint.config("Please use @react-pdf/renderer/lib/react-pdf.browser instead. Check https://github.com/diegomura/react-pdf/issues/2890#issuecomment-2443831013 for more details.",},],- patterns: [- {- group: ["next/link"],- message: "Please import from `@/i18n/navigation` instead.",- },- {- group: ["next/navigation"],- importNames: [- "redirect",- "permanentRedirect",- "useRouter",- "usePathname",- ],- message: "Please import from `@/i18n/navigation` instead.",- },- ],},],},diff --git a/messages/de.json b/messages/de.jsonindex d08bada..9c8c908 100644--- a/messages/de.json+++ b/messages/de.json@@ -6,11 +6,6 @@"keywords": "Rechnungstool, kostenloser Rechnungsgenerator, PDF-Rechnungen, Rechnungsersteller, Abrechnungssoftware"}},- "NotFound": {- "error": "404",- "message": "Diese Seite konnte nicht gefunden werden.",- "returnHome": "Zur Startseite zurückkehren"- },"About": {"tagline": "Rechnungs-PDF-Generator mit Live-Vorschau","hero": {@@ -82,14 +77,6 @@"emailLanguageInfo": "Alle E-Mails werden in englischer Sprache versendet"}},- "Error": {- "title": "Etwas ist schief gelaufen",- "description": "Bitte versuchen Sie, die Seite zu aktualisieren oder einen Fehlerbericht zu erstellen",- "bugReport": "hier",- "tryAgain": "Erneut versuchen",- "goBack": "Zurück",- "toastMessage": "Etwas ist schief gelaufen! Bitte versuchen Sie, die Seite zu aktualisieren oder einen Fehlerbericht zu erstellen."- },"FAQ": {"title": "Häufig gestellte Fragen","description": "Finden Sie Antworten auf häufige Fragen zu EasyInvoicePDF",diff --git a/messages/en.json b/messages/en.jsonindex 64a5c72..64b11a5 100644--- a/messages/en.json+++ b/messages/en.json@@ -70,20 +70,6 @@"emailLanguageInfo": "All emails will be sent in English"}},-- "NotFound": {- "error": "404",- "message": "This page could not be found.",- "returnHome": "Return to homepage"- },- "Error": {- "title": "Something went wrong",- "description": "Please try to refresh the page or fill a bug report",- "bugReport": "here",- "tryAgain": "Try again",- "goBack": "Go back",- "toastMessage": "Something went wrong! Please try to refresh the page or fill a bug report."- },"Metadata": {"about": {"title": "About | Free Invoice Generator – Live Preview, No Sign-Up",diff --git a/messages/es.json b/messages/es.jsonindex 743d8c2..07ea846 100644--- a/messages/es.json+++ b/messages/es.json@@ -1,17 +1,4 @@{- "NotFound": {- "error": "404",- "message": "No se pudo encontrar esta página.",- "returnHome": "Volver a la página principal"- },- "Error": {- "title": "Algo salió mal",- "description": "Por favor, intenta actualizar la página o reporta el error",- "bugReport": "aquí",- "tryAgain": "Intentar de nuevo",- "goBack": "Volver",- "toastMessage": "¡Algo salió mal! Por favor, intenta actualizar la página o reporta el error."- },"Metadata": {"about": {"title": "Acerca de | Generador de Facturas Gratuito – Vista Previa en Vivo, Sin Registro",diff --git a/messages/fr.json b/messages/fr.jsonindex 533a3f9..02b1d59 100644--- a/messages/fr.json+++ b/messages/fr.json@@ -70,19 +70,6 @@"emailLanguageInfo": "Tous les emails seront envoyés en anglais"}},- "NotFound": {- "error": "404",- "message": "Cette page est introuvable.",- "returnHome": "Retour à l'accueil"- },- "Error": {- "title": "Une erreur s'est produite",- "description": "Veuillez essayer de rafraîchir la page ou signaler un bug",- "bugReport": "ici",- "tryAgain": "Réessayer",- "goBack": "Retour",- "toastMessage": "Une erreur s'est produite ! Veuillez essayer de rafraîchir la page ou signaler un bug."- },"Metadata": {"about": {"title": "À propos | Générateur de Factures Gratuit – Aperçu en Direct, Sans Inscription",diff --git a/messages/it.json b/messages/it.jsonindex c27dc33..450cfdf 100644--- a/messages/it.json+++ b/messages/it.json@@ -70,19 +70,6 @@"emailLanguageInfo": "Tutte le email saranno inviate in inglese"}},- "NotFound": {- "error": "404",- "message": "Questa pagina non è stata trovata.",- "returnHome": "Torna alla homepage"- },- "Error": {- "title": "Qualcosa è andato storto",- "description": "Per favore prova ad aggiornare la pagina o segnala un bug",- "bugReport": "qui",- "tryAgain": "Riprova",- "goBack": "Torna indietro",- "toastMessage": "Qualcosa è andato storto! Per favore prova ad aggiornare la pagina o segnala un bug."- },"Metadata": {"about": {"title": "Chi Siamo | Generatore di Fatture Gratuito – Anteprima in Tempo Reale, Nessuna Registrazione",diff --git a/messages/nl.json b/messages/nl.jsonindex 177be35..3ff89b7 100644--- a/messages/nl.json+++ b/messages/nl.json@@ -70,19 +70,6 @@"emailLanguageInfo": "Alle e-mails worden in het Engels verzonden"}},- "NotFound": {- "error": "404",- "message": "Deze pagina kon niet worden gevonden.",- "returnHome": "Terug naar homepage"- },- "Error": {- "title": "Er is iets misgegaan",- "description": "Probeer de pagina te vernieuwen of meld een bug",- "bugReport": "hier",- "tryAgain": "Opnieuw proberen",- "goBack": "Ga terug",- "toastMessage": "Er is iets misgegaan! Probeer de pagina te vernieuwen of meld een bug."- },"Metadata": {"about": {"title": "Over | Gratis Factuur Generator – Live Voorbeeld, Geen Registratie",diff --git a/messages/pl.json b/messages/pl.jsonindex 40ba3eb..d65b369 100644--- a/messages/pl.json+++ b/messages/pl.json@@ -6,19 +6,6 @@"keywords": "narzędzie do faktur, darmowy generator faktur, faktury PDF, kreator faktur, oprogramowanie do fakturowania"}},- "NotFound": {- "error": "404",- "message": "Nie można znaleźć tej strony.",- "returnHome": "Wróć do strony głównej"- },- "Error": {- "title": "Coś poszło nie tak",- "description": "Spróbuj odświeżyć stronę lub zgłoś błąd",- "bugReport": "tutaj",- "tryAgain": "Spróbuj ponownie",- "goBack": "Wróć",- "toastMessage": "Coś poszło nie tak! Spróbuj odświeżyć stronę lub zgłoś błąd."- },"About": {"tagline": "Generator faktur PDF z podglądem na żywo","hero": {diff --git a/messages/pt.json b/messages/pt.jsonindex c50ad1d..579d007 100644--- a/messages/pt.json+++ b/messages/pt.json@@ -6,11 +6,6 @@"keywords": "ferramenta de invoice, gerador de invoices gratuito, invoices PDF, criador de invoices, software de faturamento"}},- "NotFound": {- "error": "404",- "message": "Esta página não pôde ser encontrada.",- "returnHome": "Voltar à página inicial"- },"About": {"tagline": "Gerador de faturas PDF com pré-visualização em tempo real","hero": {@@ -82,14 +77,6 @@"emailLanguageInfo": "Todos os emails serão enviados em inglês"}},- "Error": {- "title": "Algo deu errado",- "description": "Por favor, tente atualizar a página ou reportar o erro",- "bugReport": "aqui",- "tryAgain": "Tentar novamente",- "goBack": "Voltar",- "toastMessage": "Algo deu errado! Por favor, tente atualizar a página ou reportar o erro."- },"FAQ": {"title": "Perguntas Frequentes","description": "Encontre respostas para perguntas comuns sobre o EasyInvoicePDF",diff --git a/messages/ru.json b/messages/ru.jsonindex d05c5e6..bc5e89a 100644--- a/messages/ru.json+++ b/messages/ru.json@@ -6,19 +6,6 @@"keywords": "инструмент для выставления инвойсов, бесплатный генератор инвойсов, PDF инвойсы, создание инвойсов, программа для выставления инвойсов"}},- "NotFound": {- "error": "404",- "message": "Эта страница не найдена.",- "returnHome": "Вернуться на главную"- },- "Error": {- "title": "Что-то пошло не так",- "description": "Пожалуйста, попробуйте обновить страницу или сообщить об ошибке",- "bugReport": "здесь",- "tryAgain": "Попробовать снова",- "goBack": "Вернуться",- "toastMessage": "Что-то пошло не так! Пожалуйста, попробуйте обновить страницу или сообщить об ошибке."- },"About": {"tagline": "Генератор PDF-счетов с предпросмотром","hero": {diff --git a/messages/uk.json b/messages/uk.jsonindex 46df377..0d3e1a2 100644--- a/messages/uk.json+++ b/messages/uk.json@@ -1,17 +1,4 @@{- "NotFound": {- "error": "404",- "message": "Цю сторінку не знайдено.",- "returnHome": "Повернутися на головну"- },- "Error": {- "title": "Щось пішло не так",- "description": "Будь ласка, спробуйте оновити сторінку або повідомити про помилку",- "bugReport": "тут",- "tryAgain": "Спробувати ще раз",- "goBack": "Повернутися",- "toastMessage": "Щось пішло не так! Будь ласка, спробуйте оновити сторінку або повідомити про помилку."- },"Metadata": {"about": {"title": "Про нас | Безкоштовний Генератор Інвойсів – Попередній Перегляд у Реальному Часі, Без Реєстрації",diff --git a/next.config.mjs b/next.config.mjsindex 42fe672..fdac273 100644--- a/next.config.mjs+++ b/next.config.mjs@@ -40,7 +40,7 @@ async function validatei18n() {// Import the messages schema using jiti// @ts-ignoreconst { messagesSchema } = await loadTsFileViaJiti.import(- "./src/app/schema/i18n-messages.ts"+ "./src/app/schema/i18n-schema.ts");// Validate messages@@ -139,6 +139,15 @@ const nextConfig = {},];},+ async redirects() {+ return [+ {+ source: "/:locale/app", // Redirect all /:locale/app requests to the root, because we changed the structure of the app+ destination: "/",+ permanent: true,+ },+ ];+ },};export default withSentryConfig(withNextIntl(nextConfig), {diff --git a/package.json b/package.jsonindex fabc78e..fb78c95 100644--- a/package.json+++ b/package.json@@ -16,6 +16,7 @@"prettify": "prettier --write --cache '**/*.{ts?(x),json,js,mjs,yml,yaml,md}'","knip": "knip","update-deps": "pnpm upgrade --interactive --latest",+ "test": "pnpm exec playwright test","e2e": "pnpm exec playwright test","e2e:ui": "pnpm exec playwright test --ui","dedupe": "pnpm dedupe",diff --git a/playwright.config.ts b/playwright.config.tsindex e763cc5..d895e07 100644--- a/playwright.config.ts+++ b/playwright.config.ts@@ -26,12 +26,12 @@ export default defineConfig({/* Fail the build on CI if you accidentally left test.only in the source code. */forbidOnly: !!process.env.CI,/* Retry on CI only */- retries: process.env.CI ? 2 : 0,+ retries: process.env.CI ? 1 : 0,/* Opt out of parallel tests on CI. */workers: process.env.CI ? 1 : undefined,/* timeout for expect assertions */expect: {- timeout: 25_000,+ timeout: 30_000,},// /* timeout for test execution */diff --git a/public/llms.txt b/public/llms.txtnew file mode 100644index 0000000..abdc0cc--- /dev/null+++ b/public/llms.txt@@ -0,0 +1,17 @@+# EasyInvoicePDF++[EasyInvoicePDF](https://easyinvoicepdf.com) is a free and open-source invoice generator that runs entirely in your browser. It offers live previews, shareable links, instant PDF downloads, and supports multiple languages and currencies, including European VAT calculations. Built with React, TypeScript, Next.js, and TailwindCSS, it ensures privacy and security by processing data client-side.++## Features++- **Live Previews**: Real-time updates as you make changes.+- **Shareable Links**: Easily share invoices with clients.+- **Instant PDF Downloads**: Download invoices with one click.+- **Multi-language and Currency Support**: Create invoices in English, Polish, German, Spanish, Portuguese, Russian, Ukrainian, French, Italian, Dutch and other languages, with support for all major currencies.+- **European VAT Calculations**: Automatic VAT rate calculations.++## Main Pages++- [Home](https://easyinvoicepdf.com)+- [Features](https://easyinvoicepdf.com/en/about)+- [FAQ](https://easyinvoicepdf.com/en/about#faq)\ No newline at end of filediff --git a/src/actions/subscribe-action.ts b/src/actions/subscribe-action.tsindex c1a6645..3e2a09c 100644--- a/src/actions/subscribe-action.ts+++ b/src/actions/subscribe-action.ts@@ -6,13 +6,10 @@ import { generateSubscriptionToken } from "@/utils/subscription-token";import { checkRateLimit, ipLimiter, emailLimiter } from "@/lib/rate-limit";import { headers } from "next/headers";import ConfirmSubscriptionEmail from "@/emails/confirm-subscription";-import type { Locale } from "next-intl";-import { SUPPORTED_LANGUAGES } from "@/app/schema";const subscribeSchema = z.object({email: z.string().email("Please enter a valid email address"),- locale: z.enum(SUPPORTED_LANGUAGES).default("en"),}).strict();@@ -20,14 +17,17 @@ if (!process.env.RESEND_AUDIENCE_ID) {throw new Error("RESEND_AUDIENCE_ID is not set");}-const CONFIRMATION_URL = process.env.VERCEL_URL- ? `https://${process.env.VERCEL_URL}`- : "http://localhost:3000";+const CONFIRMATION_URL =+ process.env.VERCEL_ENV === "production"+ ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`+ : process.env.VERCEL_ENV === "preview"+ ? `https://${process.env.VERCEL_URL}`+ : "http://localhost:3000";-export async function subscribeAction(formData: FormData, locale: Locale) {+export async function subscribeAction(formData: FormData) {try {const email = formData.get("email");- const validatedFields = subscribeSchema.parse({ email, locale });+ const validatedFields = subscribeSchema.parse({ email });// Get IP address for rate limitingconst forwardedFor = headers().get("x-forwarded-for");@@ -64,7 +64,7 @@ export async function subscribeAction(formData: FormData, locale: Locale) {// Generate confirmation tokenconst token = await generateSubscriptionToken(validatedFields.email);- const confirmationUrl = `${CONFIRMATION_URL}/${validatedFields.locale}/confirm-subscription?token=${token}`;+ const confirmationUrl = `${CONFIRMATION_URL}/confirm-subscription?token=${token}`;// Send confirmation emailconst { error: emailError } = await resend.emails.send({diff --git a/src/app/[locale]/app/error.tsx b/src/app/(app)/error.tsxsimilarity index 97%rename from src/app/[locale]/app/error.tsxrename to src/app/(app)/error.tsxindex ecbdc27..1d87675 100644--- a/src/app/[locale]/app/error.tsx+++ b/src/app/(app)/error.tsx@@ -3,7 +3,7 @@import { Button } from "@/components/ui/button";import { useEffect } from "react";import { toast } from "sonner";-import { INITIAL_INVOICE_DATA } from "../../constants";+import { INITIAL_INVOICE_DATA } from "../constants";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import * as Sentry from "@sentry/nextjs";import { ErrorMessage } from "@/components/etc/error-message";diff --git a/src/app/[locale]/app/loading.tsx b/src/app/(app)/loading.tsxsimilarity index 100%rename from src/app/[locale]/app/loading.tsxrename to src/app/(app)/loading.tsxdiff --git a/src/app/[locale]/app/page.client.tsx b/src/app/(app)/page.client.tsxsimilarity index 96%rename from src/app/[locale]/app/page.client.tsxrename to src/app/(app)/page.client.tsxindex b9d4bac..3b55486 100644--- a/src/app/[locale]/app/page.client.tsx+++ b/src/app/(app)/page.client.tsx@@ -23,7 +23,9 @@ import {} from "@/components/ui/dialog";import { CustomTooltip, TooltipProvider } from "@/components/ui/tooltip";import { useDeviceContext } from "@/contexts/device-context";-import { Link, useRouter } from "@/i18n/navigation";+import Link from "next/link";+import { useRouter } from "next/navigation";+import { isLocalStorageAvailable } from "@/lib/check-local-storage";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import * as Sentry from "@sentry/nextjs";@@ -31,7 +33,6 @@ import {compressToEncodedURIComponent,decompressFromEncodedURIComponent,} from "lz-string";-import type { Locale } from "next-intl";import { useSearchParams } from "next/navigation";import { useEffect, useState } from "react";import { toast } from "sonner";@@ -94,9 +95,7 @@ function handleInvoiceNumberBreakingChange(json: unknown) {return json;}-export function AppPageClient({ params }: { params: { locale: Locale } }) {- const { locale } = params;-+export function AppPageClient() {const router = useRouter();const searchParams = useSearchParams();@@ -224,7 +223,7 @@ export function AppPageClient({ params }: { params: { locale: Locale } }) {);// Clean URL if data differs- router.replace("/app");+ router.replace("/");}} catch (error) {console.error("Failed to compare with URL data:", error);@@ -240,7 +239,7 @@ export function AppPageClient({ params }: { params: { locale: Locale } }) {_variant="outline"_size="sm"onClick={() => {- router.replace("/app");+ router.replace("/");toast.dismiss();}}>@@ -273,12 +272,12 @@ export function AppPageClient({ params }: { params: { locale: Locale } }) {try {const newInvoiceDataValidated = invoiceSchema.parse(invoiceDataState);const stringified = JSON.stringify(newInvoiceDataValidated);- const compressed = compressToEncodedURIComponent(stringified);+ const compressedData = compressToEncodedURIComponent(stringified);- router.push(`/app?data=${compressed}`);+ router.push(`/?data=${compressedData}`);// Construct full URL with locale and compressed data- const newFullUrl = `${window.location.origin}/${locale}/app?data=${compressed}`;+ const newFullUrl = `${window.location.origin}/?data=${compressedData}`;// Copy to clipboardawait navigator.clipboard.writeText(newFullUrl);@@ -389,7 +388,7 @@ export function AppPageClient({ params }: { params: { locale: Locale } }) {</div></div></div>- <Footer locale={locale} />+ <Footer /></TooltipProvider>);}@@ -445,7 +444,7 @@ function ProjectInfo() {</DialogHeader><div className="aspect-video w-full overflow-hidden"><video- src="https://ik.imagekit.io/fl2lbswwo/easy-invoice/easy-invoice-demo.mp4"+ src="https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-demo.mp4"mutedcontrolsautoPlay@@ -460,7 +459,7 @@ function ProjectInfo() {);}-function Footer({ locale }: { locale: Locale }) {+function Footer() {return (<footer className="w-full border-t border-slate-200 bg-white py-12 md:py-16"><div className="container mx-auto px-4 md:px-6">@@ -529,8 +528,7 @@ function Footer({ locale }: { locale: Locale }) {<ul className="space-y-2"><li><Link- href="/about"- locale={locale}+ href="/en/about"className="text-sm text-slate-500 hover:text-slate-900">About@@ -575,7 +573,6 @@ function Footer({ locale }: { locale: Locale }) {error: "Failed to subscribe. Please try again.",emailLanguageInfo: "All emails will be sent in English",}}- locale={locale}/></div><div className="mt-10 flex flex-col items-center justify-between gap-4 border-t border-slate-200 pt-8 md:flex-row">diff --git a/src/app/[locale]/app/page.tsx b/src/app/(app)/page.tsxsimilarity index 55%rename from src/app/[locale]/app/page.tsxrename to src/app/(app)/page.tsxindex fddfe64..6cd7436 100644--- a/src/app/[locale]/app/page.tsx+++ b/src/app/(app)/page.tsx@@ -1,5 +1,3 @@-import type { Locale } from "next-intl";-import type { Metadata } from "next";import { AppPageClient } from "./page.client";@@ -10,33 +8,37 @@ export async function generateMetadata({searchParams: { [key: string]: string | string[] | undefined };}): Promise<Metadata> {const hasShareableData = Boolean(searchParams?.data);+ const isProd = process.env.VERCEL_ENV === "production";++ const defaultRobotsConfig = {+ index: false,+ follow: false,+ googleBot: {+ index: false,+ follow: false,+ },+ };++ // Only allow indexing on production and when there's no shareable data+ const shouldIndex = isProd && !hasShareableData;- // we want to index this page if there is no shareable datareturn {- robots: hasShareableData+ robots: shouldIndex? {- index: false,- follow: false,- googleBot: {- index: false,- follow: false,- },- }- : {index: true,follow: true,googleBot: {index: true,follow: true,},- },+ }+ : defaultRobotsConfig,alternates: {- // preferred version of the page- canonical: `/en/app`,+ canonical: "/",},};}-export default function AppPage({ params }: { params: { locale: Locale } }) {- return <AppPageClient params={params} />;+export default function AppPage() {+ return <AppPageClient />;}diff --git a/src/app/[locale]/about/error.tsx b/src/app/[locale]/about/error.tsxdeleted file mode 100644index fe55a79..0000000--- a/src/app/[locale]/about/error.tsx+++ /dev/null@@ -1,49 +0,0 @@-"use client";--import { useTranslations } from "next-intl";-import { useEffect } from "react";-import * as Sentry from "@sentry/nextjs";-import { Button } from "@/components/ui/button";-import { Link } from "@/i18n/navigation";-import { ErrorMessage } from "@/components/etc/error-message";-import { toast } from "sonner";--type Props = {- error: Error;- reset(): void;-};--export default function Error({ error, reset }: Props) {- const t = useTranslations("Error");-- useEffect(() => {- Sentry.captureException(error);-- toast.error(t("toastMessage"), {- closeButton: true,- richColors: true,- });- }, [error, t]);-- return (- <div className="flex h-dvh flex-col items-center justify-center gap-4">- <div className="flex flex-col items-center justify-center gap-4">- <ErrorMessage>- {t("title")}. {t("description")}{" "}- <a- href="https://pdfinvoicegenerator.userjot.com/board/bugs"- className="underline"- >- {t("bugReport")}- </a>- </ErrorMessage>- </div>- <Button onClick={reset} _variant="outline">- {t("tryAgain")}- </Button>- <Button asChild>- <Link href="/about">{t("goBack")}</Link>- </Button>- </div>- );-}diff --git a/src/app/[locale]/about/layout.tsx b/src/app/[locale]/about/layout.tsxindex 9330a39..a61bc4f 100644--- a/src/app/[locale]/about/layout.tsx+++ b/src/app/[locale]/about/layout.tsx@@ -41,12 +41,28 @@ export async function generateMetadata({description: messages.Metadata.about.description,locale: params.locale,type: "website",+ images: [+ {+ url: "https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-opengraph-image.png",+ width: 1200,+ height: 630,+ alt: "Free Invoice Generator - A web application offering live preview, open source functionality, and no sign up required",+ },+ ],},twitter: {card: "summary_large_image",title: messages.Metadata.about.title,description: messages.Metadata.about.description,creator: "@vlad_sazon",+ images: [+ {+ url: "https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-opengraph-image.png",+ width: 1200,+ height: 630,+ alt: "Free Invoice Generator - A web application offering live preview, open source functionality, and no sign up required",+ },+ ],},robots: {index: true,@@ -85,6 +101,5 @@ export default async function AboutLocaleLayout({// Enables static rendering to prevent an error: https://nextjs.org/docs/messages/dynamic-server-errorsetRequestLocale(locale);- // return children;return children;}diff --git a/src/app/[locale]/about/page.tsx b/src/app/[locale]/about/page.tsxindex ca0f85d..c85e910 100644--- a/src/app/[locale]/about/page.tsx+++ b/src/app/[locale]/about/page.tsx@@ -10,7 +10,7 @@ import {} from "@/components/ui/disclosure";import { TooltipProvider } from "@/components/ui/tooltip";import { Video } from "@/components/video";-import { Link } from "@/i18n/navigation";+import Link from "next/link";import { cn } from "@/lib/utils";import {CalculatorIcon,@@ -117,10 +117,10 @@ export default function AboutPage({ params }: { params: { locale: Locale } }) {<HeroSection /><FeaturesSection /><FaqSection />- <SubscribeSection locale={locale} />+ <SubscribeSection /><CtaSection /></main>- <Footer locale={locale} />+ <Footer /></div></TooltipProvider>);@@ -221,8 +221,8 @@ function HeroSection() {{/* 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"+ src="https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-demo.mp4"+ fallbackImg="https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-video-placeholder.webp?v=1"testId="hero-about-page-video"/></div>@@ -389,7 +389,7 @@ function FaqSection() {);}-function SubscribeSection({ locale }: { locale: Locale }) {+function SubscribeSection() {const tNewsletter = useTranslations("About.newsletter");const newsletterTitle = tNewsletter("title");@@ -426,7 +426,6 @@ function SubscribeSection({ locale }: { locale: Locale }) {error: newsletterErrorMessage,emailLanguageInfo: newsletterEmailLanguageInfo,}}- locale={locale}/></div></div>@@ -479,7 +478,7 @@ function CtaSection() {);}-function Footer({ locale }: { locale: Locale }) {+function Footer() {const t = useTranslations("About");const tFaq = useTranslations("FAQ");const tNewsletter = useTranslations("About.newsletter");@@ -553,7 +552,7 @@ function Footer({ locale }: { locale: Locale }) {<ul className="space-y-2" data-testid="about-page-footer-links"><li><Link- href="/app"+ href="/"className="text-sm text-slate-500 hover:text-slate-900">{t("buttons.app")}@@ -613,7 +612,6 @@ function Footer({ locale }: { locale: Locale }) {error: newsletterErrorMessage,emailLanguageInfo: newsletterEmailLanguageInfo,}}- locale={locale}/></div><div className="mt-10 flex flex-col items-center justify-between gap-4 border-t border-slate-200 pt-8 md:flex-row">@@ -656,7 +654,7 @@ function GoToAppButton({ className }: { className?: string }) {* 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}>+ <Link href="/" scroll={false}><ArrowRight className="mr-2 h-5 w-5 transition-transform group-hover:scale-110" />{t("buttons.goToApp")}</Link>diff --git a/src/app/[locale]/error.tsx b/src/app/[locale]/error.tsxindex 565a938..3aa21e5 100644--- a/src/app/[locale]/error.tsx+++ b/src/app/[locale]/error.tsx@@ -1,12 +1,11 @@"use client";-import { useTranslations } from "next-intl";import { useEffect } from "react";import * as Sentry from "@sentry/nextjs";import { Button } from "@/components/ui/button";import { ErrorMessage } from "@/components/etc/error-message";import { toast } from "sonner";-import { Link } from "@/i18n/navigation";+import Link from "next/link";type Props = {error: Error;@@ -14,35 +13,39 @@ type Props = {};export default function Error({ error, reset }: Props) {- const t = useTranslations("Error");-useEffect(() => {Sentry.captureException(error);- toast.error(t("toastMessage"), {- closeButton: true,- richColors: true,- });- }, [error, t]);+ toast.error(+ "Something went wrong! Please try to refresh the page or fill a bug report.",+ {+ closeButton: true,+ richColors: true,+ }+ );+ }, [error]);return (<div className="flex h-dvh flex-col items-center justify-center gap-4"><div className="flex flex-col items-center justify-center gap-4"><ErrorMessage>- {t("title")}. {t("description")}{" "}+ Something went wrong. Please try to refresh the page or fill a bug+ report{" "}<ahref="https://pdfinvoicegenerator.userjot.com/board/bugs"className="underline"+ target="_blank"+ rel="noopener noreferrer">- {t("bugReport")}+ here</a></ErrorMessage></div><Button onClick={reset} _variant="outline">- {t("tryAgain")}+ Try again</Button><Button asChild>- <Link href="/app">{t("goBack")}</Link>+ <Link href="/">Return to homepage</Link></Button></div>);diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsxindex f8a3f32..4dfdc7e 100644--- a/src/app/[locale]/layout.tsx+++ b/src/app/[locale]/layout.tsx@@ -1,143 +1,8 @@-import { SpeedInsights } from "@vercel/speed-insights/next";-import type { Metadata, Viewport } from "next";-import Script from "next/script";--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";--export const viewport: Viewport = {- initialScale: 1, // Sets the default zoom level to 1 (100%)- width: "device-width", // Ensures the viewport width matches the device's screen width- maximumScale: 1, // Prevents users from zooming in- viewportFit: "cover", // Enables edge-to-edge content display on devices with rounded corners (like iPhones with a notch)-};--export const metadata: Metadata = {- metadataBase: new URL(APP_URL),- title: "Invoice Generator with Live Preview | No Sign-Up",- description:- "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 Generator with Live Preview | No Sign-Up",- description:- "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 Generator with Live Preview | No Sign-Up",- description:- "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",- },-};-+// TODO: figure out if we need this layoutexport default async function RootLayout({children,- params,}: Readonly<{children: React.ReactNode;- params: { locale: Locale };}>) {- // Ensure that the incoming `locale` is valid- const { locale } = params;-- // Validate that the locale from the URL params exists in our supported locales- // If not found, redirect to the 404 page using Next.js notFound() function- if (!hasLocale(routing.locales, locale)) {- notFound();- }-- return (- <>- {/* React-scan is a tool for detecting and fixing issues with React components- https://github.com/aidenybai/react-scan#readme- Uncomment if needed- */}- {/* {process.env.VERCEL_ENV === "development" && (- <head>- <script- crossOrigin="anonymous"- src="//unpkg.com/react-scan/dist/auto.global.js"- />- </head>- )} */}-- {children}-- {/* https://sonner.emilkowal.ski/ */}- <Toaster visibleToasts={1} richColors closeButton />-- {/* should only be enabled in production */}- {process.env.VERCEL_ENV === "production" && (- <>- {/* https://vercel.com/vladsazon27s-projects/pdf-invoice-generator/speed-insights */}- <SpeedInsights />- {/* https://eu.umami.is/dashboard */}- <Script- // we proxy umami check next.config.mjs rewrites- src="/stats/script.js"- data-website-id="1914352c-5ebb-4806-bfc3-f494712bb4a4"- defer- />- </>- )}- <script- id="json-ld"- type="application/ld+json"- dangerouslySetInnerHTML={{ __html: JSON.stringify(JSONLD) }}- />- </>- );+ return <>{children}</>;}diff --git a/src/app/[locale]/not-found.tsx b/src/app/[locale]/not-found.tsxdeleted file mode 100644index 8a63c4f..0000000--- a/src/app/[locale]/not-found.tsx+++ /dev/null@@ -1,36 +0,0 @@-import { hasLocale, useTranslations, type Locale } from "next-intl";-import { setRequestLocale } from "next-intl/server";-import { routing } from "@/i18n/routing";-import { Link } from "@/i18n/navigation";--export default function NotFound({ params }: { params?: { locale: Locale } }) {- const t = useTranslations("NotFound");-- const locale = params?.locale;-- if (hasLocale(routing.locales, locale)) {- // Enables static rendering to prevent an error: https://nextjs.org/docs/messages/dynamic-server-error- setRequestLocale(locale);- }-- return (- <div className="flex h-screen w-full items-center justify-center font-sans">- <div className="flex flex-col items-center justify-center">- <div className="flex items-center">- <h1 className="mr-5 border-r border-r-black/30 pr-6 text-2xl font-medium dark:border-r-white/30">- {t("error")}- </h1>- <div>- <h2 className="text-base font-normal">{t("message")}</h2>- <Link- href="/app"- className="mt-4 text-sm text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200"- >- {t("returnHome")}- </Link>- </div>- </div>- </div>- </div>- );-}diff --git a/src/app/[locale]/opengraph-image.png b/src/app/[locale]/opengraph-image.pngdeleted file mode 100644index a1fe9fd..0000000Binary files a/src/app/[locale]/opengraph-image.png and /dev/null differdiff --git a/src/app/components/invoice-pdf-download-link.tsx b/src/app/components/invoice-pdf-download-link.tsxindex 5c53c81..7cad3e6 100644--- a/src/app/components/invoice-pdf-download-link.tsx+++ b/src/app/components/invoice-pdf-download-link.tsx@@ -16,11 +16,10 @@ import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { ErrorGeneratingPdfToast } from "@/components/ui/toasts/error-generating-pdf-toast";import * as Sentry from "@sentry/nextjs";-// Move static content outside component to prevent recreationconst DONATION_TOAST_CONFIG = {- title: "Consider Supporting Us!",+ title: "❤️ Enjoying EasyInvoicePDF? Help Keep It Free!",description:- "If you find this tool helpful, please consider making a small donation to support our work.",+ "This tool is free and ad-free thanks to user support. If it’s helped you, consider a small donation to keep it running and growing. Every bit counts—thank you!",duration: Infinity,closeButton: true,} as const;diff --git a/src/app/[locale]/confirm-subscription/page.tsx b/src/app/confirm-subscription/page.tsxsimilarity index 95%rename from src/app/[locale]/confirm-subscription/page.tsxrename to src/app/confirm-subscription/page.tsxindex ac687e5..4c3f059 100644--- a/src/app/[locale]/confirm-subscription/page.tsx+++ b/src/app/confirm-subscription/page.tsx@@ -1,8 +1,7 @@import { verifySubscriptionToken } from "@/utils/subscription-token";import { resend } from "@/lib/resend";-// eslint-disable-next-line no-restricted-importsimport { redirect } from "next/navigation";-import { Link } from "@/i18n/navigation";+import Link from "next/link";import { headers } from "next/headers";export const metadata = {@@ -72,9 +71,9 @@ export default async function ConfirmSubscriptionPage({improvements.</Text><Text>- Ready to create your first invoice?{" "}+ <b>Ready to create your first invoice?</b>{" "}<Link- href="/app"+ href="/"className="inline-flex items-center font-medium text-emerald-600 underline underline-offset-4 transition-opacity hover:opacity-80">Go to the appdiff --git a/src/app/layout.tsx b/src/app/layout.tsxindex 571da6c..5b69990 100644--- a/src/app/layout.tsx+++ b/src/app/layout.tsx@@ -1,9 +1,107 @@-import { NextIntlClientProvider } from "next-intl";-import { checkDeviceUserAgent } from "@/lib/check-device.server";import { DeviceContextProvider } from "@/contexts/device-context";+import { checkDeviceUserAgent } from "@/lib/check-device.server";+import { NextIntlClientProvider } from "next-intl";++import { SpeedInsights } from "@vercel/speed-insights/next";+import type { Metadata, Viewport } from "next";+import Script from "next/script";++import { type WebSite, type WithContext } from "schema-dts";+import { Toaster } from "sonner";++import { APP_URL } from "@/config";import "./globals.css";+export const viewport: Viewport = {+ initialScale: 1, // Sets the default zoom level to 1 (100%)+ width: "device-width", // Ensures the viewport width matches the device's screen width+ maximumScale: 1, // Prevents users from zooming in+ viewportFit: "cover", // Enables edge-to-edge content display on devices with rounded corners (like iPhones with a notch)+};++export const metadata: Metadata = {+ metadataBase: new URL(APP_URL),+ title: "Invoice Generator with Live Preview | No Sign-Up",+ description:+ "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 Generator with Live Preview | No Sign-Up",+ description:+ "Create and download professional invoices instantly with real-time preview. Free and open-source. No signup required.",+ locale: "en_US",+ type: "website",+ images: [+ {+ url: "https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-opengraph-image.png",+ width: 1200,+ height: 630,+ alt: "Free Invoice Generator - A web application offering live preview, open source functionality, and no sign up required",+ },+ ],+ },+ twitter: {+ card: "summary_large_image",+ title: "Invoice Generator with Live Preview | No Sign-Up",+ description:+ "Create and download professional invoices instantly with real-time preview. Free and open-source. No signup required.",+ creator: "@vlad_sazon",+ images: [+ {+ url: "https://easy-invoice-pdf-assets.1xeq.workers.dev/easy-invoice-opengraph-image.png",+ width: 1200,+ height: 630,+ alt: "Free Invoice Generator - A web application offering live preview, open source functionality, and no sign up required",+ },+ ],+ },+};++const JSONLD: WithContext<WebSite> = {+ "@context": "https://schema.org",+ "@type": "WebSite",+ url: "https://easyinvoicepdf.com/",+ 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/`,+ 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,}: Readonly<{@@ -15,7 +113,43 @@ export default async function RootLayout({<html lang="en"><body><DeviceContextProvider isDesktop={isDesktopServer}>- <NextIntlClientProvider>{children}</NextIntlClientProvider>+ <NextIntlClientProvider>+ {/* React-scan is a tool for detecting and fixing issues with React+ components https://github.com/aidenybai/react-scan#readme Uncomment+ if needed */}+ {/* {process.env.VERCEL_ENV === "development" && (+ <head>+ <script+ crossOrigin="anonymous"+ src="//unpkg.com/react-scan/dist/auto.global.js"+ />+ </head>+ )} */}++ {children}++ {/* https://sonner.emilkowal.ski/ */}+ <Toaster visibleToasts={1} richColors closeButton />+ {/* should only be enabled in production */}+ {process.env.VERCEL_ENV === "production" && (+ <>+ {/* https://vercel.com/vladsazon27s-projects/pdf-invoice-generator/speed-insights */}+ <SpeedInsights />+ {/* https://eu.umami.is/dashboard */}+ <Script+ // we proxy umami check next.config.mjs rewrites+ src="/stats/script.js"+ data-website-id="1914352c-5ebb-4806-bfc3-f494712bb4a4"+ defer+ />+ </>+ )}+ <script+ id="json-ld"+ type="application/ld+json"+ dangerouslySetInnerHTML={{ __html: JSON.stringify(JSONLD) }}+ />+ </NextIntlClientProvider></DeviceContextProvider></body></html>diff --git a/src/app/not-found.tsx b/src/app/not-found.tsxindex 7c9ed28..3e5ef10 100644--- a/src/app/not-found.tsx+++ b/src/app/not-found.tsx@@ -1,28 +1,25 @@"use client";-// page needs to be "use client" here to prevent an error: https://nextjs.org/docs/messages/dynamic-server-error-import { useTranslations } from "next-intl";-// eslint-disable-next-line no-restricted-importsimport Link from "next/link";export default function NotFound() {- const t = useTranslations("NotFound");-return (<div className="flex h-screen w-full items-center justify-center font-sans"><div className="flex flex-col items-center justify-center"><div className="flex items-center"><h1 className="mr-5 border-r border-r-black/30 pr-6 text-2xl font-medium dark:border-r-white/30">- {t("error")}+ 404</h1><div>- <h2 className="text-base font-normal">{t("message")}</h2>+ <h2 className="text-base font-normal">+ This page could not be found.+ </h2><Link- href="/app"+ href="/"className="mt-4 text-sm text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-200">- {t("returnHome")}+ Return to homepage</Link></div></div>diff --git a/src/app/opengraph-image.png b/src/app/opengraph-image.pngdeleted file mode 100644index bf4f710..0000000Binary files a/src/app/opengraph-image.png and /dev/null differdiff --git a/src/app/robots.ts b/src/app/robots.tsindex 58ef57f..2022052 100644--- a/src/app/robots.ts+++ b/src/app/robots.ts@@ -8,26 +8,17 @@ export default function robots(): MetadataRoute.Robots {{userAgent: "*",allow: [+ // Allow main app page (now at /)+ "/",// 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=*",+ // Disallow shared invoice URLs, like /?data=*+ "/?data=*",// Disallow subscription confirmation pages with and without tokens"/confirm-subscription","/confirm-subscription?*",- ...SUPPORTED_LANGUAGES.flatMap((locale) => [- `/${locale}/confirm-subscription`,- `/${locale}/confirm-subscription?*`,- ]),- // Disallow any other query parameters- "/*?*",],},],diff --git a/src/app/schema/i18n-messages.ts b/src/app/schema/i18n-schema.tssimilarity index 88%rename from src/app/schema/i18n-messages.tsrename to src/app/schema/i18n-schema.tsindex 9b81081..a84232a 100644--- a/src/app/schema/i18n-messages.ts+++ b/src/app/schema/i18n-schema.ts@@ -12,25 +12,6 @@ const metadataSchema = z}).strict();-const notFoundSchema = z- .object({- error: z.string(),- message: z.string(),- returnHome: z.string(),- })- .strict();--const errorSchema = z- .object({- title: z.string(),- description: z.string(),- bugReport: z.string(),- tryAgain: z.string(),- goBack: z.string(),- toastMessage: z.string(),- })- .strict();-const aboutFeaturesItemSchema = z.object({title: z.string(),@@ -151,8 +132,6 @@ const faqSchema = zexport const messagesSchema = z.object({About: aboutSchema,- NotFound: notFoundSchema,- Error: errorSchema,Metadata: metadataSchema,FAQ: faqSchema,})diff --git a/src/app/sitemap.ts b/src/app/sitemap.tsindex 61079f3..798029f 100644--- a/src/app/sitemap.ts+++ b/src/app/sitemap.ts@@ -8,9 +8,9 @@ export default function sitemap(): MetadataRoute.Sitemap {const sitemapEntries: MetadataRoute.Sitemap = [// Main app page (non-shared version){- url: `${APP_URL}/en/app`,+ url: `${APP_URL}/`,lastModified,- changeFrequency: "daily",+ changeFrequency: "weekly",priority: 1,},diff --git a/src/components/subscribe-input.tsx b/src/components/subscribe-input.tsxindex 071c2dd..3a52c27 100644--- a/src/components/subscribe-input.tsx+++ b/src/components/subscribe-input.tsx@@ -8,7 +8,6 @@ import { useState } from "react";import { useFormStatus } from "react-dom";import { toast } from "sonner";import { cn } from "@/lib/utils";-import type { Locale } from "next-intl";function SubmitButton({translations,@@ -44,7 +43,6 @@ function SubmitButton({export function SubscribeInput({translations,- locale,}: {translations: {title: string;@@ -55,7 +53,6 @@ export function SubscribeInput({error: string;emailLanguageInfo: string;};- locale: Locale;}) {const [isSubmitted, setSubmitted] = useState(false);@@ -79,7 +76,7 @@ export function SubscribeInput({<formdata-testid="subscribe-form"action={async (formData) => {- const result = await subscribeAction(formData, locale);+ const result = await subscribeAction(formData);if (result.error) {toast.error(result.error);diff --git a/src/i18n/request.ts b/src/i18n/request.tsindex 8c1ebcf..2454109 100644--- a/src/i18n/request.ts+++ b/src/i18n/request.ts@@ -7,6 +7,7 @@ export default getRequestConfig(async ({ requestLocale }) => {try {// Typically corresponds to the `[locale]` segmentconst requested = await requestLocale;+const locale = hasLocale(routing.locales, requested)? requested: routing.defaultLocale;diff --git a/src/middleware.ts b/src/middleware.tsindex 269f960..8938877 100644--- a/src/middleware.ts+++ b/src/middleware.ts@@ -1,32 +1,17 @@import createMiddleware from "next-intl/middleware";import { routing } from "./i18n/routing";-import { NextResponse } from "next/server";import type { NextRequest } from "next/server";-// Create the middleware handlerconst intlMiddleware = createMiddleware(routing);-// Custom middleware handler that adds the redirect logicexport 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 middlewarereturn intlMiddleware(request);}+// ___IMPORTANT__: we restrict the middleware to only the /about page for i18n+// because the /about page is the only page that has i18n+// if you want to add i18n to other pages, you need to add them to the matcherexport const config = {- // Match all pathnames except for- // - … if they start with `/api`, `/trpc`, `/_next` or `/_vercel`- // - … the ones containing a dot (e.g. `favicon.ico`)- matcher: [- "/((?!api|trpc|_next|_vercel|.*\\..*).*)",- // Include the root path explicitly for the redirect- "/",- ],+ // Match only "/:locale/about" paths for i18n (en/about, pl/about, de/about, etc.)+ matcher: ["/:locale/about"],};