Skip to content

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

feat: jsonld, metadata improvements (#246)

Vlad Sazonau9bf62998cd67
diff --git a/e2e/about.test.ts b/e2e/about.test.ts
index a94d48b..af28910 100644
--- a/e2e/about.test.ts
+++ b/e2e/about.test.ts
@@ -19,7 +19,7 @@ test.describe("About page", () => {
await expect(page).toHaveURL("/en/about");
await expect(page).toHaveTitle(
- "Free Invoice Generator PDF - EasyInvoicePDF",
+ "About EasyInvoicePDF - Free, Open-Source Invoice Generator",
);
const header = page.getByRole("banner");
diff --git a/e2e/server-render-pdf/server-render-pdf.test.ts b/e2e/server-render-pdf/server-render-pdf.test.ts
index ed3209c..6de670e 100644
--- a/e2e/server-render-pdf/server-render-pdf.test.ts
+++ b/e2e/server-render-pdf/server-render-pdf.test.ts
@@ -6,10 +6,14 @@ import path from "node:path";
import { test, expect } from "@playwright/test";
import { renderPdfOnCanvas } from "../utils/render-pdf-on-canvas";
+// IMPORTANT - we use spawnServerPdfRender() to generate server-side PDF files for visual regression testing
/**
* Spawn child process to render invoice PDF on server, for a given language.
+ *
* Uses Vitest to run export-server-pdf.test.ts, which writes PDF to temp file.
- * Returns Buffer of generated PDF. Deletes temp file after reading.
+ *
+ * Returns Buffer of generated PDF. Always deletes temp file before returning or throwing.
+ *
* Throws error if process fails or PDF not created.
*/
function spawnServerPdfRender(language: "en" | "pl"): Buffer {
@@ -19,40 +23,39 @@ function spawnServerPdfRender(language: "en" | "pl"): Buffer {
`server-pdf-${language}-${process.pid}-${Date.now()}.pdf`,
);
- // Run vitest test that generates PDF, passing env vars for output and language
- const result = spawnSync(
- "pnpm",
- [
- "vitest",
- "run",
- "src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts",
- ],
- {
- cwd: process.cwd(),
- env: {
- ...process.env,
- PDF_EXPORT_PATH: tmpFile, // test will write PDF here
- PDF_EXPORT_LANG: language, // test will use this language
+ try {
+ // Run vitest test that generates PDF, passing env vars for output and language
+ const result = spawnSync(
+ "pnpm",
+ [
+ "vitest",
+ "run",
+ "src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts",
+ ],
+ {
+ cwd: process.cwd(),
+ env: {
+ ...process.env,
+ PDF_EXPORT_PATH: tmpFile, // test will write PDF here
+ PDF_EXPORT_LANG: language, // test will use this language
+ },
+ stdio: "pipe",
+ encoding: "utf-8",
},
- stdio: "pipe",
- encoding: "utf-8",
- },
- );
-
- // If test failed, throw error with stdout/stderr for debugging
- if (result.status !== 0) {
- throw new Error(
- `Server PDF render failed (${language}):\n${result.stdout}\n${result.stderr}`,
);
- }
- // Check that temp PDF file was created
- if (!fs.existsSync(tmpFile)) {
- throw new Error(`Server PDF file was not created: ${tmpFile}`);
- }
+ // If test failed, throw error with stdout/stderr for debugging
+ if (result.status !== 0) {
+ throw new Error(
+ `Server PDF render failed (${language}):\n${result.stdout}\n${result.stderr}`,
+ );
+ }
+
+ // Check that temp PDF file was created
+ if (!fs.existsSync(tmpFile)) {
+ throw new Error(`Server PDF file was not created: ${tmpFile}`);
+ }
- // Read and return PDF buffer, ensure temp file is deleted afterwards
- try {
return fs.readFileSync(tmpFile);
} finally {
fs.rmSync(tmpFile, { force: true });
diff --git a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-en-invoice-Desktop-Chrome-darwin.png b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-en-invoice-Desktop-Chrome-darwin.png
index 52180f2..c453be9 100644
Binary files a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-en-invoice-Desktop-Chrome-darwin.png and b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-en-invoice-Desktop-Chrome-darwin.png differ
diff --git a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-pl-invoice-Desktop-Chrome-darwin.png b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-pl-invoice-Desktop-Chrome-darwin.png
index 42206df..aa56be2 100644
Binary files a/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-pl-invoice-Desktop-Chrome-darwin.png and b/e2e/server-render-pdf/server-render-pdf.test.ts-snapshots/server-pl-invoice-Desktop-Chrome-darwin.png differ
diff --git a/lint-staged.config.js b/lint-staged.config.js
index dac849f..6c5f5a3 100644
--- a/lint-staged.config.js
+++ b/lint-staged.config.js
@@ -1,11 +1,12 @@
module.exports = {
- // Run type-check on all changes to files
+ // Run type-check, lint, security check, knip, prettify, and vitest on all changes to files
// https://github.com/okonet/lint-staged
"*": () => [
`pnpm run type-check:go`,
`pnpm run lint`,
`pnpm run check-github-actions-security`, // zizmor is used to check the security of the GitHub Actions workflows https://docs.zizmor.sh/
`pnpm run knip`,
+ `pnpm run vitest --run --reporter=verbose`,
`pnpm run prettify --write`,
],
};
diff --git a/messages/en.json b/messages/en.json
index e25682c..6c9e8f7 100644
--- a/messages/en.json
+++ b/messages/en.json
@@ -1,8 +1,8 @@
{
"Metadata": {
"about": {
- "title": "Free Invoice Generator PDF - EasyInvoicePDF",
- "description": "Create and download PDF invoices instantly with EasyInvoicePDF. Free, open-source, client-side invoice generator with live preview, templates, and shareable links. No signup required.",
+ "title": "About EasyInvoicePDF - Free, Open-Source Invoice Generator",
+ "description": "Learn how EasyInvoicePDF helps freelancers and small businesses create professional PDF invoices for free - open source, privacy-first, no signup.",
"keywords": "free invoice generator, PDF invoice maker, online invoice tool, billing software, open source invoice",
"siteName": "EasyInvoicePDF.com | Free Invoice Generator"
}
diff --git a/src/app/(app)/home-json-ld.tsx b/src/app/(app)/home-json-ld.tsx
index 84857b3..0217afd 100644
--- a/src/app/(app)/home-json-ld.tsx
+++ b/src/app/(app)/home-json-ld.tsx
@@ -5,6 +5,8 @@ import { JsonLdScript } from "@/lib/seo/render-json-ld";
import { JSON_LD_IDS } from "@/lib/seo/json-ld-ids";
import {
buildFullWebSite,
+ buildOrganization,
+ buildSiteNavigationList,
buildWebApplication,
HOME_PAGE_DESCRIPTION,
SITE_NAME,
@@ -17,7 +19,9 @@ export function buildHomeJsonLdGraph(): Graph {
"@context": "https://schema.org",
"@graph": [
buildFullWebSite(),
+ buildOrganization(),
buildWebApplication(),
+ buildSiteNavigationList(),
{
"@type": "WebPage",
"@id": `${pageUrl}#webpage`,
@@ -31,6 +35,9 @@ export function buildHomeJsonLdGraph(): Graph {
mainEntity: {
"@id": JSON_LD_IDS.app,
},
+ hasPart: {
+ "@id": JSON_LD_IDS.siteNavigation,
+ },
},
],
};
diff --git a/src/app/(seo-landings)/__tests__/build-seo-landing-json-ld.test.ts b/src/app/(seo-landings)/__tests__/build-seo-landing-json-ld.test.ts
new file mode 100644
index 0000000..5eb614b
--- /dev/null
+++ b/src/app/(seo-landings)/__tests__/build-seo-landing-json-ld.test.ts
@@ -0,0 +1,72 @@
+import { describe, expect, it } from "vitest";
+
+import { buildSeoLandingJsonLd } from "../build-seo-landing-json-ld";
+import { SEO_LANDING_DEFINITIONS } from "../seo-landing-definitions";
+import { JSON_LD_IDS } from "@/lib/seo/json-ld-ids";
+
+describe("buildSeoLandingJsonLd", () => {
+ it("links no-login page mainEntity to FAQPage with account and pricing questions first", () => {
+ const definition = SEO_LANDING_DEFINITIONS["invoice-generator-no-login"];
+ const graph = buildSeoLandingJsonLd(definition);
+ const parsed = JSON.parse(JSON.stringify(graph)) as {
+ "@graph": Array<Record<string, unknown>>;
+ };
+ const webPage = parsed["@graph"][0];
+ const faqPage = parsed["@graph"][1] as {
+ mainEntity: Array<{ name: string }>;
+ };
+
+ expect(webPage).toMatchObject({
+ "@type": "WebPage",
+ "@id": "https://easyinvoicepdf.com/invoice-generator-no-login#webpage",
+ name: "Invoice Generator With No Login or Signup Required",
+ mainEntity: {
+ "@id": "https://easyinvoicepdf.com/invoice-generator-no-login#faq",
+ },
+ });
+
+ expect(faqPage).toMatchObject({
+ "@type": "FAQPage",
+ "@id": "https://easyinvoicepdf.com/invoice-generator-no-login#faq",
+ });
+ expect(faqPage.mainEntity[0]?.name).toBe("Do I need to create an account?");
+ expect(faqPage.mainEntity[1]?.name).toBe("Is it really free?");
+ });
+
+ it("adds SoftwareApplication mainEntity for open-source landing", () => {
+ const definition = SEO_LANDING_DEFINITIONS["open-source-invoice-generator"];
+ const graph = buildSeoLandingJsonLd(definition);
+ const parsed = JSON.parse(JSON.stringify(graph)) as {
+ "@graph": Array<Record<string, unknown>>;
+ };
+ const webPage = parsed["@graph"][0];
+ const softwareApp = parsed["@graph"][1];
+ const faqPage = parsed["@graph"][2];
+
+ expect(webPage).toMatchObject({
+ "@type": "WebPage",
+ mainEntity: {
+ "@id":
+ "https://easyinvoicepdf.com/open-source-invoice-generator#software",
+ },
+ });
+
+ expect(softwareApp).toMatchObject({
+ "@type": "SoftwareApplication",
+ "@id":
+ "https://easyinvoicepdf.com/open-source-invoice-generator#software",
+ name: "Open Source Invoice Generator (Free, No Signup) | EasyInvoicePDF",
+ offers: {
+ price: "0",
+ priceCurrency: "EUR",
+ },
+ creator: { "@id": JSON_LD_IDS.organization },
+ });
+ expect(softwareApp).not.toHaveProperty("aggregateRating");
+
+ expect(faqPage).toMatchObject({
+ "@type": "FAQPage",
+ "@id": "https://easyinvoicepdf.com/open-source-invoice-generator#faq",
+ });
+ });
+});
diff --git a/src/app/(seo-landings)/build-seo-landing-json-ld.ts b/src/app/(seo-landings)/build-seo-landing-json-ld.ts
index 3930b23..046c367 100644
--- a/src/app/(seo-landings)/build-seo-landing-json-ld.ts
+++ b/src/app/(seo-landings)/build-seo-landing-json-ld.ts
@@ -1,4 +1,4 @@
-import { PROD_WEBSITE_URL } from "@/config";
+import { GITHUB_URL, PROD_WEBSITE_URL } from "@/config";
import type { Graph } from "schema-dts";
import { buildBreadcrumbList } from "@/lib/seo/breadcrumb";
@@ -6,17 +6,44 @@ import {
JSON_LD_IDS,
pageBreadcrumbId,
pageFaqId,
+ pageSoftwareAppId,
pageWebPageId,
} from "@/lib/seo/json-ld-ids";
import type { SeoLandingDefinition } from "./seo-landing-definitions";
+function buildLandingSoftwareApplication(
+ pageUrl: string,
+ definition: SeoLandingDefinition,
+) {
+ return {
+ "@type": "SoftwareApplication" as const,
+ "@id": pageSoftwareAppId(pageUrl),
+ url: pageUrl,
+ name: definition.metadata.title,
+ description: definition.metadata.description,
+ operatingSystem: "Web",
+ applicationCategory: "BusinessApplication",
+ offers: {
+ "@type": "Offer" as const,
+ price: "0",
+ priceCurrency: "EUR",
+ },
+ creator: {
+ "@id": JSON_LD_IDS.organization,
+ },
+ sameAs: [GITHUB_URL],
+ };
+}
+
export function buildSeoLandingJsonLd(
definition: SeoLandingDefinition,
baseUrl = PROD_WEBSITE_URL,
): Graph {
const pageUrl = `${baseUrl}/${definition.slug}` as const;
const faqUrl = pageFaqId(pageUrl);
+ const isOpenSourceLanding =
+ definition.slug === "open-source-invoice-generator";
const faqEntities = definition.faq.map((item) => ({
"@type": "Question" as const,
@@ -27,35 +54,46 @@ export function buildSeoLandingJsonLd(
},
}));
+ const webPage = {
+ "@type": "WebPage" as const,
+ "@id": pageWebPageId(pageUrl),
+ url: pageUrl,
+ name: definition.metadata.title,
+ description: definition.metadata.description,
+ inLanguage: "en",
+ isPartOf: {
+ "@id": JSON_LD_IDS.website,
+ },
+ breadcrumb: {
+ "@id": pageBreadcrumbId(pageUrl),
+ },
+ mainEntity: {
+ "@id": isOpenSourceLanding ? pageSoftwareAppId(pageUrl) : faqUrl,
+ },
+ };
+
+ const faqPage = {
+ "@type": "FAQPage" as const,
+ "@id": faqUrl,
+ mainEntity: faqEntities,
+ };
+
+ const breadcrumb = buildBreadcrumbList(pageUrl, [
+ { name: "Home", item: `${baseUrl}/` },
+ { name: definition.metadata.title },
+ ]);
+
+ const graph = isOpenSourceLanding
+ ? [
+ webPage,
+ buildLandingSoftwareApplication(pageUrl, definition),
+ faqPage,
+ breadcrumb,
+ ]
+ : [webPage, faqPage, breadcrumb];
+
return {
"@context": "https://schema.org",
- "@graph": [
- {
- "@type": "WebPage",
- "@id": pageWebPageId(pageUrl),
- url: pageUrl,
- name: definition.metadata.title,
- description: definition.metadata.description,
- inLanguage: "en",
- isPartOf: {
- "@id": JSON_LD_IDS.website,
- },
- breadcrumb: {
- "@id": pageBreadcrumbId(pageUrl),
- },
- mainEntity: {
- "@id": faqUrl,
- },
- },
- {
- "@type": "FAQPage",
- "@id": faqUrl,
- mainEntity: faqEntities,
- },
- buildBreadcrumbList(pageUrl, [
- { name: "Home", item: `${baseUrl}/` },
- { name: definition.metadata.title },
- ]),
- ],
+ "@graph": graph,
};
}
diff --git a/src/app/(seo-landings)/components/seo-landing-json-ld.tsx b/src/app/(seo-landings)/components/seo-landing-json-ld.tsx
index 9f32d94..48a6977 100644
--- a/src/app/(seo-landings)/components/seo-landing-json-ld.tsx
+++ b/src/app/(seo-landings)/components/seo-landing-json-ld.tsx
@@ -1,18 +1,12 @@
+import { JsonLdScript } from "@/lib/seo/render-json-ld";
+
import { buildSeoLandingJsonLd } from "../build-seo-landing-json-ld";
import type { SeoLandingDefinition } from "../seo-landing-definitions";
-import { JsonLdScript } from "@/lib/seo/render-json-ld";
interface SeoLandingJsonLdProps {
definition: SeoLandingDefinition;
}
-/**
- * Renders JSON-LD structured data for SEO landing pages.
- * Injects schema markup into the document head for better search engine understanding.
- *
- * @param {SeoLandingJsonLdProps} props - Component props
- * @param {SeoLandingDefinition} props.definition - SEO landing page definition containing schema data
- */
export function SeoLandingJsonLd({ definition }: SeoLandingJsonLdProps) {
const graph = buildSeoLandingJsonLd(definition);
diff --git a/src/app/(seo-landings)/components/seo-landing-shell.tsx b/src/app/(seo-landings)/components/seo-landing-shell.tsx
index 81e75b9..fad131f 100644
--- a/src/app/(seo-landings)/components/seo-landing-shell.tsx
+++ b/src/app/(seo-landings)/components/seo-landing-shell.tsx
@@ -3,12 +3,12 @@ import { BlackGoToAppButton } from "@/app/(components)/header/go-to-app-button-c
import { GITHUB_URL } from "@/config";
import Link from "next/link";
-import { SeoLandingJsonLd } from "./seo-landing-json-ld";
import {
type ComparisonTable,
type SeoLandingDefinition,
type SeoSection,
} from "../seo-landing-definitions";
+import { SeoLandingJsonLd } from "./seo-landing-json-ld";
import { StickySeoCta } from "@/app/(seo-landings)/components/sticky-seo-cta";
import { Button } from "@/components/ui/button";
import { FaqAccordion, FaqAccordionItem } from "@/components/ui/faq-accordion";
@@ -30,7 +30,6 @@ export function SeoLandingShell({ definition }: SeoLandingShellProps) {
<>
{/** Sticky CTA component displayed at bottom of SEO landing pages. */}
<StickySeoCta href={definition.hero.ctaHref} />
- {/** Renders JSON-LD structured data for SEO landing pages. */}
<SeoLandingJsonLd definition={definition} />
<div className="flex min-h-screen flex-col bg-slate-50">
diff --git a/src/app/(seo-landings)/seo-landing-definitions.ts b/src/app/(seo-landings)/seo-landing-definitions.ts
index 4a54c9e..c2c9f00 100644
--- a/src/app/(seo-landings)/seo-landing-definitions.ts
+++ b/src/app/(seo-landings)/seo-landing-definitions.ts
@@ -57,9 +57,9 @@ export const SEO_LANDING_DEFINITIONS = {
"invoice-generator-no-login": {
slug: "invoice-generator-no-login",
metadata: {
- title: "Create Free Invoices Online - No Login Required",
+ title: "Invoice Generator With No Login or Signup Required",
description:
- "Generate professional invoices in seconds with EasyInvoicePDF. No account, no signup, no tracking, no ads. Free, open-source, browser-based. Start creating your PDF.",
+ "Skip the account creation. Generate and download a PDF invoice in seconds - no login, no email, no credit card required.",
keywords:
"free invoice generator no login, easy invoice, create invoice PDF, generate PDF invoice, invoice PDF without account, no signup invoice maker, instant invoice PDF, browser invoice generator, no ads invoice generator, ad-free invoice PDF",
},
@@ -129,19 +129,19 @@ export const SEO_LANDING_DEFINITIONS = {
],
faq: [
{
- question: "Do I need an account to create invoices?",
+ question: "Do I need to create an account?",
answer:
- "No. Open the app and start generating invoices immediately. No email, no password required. Save invoices as PDF files or share via links when supported.",
+ "No. Open the app and start generating invoices immediately. No email, no password, and no signup required. Save invoices as PDF files or share via links when supported.",
},
{
- question: "Is my data stored?",
+ question: "Is it really free?",
answer:
- "No. Everything runs locally in your browser. Your invoice data is not uploaded to a server for normal editing and PDF generation.",
+ "Yes. EasyInvoicePDF is free to use with no paywalls, no premium tiers, and no credit card required. The project is open-source on GitHub.",
},
{
- question: "Is it really free?",
+ question: "Is my data stored?",
answer:
- "Yes. EasyInvoicePDF is free to use with no paywalls, no premium tiers, and no signup gate. The project is open-source on GitHub.",
+ "No. Everything runs locally in your browser. Your invoice data is not uploaded to a server for normal editing and PDF generation.",
},
{
question: "How do I create a free invoice?",
@@ -168,9 +168,9 @@ export const SEO_LANDING_DEFINITIONS = {
"open-source-invoice-generator": {
slug: "open-source-invoice-generator",
metadata: {
- title: "Free Open-Source Invoice Generator - Easy to Use",
+ title: "Open Source Invoice Generator (Free, No Signup) | EasyInvoicePDF",
description:
- "Generate PDF invoices instantly in your browser. Fully open-source, customizable code, self-hostable. Free forever, no vendor lock-in, no ads. Open the app and try it.",
+ "Create professional PDF invoices with a free, open-source generator. No account, no signup, no watermark. Try it instantly in your browser.",
keywords:
"open source invoice generator, self-hosted invoice PDF, easy invoice PDF, free invoice software github, customizable invoice template, AGPL invoice tool, no ads invoice, ad-free open source",
},
diff --git a/src/app/[locale]/about/__tests__/about-json-ld-graph.test.ts b/src/app/[locale]/about/__tests__/about-json-ld-graph.test.ts
index 5f63f6b..86c53f1 100644
--- a/src/app/[locale]/about/__tests__/about-json-ld-graph.test.ts
+++ b/src/app/[locale]/about/__tests__/about-json-ld-graph.test.ts
@@ -38,6 +38,19 @@ describe("buildAboutJsonLdGraph", () => {
expect(breadcrumb).toMatchObject({
"@type": "BreadcrumbList",
"@id": "https://easyinvoicepdf.com/pl/about#breadcrumb",
+ itemListElement: [
+ {
+ "@type": "ListItem",
+ position: 1,
+ name: "Home",
+ item: "https://easyinvoicepdf.com/",
+ },
+ {
+ "@type": "ListItem",
+ position: 2,
+ name: plMessages.About.buttons.home,
+ },
+ ],
});
const mainEntity = faqPage.mainEntity as { name: string }[];
diff --git a/src/app/[locale]/about/about-json-ld-graph.ts b/src/app/[locale]/about/about-json-ld-graph.ts
index 94589c4..bda3109 100644
--- a/src/app/[locale]/about/about-json-ld-graph.ts
+++ b/src/app/[locale]/about/about-json-ld-graph.ts
@@ -27,7 +27,7 @@ export function buildAboutJsonLdGraph(
const pageUrl = `${baseUrl}/${locale}/about`;
const faqUrl = pageFaqId(pageUrl);
const homeLabel = "Home";
- const aboutLabel = messages.Metadata.about.title;
+ const aboutLabel = messages.About.buttons.home;
const faqEntities = ABOUT_FAQ_ITEM_KEYS.map((key) => {
const item = messages.FAQ.items[key];
diff --git a/src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts b/src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts
index ccf10c9..3abb2c0 100644
--- a/src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts
+++ b/src/app/api/generate-invoice/__tests__/export-server-pdf.test.ts
@@ -6,6 +6,11 @@ import { describe, expect, it, vi } from "vitest";
import { SERVER_PDF_MOCK_INVOICE_DATA } from "./pdf-test-utils";
+import {
+ getPolishInvoiceRealData,
+ renderInvoicePdfBuffer,
+} from "../render-pdf-on-server";
+
vi.mock("@/env", () => ({
env: {
AUTH_TOKEN: "test-auth-token",
@@ -35,15 +40,19 @@ vi.mock("@/env", () => ({
},
}));
-import {
- getPolishInvoiceRealData,
- renderInvoicePdfBuffer,
-} from "../render-pdf-on-server";
-
const exportPath = process.env.PDF_EXPORT_PATH;
const exportLanguage = process.env.PDF_EXPORT_LANG === "pl" ? "pl" : "en";
-// we run this test only on e2e (e2e/server-render-pdf.test.ts)
+// IMPORTANT: we use this test to write out PDF buffer to disk for visual regression testing that is used in e2e/server-render-pdf.test.ts
+/**
+ * Export server PDF test needed for end-to-end visual regression.
+ *
+ * e2e/server-render-pdf.test.ts spawns this test (in a child process)
+ * to generate actual server-side PDF files, enabling snapshot comparison
+ * of rendered invoices in Playwright. Not run during normal CI test suite.
+ *
+ * **ONLY PURPOSE**: write out PDF buffer to disk as e2e artifact.
+ */
describe.skipIf(!exportPath)("export server PDF for e2e", () => {
it("writes PDF buffer to disk", async () => {
const invoiceData =
diff --git a/src/app/api/generate-invoice/__tests__/pdf-test-utils.ts b/src/app/api/generate-invoice/__tests__/pdf-test-utils.ts
index 4116612..961f6b7 100644
--- a/src/app/api/generate-invoice/__tests__/pdf-test-utils.ts
+++ b/src/app/api/generate-invoice/__tests__/pdf-test-utils.ts
@@ -17,7 +17,8 @@ export const SERVER_PDF_MOCK_INVOICE_DATA = {
...MOCK_INVOICE_DATA,
logo: "",
invoiceType: "Reverse Charge",
- notes: "Reverse Charge",
+ notes:
+ "Test PDF for server-side rendering using <InvoicePdfTemplateToRenderOnBackend/> in src/app/api/generate-invoice/render-pdf-on-server.tsx. Used to validate server PDF generation.",
items: MOCK_INVOICE_DATA.items.map((item) => ({
...item,
typeOfGTUFieldIsVisible: false,
diff --git a/src/app/changelog/build-changelog-json-ld.ts b/src/app/changelog/build-changelog-json-ld.ts
index a0f37c1..7d8cbb4 100644
--- a/src/app/changelog/build-changelog-json-ld.ts
+++ b/src/app/changelog/build-changelog-json-ld.ts
@@ -7,17 +7,17 @@ import {
pageBreadcrumbId,
pageWebPageId,
} from "@/lib/seo/json-ld-ids";
-import { OG_IMAGE_URL } from "@/lib/seo/site-entities";
+import { buildOrganization, OG_IMAGE_URL } from "@/lib/seo/site-entities";
import { formatChangelogDate, type ChangelogEntry } from "./utils";
const CHANGELOG_INDEX_URL = `${PROD_WEBSITE_URL}/changelog`;
-const CHANGELOG_INDEX_TITLE =
- "Changelog | EasyInvoicePDF - Free Invoice PDF Generator";
+export const CHANGELOG_INDEX_TITLE =
+ "EasyInvoicePDF Changelog - Latest Features & Updates";
-const CHANGELOG_INDEX_DESCRIPTION =
- "Explore the latest updates, new features, and improvements to EasyInvoicePDF.com - the free, open-source invoice generator.";
+export const CHANGELOG_INDEX_DESCRIPTION =
+ "See what's new in EasyInvoicePDF: Stripe templates, QR codes, and ongoing improvements to our free invoice generator.";
export function buildChangelogIndexJsonLdGraph(
latestDateModified: string | null,
@@ -39,7 +39,7 @@ export function buildChangelogIndexJsonLdGraph(
"@id": pageBreadcrumbId(CHANGELOG_INDEX_URL),
},
about: {
- "@id": JSON_LD_IDS.person,
+ "@id": JSON_LD_IDS.organization,
},
},
{
@@ -56,9 +56,10 @@ export function buildChangelogIndexJsonLdGraph(
inLanguage: "en",
...(latestDateModified ? { dateModified: latestDateModified } : {}),
publisher: {
- "@id": JSON_LD_IDS.person,
+ "@id": JSON_LD_IDS.organization,
},
},
+ buildOrganization(),
buildBreadcrumbList(CHANGELOG_INDEX_URL, [
{ name: "Home", item: `${PROD_WEBSITE_URL}/` },
{ name: "Changelog" },
@@ -105,16 +106,17 @@ export function buildChangelogPostJsonLdGraph(entry: ChangelogEntry): Graph {
"@id": JSON_LD_IDS.blog,
},
author: {
- "@id": JSON_LD_IDS.person,
+ "@id": JSON_LD_IDS.organization,
},
publisher: {
- "@id": JSON_LD_IDS.person,
+ "@id": JSON_LD_IDS.organization,
},
image: {
"@type": "ImageObject",
url: OG_IMAGE_URL,
},
},
+ buildOrganization(),
buildBreadcrumbList(pageUrl, [
{ name: "Home", item: `${PROD_WEBSITE_URL}/` },
{ name: "Changelog", item: CHANGELOG_INDEX_URL },
diff --git a/src/app/changelog/layout.tsx b/src/app/changelog/layout.tsx
index 1c61fd6..30add1a 100644
--- a/src/app/changelog/layout.tsx
+++ b/src/app/changelog/layout.tsx
@@ -7,14 +7,17 @@ import {
} from "@/config";
import type { Metadata } from "next";
import { ChangelogIndexJsonLd } from "./changelog-index-json-ld";
+import {
+ CHANGELOG_INDEX_DESCRIPTION,
+ CHANGELOG_INDEX_TITLE,
+} from "./build-changelog-json-ld";
// Enable static generation for changelog layout
export const dynamic = "force-static";
export const metadata: Metadata = {
- title: "Changelog | EasyInvoicePDF - Free & Open-Source Invoice Generator",
- description:
- "Explore the latest updates, new features, and improvements to EasyInvoicePDF.com - the free, open-source invoice generator. Track our development progress and upcoming features.",
+ title: CHANGELOG_INDEX_TITLE,
+ description: CHANGELOG_INDEX_DESCRIPTION,
keywords: [
"changelog",
"updates",
@@ -44,9 +47,8 @@ export const metadata: Metadata = {
},
},
openGraph: {
- title: "Changelog | EasyInvoicePDF - Free Invoice PDF Generator",
- description:
- "Stay up to date with the latest features, improvements, and bug fixes in EasyInvoicePDF.",
+ title: CHANGELOG_INDEX_TITLE,
+ description: CHANGELOG_INDEX_DESCRIPTION,
siteName: "EasyInvoicePDF.com | Free Invoice PDF Generator",
type: "website",
locale: "en_US",
@@ -62,9 +64,8 @@ export const metadata: Metadata = {
},
twitter: {
card: "summary_large_image",
- title: "Changelog | Free Invoice PDF Generator",
- description:
- "Stay up to date with the latest features, improvements, and bug fixes in EasyInvoicePDF.com",
+ title: CHANGELOG_INDEX_TITLE,
+ description: CHANGELOG_INDEX_DESCRIPTION,
creator: TWITTER_CREATOR,
images: [
{
diff --git a/src/app/founder/build-founder-json-ld.ts b/src/app/founder/build-founder-json-ld.ts
index 93958b0..6ba407f 100644
--- a/src/app/founder/build-founder-json-ld.ts
+++ b/src/app/founder/build-founder-json-ld.ts
@@ -8,6 +8,7 @@ import {
pageWebPageId,
} from "@/lib/seo/json-ld-ids";
import {
+ buildPerson,
FOUNDER_PAGE_DESCRIPTION,
FOUNDER_PAGE_TITLE,
FOUNDER_PAGE_URL,
@@ -19,6 +20,7 @@ export function buildFounderJsonLdGraph(): Graph {
return {
"@context": "https://schema.org",
"@graph": [
+ buildPerson(),
{
"@type": "ProfilePage",
"@id": pageWebPageId(pageUrl),
diff --git a/src/lib/seo/__tests__/changelog-json-ld.test.ts b/src/lib/seo/__tests__/changelog-json-ld.test.ts
index 3fa0c3d..c8bc5a5 100644
--- a/src/lib/seo/__tests__/changelog-json-ld.test.ts
+++ b/src/lib/seo/__tests__/changelog-json-ld.test.ts
@@ -7,7 +7,7 @@ import {
import { JSON_LD_IDS } from "../json-ld-ids";
describe("buildChangelogIndexJsonLdGraph", () => {
- it("includes CollectionPage, Blog, and BreadcrumbList", () => {
+ it("includes CollectionPage, Blog, Organization, and BreadcrumbList", () => {
const graph = buildChangelogIndexJsonLdGraph("2026-01-15");
const parsed = JSON.parse(JSON.stringify(graph)) as {
"@graph": Array<Record<string, unknown>>;
@@ -18,17 +18,22 @@ describe("buildChangelogIndexJsonLdGraph", () => {
"@type": "CollectionPage",
"@id": "https://easyinvoicepdf.com/changelog#webpage",
isPartOf: { "@id": JSON_LD_IDS.website },
- about: { "@id": JSON_LD_IDS.person },
+ about: { "@id": JSON_LD_IDS.organization },
});
expect(nodes[1]).toMatchObject({
"@type": "Blog",
"@id": JSON_LD_IDS.blog,
dateModified: "2026-01-15",
- publisher: { "@id": JSON_LD_IDS.person },
+ publisher: { "@id": JSON_LD_IDS.organization },
});
expect(nodes[2]).toMatchObject({
+ "@type": "Organization",
+ "@id": JSON_LD_IDS.organization,
+ });
+
+ expect(nodes[3]).toMatchObject({
"@type": "BreadcrumbList",
"@id": "https://easyinvoicepdf.com/changelog#breadcrumb",
});
@@ -50,7 +55,7 @@ describe("buildChangelogIndexJsonLdGraph", () => {
});
describe("buildChangelogPostJsonLdGraph", () => {
- it("links BlogPosting to blog and person", () => {
+ it("links BlogPosting to blog and organization", () => {
const graph = buildChangelogPostJsonLdGraph({
slug: "test-release",
metadata: {
@@ -72,8 +77,8 @@ describe("buildChangelogPostJsonLdGraph", () => {
"@id": "https://easyinvoicepdf.com/changelog/test-release#blogposting",
headline: "Test Release",
datePublished: "2026-02-01",
- author: { "@id": JSON_LD_IDS.person },
- publisher: { "@id": JSON_LD_IDS.person },
+ author: { "@id": JSON_LD_IDS.organization },
+ publisher: { "@id": JSON_LD_IDS.organization },
isPartOf: { "@id": JSON_LD_IDS.blog },
});
@@ -97,7 +102,7 @@ describe("buildChangelogPostJsonLdGraph", () => {
};
const webPage = parsed["@graph"][0];
const blogPosting = parsed["@graph"][1];
- const breadcrumb = parsed["@graph"][2] as {
+ const breadcrumb = parsed["@graph"][3] as {
itemListElement: Array<{ name: string }>;
};
diff --git a/src/lib/seo/__tests__/founder-json-ld.test.ts b/src/lib/seo/__tests__/founder-json-ld.test.ts
index a358f50..1f3d4b3 100644
--- a/src/lib/seo/__tests__/founder-json-ld.test.ts
+++ b/src/lib/seo/__tests__/founder-json-ld.test.ts
@@ -4,13 +4,19 @@ import { buildFounderJsonLdGraph } from "../../../app/founder/build-founder-json
import { JSON_LD_IDS } from "../json-ld-ids";
describe("buildFounderJsonLdGraph", () => {
- it("uses ProfilePage with mainEntity pointing to person", () => {
+ it("includes Person entity and ProfilePage with mainEntity pointing to person", () => {
const graph = buildFounderJsonLdGraph();
const parsed = JSON.parse(JSON.stringify(graph)) as {
"@graph": Array<Record<string, unknown>>;
};
expect(parsed["@graph"][0]).toMatchObject({
+ "@type": "Person",
+ "@id": JSON_LD_IDS.person,
+ name: "Vlad Sazonau",
+ });
+
+ expect(parsed["@graph"][1]).toMatchObject({
"@type": "ProfilePage",
"@id": "https://easyinvoicepdf.com/founder#webpage",
isPartOf: { "@id": JSON_LD_IDS.website },
diff --git a/src/lib/seo/__tests__/home-json-ld.test.ts b/src/lib/seo/__tests__/home-json-ld.test.ts
index 3c30607..50015d0 100644
--- a/src/lib/seo/__tests__/home-json-ld.test.ts
+++ b/src/lib/seo/__tests__/home-json-ld.test.ts
@@ -4,28 +4,73 @@ import { buildHomeJsonLdGraph } from "../../../app/(app)/home-json-ld";
import { JSON_LD_IDS } from "../json-ld-ids";
describe("buildHomeJsonLdGraph", () => {
- it("includes full WebSite, WebApplication, and WebPage linked by @id", () => {
+ it("includes full WebSite, Organization, WebApplication, site nav, and WebPage linked by @id", () => {
const graph = buildHomeJsonLdGraph();
const parsed = JSON.parse(JSON.stringify(graph)) as {
"@graph": Array<Record<string, unknown>>;
};
- expect(parsed["@graph"]).toHaveLength(3);
- expect(parsed["@graph"][0]).toMatchObject({
- "@type": "WebSite",
+ expect(parsed["@graph"]).toHaveLength(5);
+
+ const webSite = parsed["@graph"].find(
+ (node) => node["@type"] === "WebSite",
+ );
+ const organization = parsed["@graph"].find(
+ (node) => node["@type"] === "Organization",
+ );
+ const webApplication = parsed["@graph"].find(
+ (node) => node["@type"] === "WebApplication",
+ );
+ const siteNavigation = parsed["@graph"].find(
+ (node) => node["@type"] === "ItemList",
+ );
+ const webPage = parsed["@graph"].find(
+ (node) => node["@type"] === "WebPage",
+ );
+
+ expect(webSite).toMatchObject({
"@id": JSON_LD_IDS.website,
- publisher: { "@id": JSON_LD_IDS.person },
+ publisher: { "@id": JSON_LD_IDS.organization },
});
- expect(parsed["@graph"][1]).toMatchObject({
- "@type": "WebApplication",
+
+ expect(organization).toMatchObject({
+ "@id": JSON_LD_IDS.organization,
+ name: "EasyInvoicePDF",
+ });
+
+ expect(webApplication).toMatchObject({
"@id": JSON_LD_IDS.app,
offers: { price: "0", priceCurrency: "EUR" },
+ creator: { "@id": JSON_LD_IDS.organization },
+ potentialAction: {
+ "@type": "UseAction",
+ name: "Start Invoicing",
+ target: "https://easyinvoicepdf.com/?template=default",
+ },
});
- expect(parsed["@graph"][2]).toMatchObject({
- "@type": "WebPage",
+
+ expect(siteNavigation).toMatchObject({
+ "@id": JSON_LD_IDS.siteNavigation,
+ });
+
+ expect(siteNavigation?.itemListElement).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ name: "Start Invoicing",
+ item: "https://easyinvoicepdf.com/?template=default",
+ }),
+ expect.objectContaining({
+ name: "About",
+ item: "https://easyinvoicepdf.com/en/about",
+ }),
+ ]),
+ );
+
+ expect(webPage).toMatchObject({
"@id": "https://easyinvoicepdf.com/#webpage",
isPartOf: { "@id": JSON_LD_IDS.website },
mainEntity: { "@id": JSON_LD_IDS.app },
+ hasPart: { "@id": JSON_LD_IDS.siteNavigation },
});
});
});
diff --git a/src/lib/seo/__tests__/site-entities.test.ts b/src/lib/seo/__tests__/site-entities.test.ts
index d29ec2c..c9e07e7 100644
--- a/src/lib/seo/__tests__/site-entities.test.ts
+++ b/src/lib/seo/__tests__/site-entities.test.ts
@@ -4,7 +4,10 @@ import { buildBreadcrumbList } from "../breadcrumb";
import { JSON_LD_IDS } from "../json-ld-ids";
import {
buildFullWebSite,
+ buildOrganization,
buildPerson,
+ buildSiteNavigationList,
+ buildSiteWideJsonLdGraph,
buildSlimWebSite,
buildWebApplication,
} from "../site-entities";
@@ -18,10 +21,18 @@ describe("site-entities", () => {
});
});
- it("should link publisher to person in buildFullWebSite", () => {
+ it("should link publisher to organization in buildFullWebSite", () => {
expect(buildFullWebSite()).toMatchObject({
"@id": JSON_LD_IDS.website,
- publisher: { "@id": JSON_LD_IDS.person },
+ publisher: { "@id": JSON_LD_IDS.organization },
+ });
+ });
+
+ it("should build organization with stable @id", () => {
+ expect(buildOrganization()).toMatchObject({
+ "@type": "Organization",
+ "@id": JSON_LD_IDS.organization,
+ name: "EasyInvoicePDF",
});
});
@@ -32,14 +43,43 @@ describe("site-entities", () => {
expect(person.sameAs).toHaveLength(4);
});
- it("should include offers.price 0 and no aggregateRating in buildWebApplication", () => {
+ it("should include offers.price 0 and Start Invoicing action in buildWebApplication", () => {
const app = buildWebApplication();
expect(app.offers).toMatchObject({
price: "0",
priceCurrency: "EUR",
});
expect(app).not.toHaveProperty("aggregateRating");
- expect(app.creator).toMatchObject({ "@id": JSON_LD_IDS.person });
+ expect(app.creator).toMatchObject({ "@id": JSON_LD_IDS.organization });
+ expect(app.potentialAction).toMatchObject({
+ name: "Start Invoicing",
+ target: "https://easyinvoicepdf.com/?template=default",
+ });
+ });
+
+ it("should expose primary site navigation links", () => {
+ const navigation = buildSiteNavigationList();
+ expect(navigation.itemListElement).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ name: "Start Invoicing",
+ item: "https://easyinvoicepdf.com/?template=default",
+ }),
+ expect.objectContaining({
+ name: "About",
+ item: "https://easyinvoicepdf.com/en/about",
+ }),
+ ]),
+ );
+ });
+
+ it("should emit only slim WebSite in site-wide graph", () => {
+ const graph = buildSiteWideJsonLdGraph();
+ expect(graph["@graph"]).toHaveLength(1);
+ expect(graph["@graph"][0]).toMatchObject({
+ "@type": "WebSite",
+ "@id": JSON_LD_IDS.website,
+ });
});
});
diff --git a/src/lib/seo/json-ld-ids.ts b/src/lib/seo/json-ld-ids.ts
index 4f555cd..2cb789a 100644
--- a/src/lib/seo/json-ld-ids.ts
+++ b/src/lib/seo/json-ld-ids.ts
@@ -10,27 +10,32 @@ import { PROD_WEBSITE_URL } from "@/config";
* - https://easyinvoicepdf.com/changelog
* - https://easyinvoicepdf.com/changelog/{latest-slug}
* - https://easyinvoicepdf.com/founder
- * - https://easyinvoicepdf.com/{seo-landing-slug}
*/
export const JSON_LD_BASE = PROD_WEBSITE_URL;
export const JSON_LD_IDS = {
website: `${JSON_LD_BASE}/#website`,
+ organization: `${JSON_LD_BASE}/#organization`,
person: `${JSON_LD_BASE}/#person`,
personImage: `${JSON_LD_BASE}/#person-image`,
websiteImage: `${JSON_LD_BASE}/#website-image`,
app: `${JSON_LD_BASE}/#app`,
+ siteNavigation: `${JSON_LD_BASE}/#site-navigation`,
blog: `${JSON_LD_BASE}/changelog/#blog`,
} as const;
export function pageWebPageId(url: string) {
- return `${url}#webpage`;
+ return `${url}#webpage` as const;
}
export function pageBreadcrumbId(url: string) {
- return `${url}#breadcrumb`;
+ return `${url}#breadcrumb` as const;
}
export function pageFaqId(url: string) {
- return `${url}#faq`;
+ return `${url}#faq` as const;
+}
+
+export function pageSoftwareAppId(url: string) {
+ return `${url}#software` as const;
}
diff --git a/src/lib/seo/site-entities.ts b/src/lib/seo/site-entities.ts
index 406d69b..63a58b6 100644
--- a/src/lib/seo/site-entities.ts
+++ b/src/lib/seo/site-entities.ts
@@ -1,5 +1,5 @@
/**
- * Site-wide JSON-LD entities (WebSite, Person, WebApplication).
+ * Site-wide JSON-LD entities (WebSite, Organization, Person, WebApplication).
*
* Content-accuracy rules:
* - Never add JSON-LD for content not rendered on the page.
@@ -37,6 +37,8 @@ export const FOUNDER_PAGE_DESCRIPTION =
export const OG_IMAGE_URL = `${STATIC_ASSETS_URL}/easy-invoice-opengraph-image.png?v=1755773879597`;
+const START_INVOICING_URL = `${JSON_LD_BASE}/?template=default`;
+
const WEB_APPLICATION_FEATURES = [
"Live preview as you type",
"No sign-up needed",
@@ -70,7 +72,7 @@ export function buildFullWebSite() {
description: SITE_DESCRIPTION,
inLanguage: "en",
publisher: {
- "@id": JSON_LD_IDS.person,
+ "@id": JSON_LD_IDS.organization,
},
image: {
"@type": "ImageObject" as const,
@@ -81,6 +83,16 @@ export function buildFullWebSite() {
};
}
+export function buildOrganization() {
+ return {
+ "@type": "Organization" as const,
+ "@id": JSON_LD_IDS.organization,
+ name: "EasyInvoicePDF",
+ url: `${JSON_LD_BASE}/`,
+ sameAs: [GITHUB_URL],
+ };
+}
+
export function buildPerson() {
return {
"@type": "Person" as const,
@@ -112,7 +124,7 @@ export function buildWebApplication() {
applicationCategory: "BusinessApplication",
featureList: [...WEB_APPLICATION_FEATURES],
creator: {
- "@id": JSON_LD_IDS.person,
+ "@id": JSON_LD_IDS.organization,
},
sameAs: [GITHUB_URL],
offers: {
@@ -120,12 +132,51 @@ export function buildWebApplication() {
price: "0",
priceCurrency: "EUR",
},
+ potentialAction: {
+ "@type": "UseAction" as const,
+ name: "Start Invoicing",
+ target: START_INVOICING_URL,
+ },
+ };
+}
+
+export function buildSiteNavigationList() {
+ return {
+ "@type": "ItemList" as const,
+ "@id": JSON_LD_IDS.siteNavigation,
+ name: "Site navigation",
+ itemListElement: [
+ {
+ "@type": "ListItem" as const,
+ position: 1,
+ name: "Start Invoicing",
+ item: START_INVOICING_URL,
+ },
+ {
+ "@type": "ListItem" as const,
+ position: 2,
+ name: "About",
+ item: `${JSON_LD_BASE}/en/about`,
+ },
+ {
+ "@type": "ListItem" as const,
+ position: 3,
+ name: "Changelog",
+ item: `${JSON_LD_BASE}/changelog`,
+ },
+ {
+ "@type": "ListItem" as const,
+ position: 4,
+ name: "Terms of Service",
+ item: `${JSON_LD_BASE}/tos`,
+ },
+ ],
};
}
export function buildSiteWideJsonLdGraph() {
return {
"@context": "https://schema.org" as const,
- "@graph": [buildSlimWebSite(), buildPerson()],
+ "@graph": [buildSlimWebSite()],
};
}