Skip to content

Commit dbf0419

Browse files
authored
Feat add Translation (#9)
* feat: adding src folder * feat: configure next-intl * style: cleaning code * style: cleaning files * feat: merge with master * fix: trying to fix api endpoint not found error * feat: update image llm to stable diffusion xl * fix: making api call works * fix: linking from site to dashboard * fix: fixing small bugs & design * fix: fixing hydration errors * fix: fixing front end minor errors and improving hero section text * feat: general usage of t3-cross-env * feat: updating README * feat: updating path management for sign in & sign up url * style: cleaning middleware * fix: adding mention on why we do not use default CLERK env variables * fix: rollback nvm to match vercel env * fix: fixing routing path for default locale * fix: rollback constant for production * fix: adding back dev environment (in comments) * fix: update some text * feat: removing clerk default variable for more understandability * fix: fixing css layout for cards * fix: cleaning front end minor issues --------- Co-authored-by: Guillaume Dieudonné <8122069+GuiDieudo@users.noreply.github.com>
1 parent fa2526f commit dbf0419

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+760
-206
lines changed

.env.example

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
22
CLERK_SECRET_KEY=
33

4-
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
5-
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
6-
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
7-
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
8-
94
OPENAI_API_KEY=
105
REPLICATE_API_TOKEN=
6+
GENERATED_BY_API_KEY=
117

128
DATABASE_URL=
139

@@ -17,5 +13,3 @@ STRIPE_WEBHOOK_SECRET=
1713
NEXT_PUBLIC_APP_URL="http://localhost:3000"
1814

1915
NEXT_PUBLIC_CRISP_WEBSITE_ID=
20-
21-
GENERATED_BY_API_KEY=

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.17.1

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Features:
1010

1111
- AI prompts folders to generate main project pages (Terms, FAQ, Privacy Policy, About, Documentation, etc.)
1212
- Folder structure in [Next 13 App Router](https://nextjs.org/docs/app)
13+
- [Next Intl](https://next-intl-docs.vercel.app/) for Internationalization (compatible with App Router Server 1 Client components)
1314
- [Shadcn](https://ui.shadcn.com/) UI on top of Radix UI
1415
- [Tailwind](https://tailwindcss.com/docs/installation) & [Framer Motion](https://www.framer.com/motion/) animations and effects
1516
- [Clerk Authentication](https://clerk.com/docs) (Email, Google, 9+ Social Logins)
@@ -45,7 +46,7 @@ These prompts are designed to help individuals and teams quickly start a SaaS bu
4546

4647
### Prerequisites
4748

48-
**Node version 18.x.x**
49+
**Node version 20.x.x**
4950

5051
### Cloning the repository
5152

@@ -91,3 +92,11 @@ Running commands with npm `npm run [command]`
9192
| `start` | Starts the production application |
9293
| `lint` | Lints the application code |
9394
| `postinstall` | Generates Prisma client after install |
95+
96+
## Internationalization
97+
98+
This project has been fully set up for internationalization, using [Next Intl](https://next-intl-docs.vercel.app/). However, the pages and components have not been translated yet. This means that while the infrastructure for supporting multiple languages is in place, the actual content in different languages is not available.
99+
100+
If you would like to contribute to this project, we have created an issue for translating the pages and components. Any help in this regard would be greatly appreciated. You can find the issue on our GitHub repository and contribute by providing translations for the various strings used throughout the application.
101+
102+
Please note that while contributing, you should follow the guidelines provided in the issue to ensure consistency and quality in translations. Thank you in advance for your contributions!

env.mjs

+35-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { createEnv } from "@t3-oss/env-nextjs"
22
import { z } from "zod"
33

44
export const env = createEnv({
5+
/*
6+
* Serverside Environment variables, not available on the client.
7+
* Will throw if you access these variables on the client.
8+
*/
59
server: {
610
DATABASE_URL: z.string().url().min(1),
711

@@ -14,16 +18,39 @@ export const env = createEnv({
1418
STRIPE_API_KEY: z.string().optional(),
1519
STRIPE_WEBHOOK_SECRET: z.string().optional(),
1620
},
21+
/*
22+
* Environment variables available on the client (and server).
23+
*
24+
* 💡 You'll get type errors if these are not prefixed with NEXT_PUBLIC_.
25+
*/
1726
client: {
18-
NEXT_PUBLIC_APP_URL: z.string().url().optional(),
19-
20-
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().min(1),
21-
NEXT_PUBLIC_CLERK_SIGN_IN_URL: z.string().min(1),
22-
NEXT_PUBLIC_CLERK_SIGN_UP_URL: z.string().min(1),
23-
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL: z.string().min(1),
24-
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL: z.string().min(1),
27+
NEXT_PUBLIC_APP_URL: z.string().url().min(1),
2528

2629
NEXT_PUBLIC_CRISP_WEBSITE_ID: z.string().optional(),
2730
},
28-
experimental__runtimeEnv: {},
31+
/*
32+
* Due to how Next.js bundles environment variables on Edge and Client,
33+
* we need to manually destructure them to make sure all are included in bundle.
34+
*
35+
* 💡 You'll get type errors if not all variables from `server` & `client` are included here.
36+
*/
37+
runtimeEnv: {
38+
DATABASE_URL: process.env.DATABASE_URL,
39+
40+
CLERK_SECRET_KEY: process.env.CLERK_SECRET_KEY,
41+
42+
GENERATED_BY_API_KEY: process.env.GENERATED_BY_API_KEY,
43+
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
44+
REPLICATE_API_TOKEN: process.env.REPLICATE_API_TOKEN,
45+
46+
STRIPE_API_KEY: process.env.STRIPE_API_KEY,
47+
STRIPE_WEBHOOK_SECRET: process.env.STRIPE_WEBHOOK_SECRET,
48+
49+
NEXT_PUBLIC_APP_URL: process.env.NEXT_PUBLIC_APP_URL,
50+
51+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:
52+
process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
53+
54+
NEXT_PUBLIC_CRISP_WEBSITE_ID: process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID,
55+
},
2956
})

next.config.mjs

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import million from "million/compiler"
44
import "./env.mjs"
5+
import withNextIntl from "next-intl/plugin"
6+
7+
const i18nConfig = "./src/i18n/i18n.ts"
58

69
const millionConfig = {
710
auto: { rsc: true },
@@ -19,12 +22,19 @@ const nextConfig = {
1922
}),
2023
images: {
2124
domains: [
25+
"images.clerk.com",
26+
"www.gravatar.com",
2227
"googleusercontent.com",
28+
"pbxt.replicate.delivery",
2329
"oaidalleapiprodscus.blob.core.windows.net",
2430
"cdn.openai.com",
2531
],
2632
},
2733
transpilePackages: ["react-tweet"],
2834
}
2935

30-
export default million.next(nextConfig, millionConfig)
36+
const combinedMillionConfig = million.next(nextConfig, millionConfig)
37+
38+
const combinedIntlConfig = withNextIntl(i18nConfig)(combinedMillionConfig)
39+
40+
export default combinedIntlConfig

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@atlaskit/code": "^14.6.7",
14-
"@clerk/nextjs": "^4.25.3",
14+
"@clerk/nextjs": "^4.25.6",
1515
"@hookform/resolvers": "^3.3.1",
1616
"@prisma/client": "^5.4.2",
1717
"@radix-ui/react-accordion": "^1.1.2",
@@ -43,7 +43,7 @@
4343
"@radix-ui/react-tooltip": "^1.0.6",
4444
"@react-three/drei": "^9.83.9",
4545
"@react-three/fiber": "^8.14.2",
46-
"@t3-oss/env-nextjs": "^0.7.0",
46+
"@t3-oss/env-nextjs": "^0.7.1",
4747
"@tanstack/react-table": "^8.10.0",
4848
"@types/node": "20.4.1",
4949
"@types/react": "18.2.14",
@@ -54,6 +54,7 @@
5454
"clsx": "^1.2.1",
5555
"cmdk": "^0.2.0",
5656
"cobe": "^0.6.3",
57+
"country-flag-icons": "^1.5.7",
5758
"crisp-sdk-web": "^1.0.19",
5859
"date-fns": "^2.30.0",
5960
"eslint": "8.44.0",
@@ -63,6 +64,7 @@
6364
"maath": "^0.9.0",
6465
"million": "2.6.4",
6566
"next": "13.5.6",
67+
"next-intl": "3.0.0-beta.19",
6668
"next-themes": "^0.2.1",
6769
"openai": "^3.3.0",
6870
"postcss": "8.4.25",

0 commit comments

Comments
 (0)