This application is a comprehensive boilerplate for complex and large systems, especially those that need to scale with security and code quality. It combines the power of Astro.js for static site generation with the reactivity of Solid.js for dynamic components.
We sought to achieve three pillars:
- Readability: Clean, well-documented code that's easy to understand
- Reusability: Components and utilities designed to be reused across the application
- Refactorability: Well-structured code that's easy to modify and extend
In the construction of the UI, the Atomic Design structure was chosen, organizing the global components into atoms, molecules, organisms, and templates. This methodology helps create consistent, scalable, and maintainable UI systems.
In addition to being constantly updated, this project was configured in the smallest details to serve as a basis for professional projects that require standardized and easy-to-maintain code architecture and design.
- Technologies
- Features
- Project Structure
- Prerequisites
- How to install and run the project
- Testing
- Contributing
- Author
π Astro.js - Fast, modern static site generator with island architecture
β Solid.js - Reactive JavaScript library for building user interfaces
π₯ TypeScript - Typed JavaScript for better developer experience and code quality
π CSS Modules - Locally scoped CSS for component styling
π© Lints & Formatters:
- Lefthook - Git hooks manager
- BiomeJS - Fast formatter and linter
- Commitlint - Lint commit messages
β Testing:
- Vitest - Fast unit testing framework
- Playwright - End-to-end testing framework
-
Responsive design - Mobile-first approach for all screen sizes
-
Atomic Design - Structured component hierarchy for maintainable UI
-
Accessibility - Detection of prefers-reduced-motion and other a11y features
-
Theming - Theme configuration with CSS Modules for consistent styling
-
Developer Experience:
- Global aliases for importing utilities like
clsx
without manual imports - Instant lint and formatter with BiomeJS
- Lefthook runs lint only on changed files
- Global aliases for importing utilities like
-
Performance:
- Ultra-optimized font setup, each font only 2kb with preload
- Astro's partial hydration for minimal JavaScript
-
Icons - Customizable icon system supporting your own SVGs and any icon from Iconify
-
CI/CD:
- Automatic release generation and versioning
- Pre-configured GitHub Actions workflows
boilerplate_astro_solidjs/
βββ .github/ # GitHub workflows and configuration
βββ public/ # Static assets
βββ src/ # Source code
β βββ @types/ # TypeScript type definitions
β βββ components/ # UI components (Atomic Design)
β β βββ atoms/ # Basic building blocks (buttons, inputs, etc.)
β β βββ molecules/ # Groups of atoms functioning together
β β βββ organisms/ # Complex components composed of molecules and atoms
β β βββ layouts/ # Page layout components
β βββ hooks/ # Custom SolidJS hooks
β βββ pages/ # Astro pages for routing
β βββ tests/ # Test utilities
β β βββ flows/ # Test flows and scenarios
β β βββ mocks/ # Mock data and functions
β β βββ pages/ # Page tests
β β βββ providers/ # Test providers
β β βββ utils/ # Testing utilities
β βββ theme/ # Styling and theming
βββ astro.config.ts # Astro configuration
βββ biome.json # BiomeJS configuration
βββ package.json # Project dependencies and scripts
βββ playwright.config.ts # Playwright E2E test configuration
βββ tsconfig.json # TypeScript configuration
βββ vitest.config.ts # Vitest configuration
- Node.js - Version 22 or higher (LTS recommended)
- pnpm - Latest version (used as the package manager)
git clone https://github.com/everton-dgn/boilerplate_astro_solidjs.git
cd boilerplate_astro_solidjs
pnpm i
pnpm dev
For verbose output:
pnpm dev:verbose
Available at http://localhost:4321
pnpm build
pnpm preview
Available at http://localhost:4321
pnpm test
With coverage:
pnpm test:c
pnpm test:w
With UI:
pnpm test:ui
pnpm test:e2e
With UI:
pnpm test:e2e:ui
Generate test code:
pnpm test:e2e:codegen
pnpm lint
Type checking:
pnpm typecheck
Format checking:
pnpm check:format
pnpm format
pnpm check:update
The project uses a comprehensive testing strategy:
Component tests are located in __tests__
directories next to the components they test. Example:
// src/components/atoms/Button/__tests__/Button.test.tsx
import { screen } from '@solidjs/testing-library'
import { renderWithProviders } from 'tests/providers/component'
import { event } from 'tests/utils'
import { Button } from '..'
describe('[Component] Button', () => {
it('should call a function once on click on the button', async () => {
const onClick = vi.fn()
renderWithProviders(() => (
<Button label="More information" onClick={onClick} />
))
const btn = screen.getByRole('button', { name: /More information/i })
await event().click(btn)
expect(onClick).toHaveBeenCalledTimes(1)
})
})
E2E tests simulate real user interactions in a browser environment. Run them with:
pnpm test:e2e
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature
- Commit your changes:
git commit -m 'feat: add some feature'
- This project uses conventional commits, so please follow the format
- Push to the branch:
git push origin feat/my-feature
- Open a Pull Request
Before submitting, please ensure:
- Your code follows the project's coding style
- All tests pass
- You've added tests for new features
- Your commit messages follow the conventional commits format
π LinkedIn: https://www.linkedin.com/in/everton-toffanetto
π YouTube: https://youtube.com/@toffanettodev