feat: i18n, migrate to pnpm, tmuxinator config file

This commit is contained in:
nxtkofi 2026-03-27 23:43:18 +01:00
parent 62f258ad97
commit a3490d6cca
14 changed files with 4925 additions and 7128 deletions

View file

@ -12,6 +12,7 @@ This is production ready setup for Convex and Next SaaS.
- next intl
- next themes
- Backend/Frontend Tests
- Tmuxinator
- CICD
- accurate instructions
@ -27,13 +28,7 @@ This is production ready setup for Convex and Next SaaS.
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
### Convex

5
messages/en.json Normal file
View file

@ -0,0 +1,5 @@
{
"HomePage": {
"title": "Hello world!"
}
}

5
messages/pl.json Normal file
View file

@ -0,0 +1,5 @@
{
"HomePage": {
"title": "Witaj świecie!"
}
}

View file

@ -1,7 +1,9 @@
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
const nextConfig: NextConfig = {
/* config options here */
};
const withNextIntl = createNextIntlPlugin();
export default nextConfig;
export default withNextIntl(nextConfig);

7121
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -11,6 +11,7 @@
"dependencies": {
"convex": "^1.34.0",
"next": "16.2.1",
"next-intl": "^4.8.3",
"react": "19.2.4",
"react-dom": "19.2.4"
},

4820
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff

BIN
src/app/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

26
src/app/globals.css Normal file
View file

@ -0,0 +1,26 @@
@import "tailwindcss";
:root {
--background: #ffffff;
--foreground: #171717;
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
}
@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}
body {
background: var(--background);
color: var(--foreground);
font-family: Arial, Helvetica, sans-serif;
}

22
src/app/layout.tsx Normal file
View file

@ -0,0 +1,22 @@
import type { Metadata } from "next";
import "./globals.css";
import { NextIntlClientProvider } from "next-intl";
export const metadata: Metadata = {
title: "SaaS Template",
description: "Create SaaS in 1 day!",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" className="h-full antialiased">
<body className="min-h-full flex flex-col">
<NextIntlClientProvider>{children}</NextIntlClientProvider>
</body>
</html>
);
}

6
src/app/page.tsx Normal file
View file

@ -0,0 +1,6 @@
import { useTranslations } from "next-intl";
export default function Home() {
const t = useTranslations("HomePage");
return <h1>{t("title")}</h1>;
}

1
src/constants.ts Normal file
View file

@ -0,0 +1 @@
export const supportedLocales = ["en", "pl"];

20
src/i18n/request.ts Normal file
View file

@ -0,0 +1,20 @@
import { getRequestConfig } from "next-intl/server";
import { headers } from "next/headers";
export default getRequestConfig(async () => {
const headersList = await headers();
const acceptLanguage = headersList.get("accept-language");
const browserLocale = acceptLanguage?.split(",")[0]?.split("-")[0];
const supportedLocales = ["en", "pl"];
const locale =
browserLocale && supportedLocales.includes(browserLocale)
? browserLocale
: "en";
return {
locale,
messages: (await import(`../../messages/${locale}.json`)).default,
};
});

15
tmuxi.template.yml Normal file
View file

@ -0,0 +1,15 @@
#move to /home/nxtkofi/.config/tmuxinator/<project-name>.yml
name: <project-name>
root: ~/
windows:
- editor:
panes:
- nvim
- wiki:
panes:
- nvim ~/vaults/mentat/<project-name>
- frontend:
panes:
- pnpm dev