This project is an informational web application serving as the hub for information about Carbophile Group, the Croatian cybersecurity nonprofit.
It has a static site generation (SSG) architecture with built-in support for internationalization (i18n) and an MDX-based content management system to allow easy writing of blogs and projects.
The project codename comes from Hermes, the messenger of the Greek gods.
- Framework: Next.js (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Deployment: Cloudflare Workers
- Content: MDX (Markdown + JSX)
-
Clone the repository:
git clone https://github.com/Carbophile/cg-hermes.git cd cg-hermes -
Install the dependencies:
pnpm install
To start the development server with hot-reloading and dynamic compilation:
pnpm run devTo emulate a production environment for testing:
pnpm run previewThe HEAD of the main branch is automatically deployed.
app/[lang]/: Contains the application routes. The[lang]dynamic segment handles localization (e.g.,/en//hr/)l10n/: Handles localization logic and houses the dictionariesblog/&projects/: Contain the data access layers and MDX content for blog posts and project showcasesassets/: Source for static assets such as images and videos (fingerprinted at build time)
The application supports multiple languages (currently English and Croatian). Content is localized using typed JSON dictionaries. Everything must be fully localized.
- Add the new key, along with a description, to
l10n/dict.schema.json - Regenerate types:
pnpm run types
- Navigate to
l10n/dicts/. - Add the corresponding key translations to each of the dictionaries.
Client components should get a reduced dictionary with only the keys they need to reduce the bundle size.
Blog posts and project entries are stored as MDX files. File names should be in English regardless of language.
- Navigate to
blog/content/[language]/. - Create a new
.mdxfile. - Populate the file with the frontmatter and the blog content itself.
- If needed, add the author's headshot to
assets/headshots/ - Create variations for all other languages with the same file name.
- Navigate to
projects/content/[language]/. - Create a new
.mdxfile. - Populate the file with the frontmatter and the project write-up itself.
- Create variations for all other languages with the same file name.
This project uses Biome for fast linting and formatting. It replaces ESLint and Prettier.
To automatically fix issues in the code:
pnpm run checkTo apply unsafe fixes (they are fine most of the time, just verify they didn't mess anything up):
pnpm run check:unsafeYou will not be able to merge into main if there are formatting issues.