How electrium-mobility/electrium-w24website works
Main Components
• Static Site Generator: Docusaurus is at the heart of the project, responsible for converting content (Markdown/MDX) into a static site.
• Content Sections:
• Documentation: The “docs” directory holds various guide files, project pages, and tutorials.
• Blog: The “blog” folder contains Markdown/MDX files that power blog posts.
• Source Code & Components:
• “src” hosts React components (UI parts, teams, sponsors, etc.), pages, common components (form fields, validations), and CSS styling.
• Static Assets:
• “static” directory for assets such as fonts and images.
• Configuration & Build Tools:
• Docusaurus configuration (docusaurus.config.ts), Tailwind configuration (tailwind.config.js and plugins/tailwind-config.cjs), Babel config, package.json for dependencies and build scripts, and GitHub Actions workflows (in .github/workflows) for deployment and testing.
Relationships and Interactions
• The Docusaurus framework pulls content from the “docs” and “blog” directories and uses configurations (docusaurus.config.ts and sidebars.ts) to organize navigation and structure.
• The “src” directory presents a component-based architecture where:
• React components in “src/components” build the UI, particularly for pages like About, Contact, Team, and Sponsors.
• These components are imported by page files in “src/pages” to structure different routes of the site.
• CSS and Tailwind configurations control the visual styling across components.
• Static assets (images, fonts) from the “static” directory support both the UI components and content areas.
• Deployment pipelines (GitHub Actions workflows) manage builds and deployment steps, likely triggering builds (via npm run build) and deploying to GitHub Pages or another host.
Architectural Patterns and Design Principles
• Static-Site Generation (SSG): Docusaurus builds static pages for fast load times and easy hosting.
• Component-Based Architecture: React components manage the UI logic with separation of concerns (e.g., UI Components, common form fields, layout components).
• Separation of Content and Presentation: Content is stored in Markdown/MDX files (in “docs” and “blog”), while presentation logic lives in the “src” directory.
• Use of Standard Build & Deployment Processes: npm scripts, GitHub workflows, and configuration files ensure modularity and maintainability.
Technologies
• Docusaurus (static site generation, configuration via docusaurus.config.ts)
• React (for interactive components)
• Tailwind CSS (for styling)
• Babel (for JavaScript transpilation)
• GitHub Actions (for CI/CD)
• npm/yarn for dependency management