|
| 1 | +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). |
| 2 | + |
| 3 | +## Getting Started |
| 4 | + |
| 5 | +Run `npm install` |
| 6 | + |
| 7 | +Set the environment variables in your .env.local file like defined in .env.example. |
| 8 | + |
| 9 | +First, run the development server: |
| 10 | + |
| 11 | +```bash |
| 12 | +npm run dev |
| 13 | +``` |
| 14 | + |
| 15 | +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 16 | + |
| 17 | +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. |
| 18 | + |
| 19 | +## Learn More |
| 20 | + |
| 21 | +To learn more about Next.js, take a look at the following resources: |
| 22 | + |
| 23 | +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. |
| 24 | +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
| 25 | + |
| 26 | +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! |
| 27 | + |
| 28 | +## Components and UI libraries |
| 29 | + |
| 30 | +We use [Shadcn](https://ui.shadcn.com/) for components, in combination with [TailwindCSS](https://tailwindcss.com/) to style a component inline. |
| 31 | +To add a shadcn component: |
| 32 | +```bash |
| 33 | +npx shadcn@latest add navigation-menu |
| 34 | +``` |
| 35 | +For icons, we use the default library in Shadcn, [Lucide](https://www.shadcn.io/icons/lucide). |
| 36 | + |
| 37 | +## Internationalisation i18n |
| 38 | + |
| 39 | +For the internationalisation of the app we are using [next-i18next](https://github.com/i18next/next-i18next). Our setup is based on this article from [Locize](https://www.locize.com/blog/i18n-next-app-router/). |
| 40 | + |
| 41 | +## BlogPosts / news markdown |
| 42 | + |
| 43 | +We use the library [react-markdown](https://remarkjs.github.io/react-markdown/) to display blog posts / news. Visit [CommonMark](https://commonmark.org) for Markdown guidelines and tutorial. You can style the components by passing the components props to ReactMarkdown. |
| 44 | + |
| 45 | +```bash |
| 46 | +<ReactMarkdown components={components}>{Content}</ReactMarkdown> |
| 47 | +``` |
| 48 | + |
| 49 | +## Linting and Code Formatting |
| 50 | + |
| 51 | +This repo uses `ESLint` [according to the official next documentation](https://nextjs.org/docs/app/api-reference/config/eslint) and prettier for linting and code formatting. The configuration for `ESLint` is located in the `.eslint.config.mjs` file, and the configuration for `prettier` is in the `.prettierrc.json` file. |
| 52 | + |
| 53 | +With the [ESLint Prettier plugin](https://www.npmjs.com/package/eslint-plugin-prettier/v/4.0.0) Prettier runs within ESLint and doesn't need a separate command. In order to apply `ESLint` to all existing files, run: |
| 54 | + |
| 55 | +``` |
| 56 | +npx eslint . |
| 57 | +``` |
| 58 | + |
| 59 | +and to fix fixable errors: |
| 60 | +``` |
| 61 | +npx eslint . --fix |
| 62 | +``` |
| 63 | + |
| 64 | +Before each commit, our `husky🐶` uses the `lint-staged` package to automatically lint and format the staged files according to the rules specified in the `.lintstagedrc` file: |
| 65 | + |
| 66 | +You can do this manually by running: |
| 67 | + |
| 68 | +``` |
| 69 | +npx lint-staged |
| 70 | +``` |
| 71 | + |
| 72 | +This ensures code quality and consistency across our codebase. |
0 commit comments