|
1 | 1 | # Open Elements Website |
2 | 2 |
|
3 | | -This repo contains the website of Open Elements. |
4 | | -The website is still work in progress. |
5 | | -In future the website will be available at https://www.open-elements.de and https://www.open-elements.com. |
| 3 | +This repository contains the Open Elements website. |
6 | 4 |
|
7 | | -Netlify status of English page: |
| 5 | +## Architecture (2026) |
8 | 6 |
|
9 | | -[](https://app.netlify.com/sites/open-elements-en/deploys) |
| 7 | +The project is now a Next.js application with App Router, Tailwind CSS, and `next-intl` for i18n. Legacy Hugo content and templates are still kept in the repo for migration and historical content. |
10 | 8 |
|
11 | | -Netlify status of German page: |
| 9 | +### Runtime layers |
12 | 10 |
|
13 | | -[](https://app.netlify.com/sites/open-elements-de/deploys) |
| 11 | +- **Next.js App (primary)** |
| 12 | + - App Router pages and layouts in `src/app`. |
| 13 | + - UI components in `src/components`. |
| 14 | + - Shared utilities in `src/lib`, data in `src/data`, types in `src/types`. |
| 15 | + - Styling via Tailwind CSS and `src/app/globals.css`. |
14 | 16 |
|
| 17 | +- **Internationalization** |
| 18 | + - `next-intl` routing and helpers in `src/i18n`. |
| 19 | + - Translation messages in `locales`. |
15 | 20 |
|
16 | | -## Building the website |
| 21 | +- **Legacy Hugo content (migrating)** |
| 22 | + - Markdown content in `content`. |
| 23 | + - Hugo templates in `src/layouts`. |
| 24 | + - Hugo configuration in `config.toml`. |
| 25 | + - Built static artifacts live in `public` (do not edit manually). |
17 | 26 |
|
18 | | -Since the page is based on Hugo and React we use `npm-run-all` to execute several dev executions in parallel. |
19 | | -Therefore you need to install `npm-run-all` as a dev dependency: |
| 27 | +- **Web components** |
| 28 | + - Custom elements live in `react-src` and are bundled via `react-src/build.mjs` into `public/js`. |
20 | 29 |
|
21 | | -``` |
22 | | -npm install --save-dev npm-run-all |
23 | | -``` |
24 | | - |
25 | | - |
26 | | -The project is based on [Hugo](https://gohugo.io/) and you need to [install Hugo](https://gohugo.io/installation/) to build the website. |
27 | | -Once Hugo is installed you can host the website on localhost by executing to following command from the root folder of the repository: |
28 | | - |
29 | | -``` |
30 | | -hugo serve |
31 | | -``` |
| 30 | +- **E2E tests** |
| 31 | + - Playwright specs in `tests/e2e`. |
32 | 32 |
|
33 | | -While the process is running the English (default) version of the website can be reached at http://localhost:1313/ and the German can be reached at http://localhost:1314/. |
| 33 | +## Development |
34 | 34 |
|
35 | | -## Adding Tailwind CSS |
| 35 | +### Requirements |
36 | 36 |
|
37 | | -### 1-Install Tailwind CSS |
| 37 | +- Node.js 22 |
| 38 | +- pnpm 10 |
38 | 39 |
|
39 | | -Install tailwindcss via npm, and create your tailwind.config.js file in the root folder. |
| 40 | +### Install dependencies |
40 | 41 |
|
41 | 42 | ``` |
42 | | -npm install -D tailwindcss |
43 | | -npx tailwindcss init |
| 43 | +pnpm install |
44 | 44 | ``` |
45 | 45 |
|
46 | | -### 2-Configure your template paths |
47 | | - |
48 | | -Add the paths to all of your template files in your tailwind.config.js file. |
| 46 | +### Run locally |
49 | 47 |
|
50 | 48 | ``` |
51 | | -content: [ |
52 | | - "content/**/*.md", "layouts/**/*.html" |
53 | | -], |
| 49 | +pnpm run dev |
54 | 50 | ``` |
55 | 51 |
|
56 | | -### 3-Add the Tailwind directives to your CSS |
57 | | -Create 'input.css' file in the root folder and add the @tailwind directives for each of Tailwind’s layers to your input CSS file. |
58 | | - |
59 | | -``` |
60 | | -@tailwind base; |
61 | | -@tailwind components; |
62 | | -@tailwind utilities; |
63 | | -``` |
| 52 | +The app is available at http://localhost:3000. |
64 | 53 |
|
65 | | -### 4-Code snippet for Package.json |
66 | | - |
67 | | -Add the following code in 'Package.json' |
| 54 | +### Build & start |
68 | 55 |
|
69 | 56 | ``` |
70 | | - "scripts": { |
71 | | - "dev:css": "npx tailwindcss -i input.css -o assets/css/style.css -w", |
72 | | - "dev:hugo": "hugo server", |
73 | | - "dev": "run-p dev:*", |
74 | | - "build:css": "NODE_ENV=production npx tailwindcss -i input.css -o assets/css/style.css -m", |
75 | | - "build:hugo": "hugo", |
76 | | - "build": "run-s build:*" |
77 | | - }, |
| 57 | +pnpm run build |
| 58 | +pnpm run start |
78 | 59 | ``` |
79 | 60 |
|
80 | | -### 5-Dev environment |
81 | | -For development run the following command in terminal. |
82 | | -``` |
83 | | -npm run dev |
84 | | -``` |
| 61 | +### E2E tests |
85 | 62 |
|
86 | | -### 6-Production |
87 | | -For production ready css, run the following command in terminal. |
88 | 63 | ``` |
89 | | -npm run build |
| 64 | +pnpm run test:e2e |
90 | 65 | ``` |
0 commit comments