A comprehensive design system and component library powering Gitcoin's ecosystem of web applications. This monorepo contains the shared UI components, utilities, and configuration used across Gitcoin's products.
- Overview
- Key Features
- What's next?
- Tech Stack
- Getting Started
- Versioning & Publishing Packages
- Project Structure
- Build Tools
- Documentation
- Contributing
- License
- Support
Gitcoin Core is built and maintained by the Gitcoin team and community to:
- Ensure consistency across all Gitcoin products
- Accelerate development with pre-built, tested components
- Maintain high quality standards for accessibility and user experience
- Enable seamless collaboration between teams and contributors
- Provide a single source of truth for Gitcoin's design language
- π¨ Complete design system implementation
- 𧱠Production-ready React components
- β‘οΈ Production-ready NextJS components
- βΏοΈ Accessible by default (WCAG 2.1 compliant) (coming soon)
- π± Responsive and mobile-first (coming soon)
- π Dark mode support (coming soon)
- π Internationalization ready (coming soon)
- β‘οΈ Performance optimized (coming soon)
- π Comprehensive documentation (coming soon)
This design system is powered by modern, battle-tested technologies:
- π Turborepo β High-performance build system for Monorepos
- π React β JavaScript library for user interfaces
- π Vite β Next Generation Frontend Tooling (for UI package)
- π¨ Tsup β TypeScript bundler powered by esbuild (for other packages)
- π Storybook β UI component environment powered by Vite
- TypeScript for static type checking
- Tailwind CSS for utility-first CSS
- Tailwind Variants for type-safe variants
- Shadcn/ui for accessible UI components
- React Query for server state management
- React Hook Form for form handling
- Zod for schema validation
- ESLint for code linting
- Prettier for code formatting
- Changesets for versioning
- MSW for API mocking
- Vitest for unit testing
- Testing Library for component testing
- Node.js 20+
- pnpm 9+
- Clone the repository
- Install dependencies:
pnpm install
# Start Storybook and watch for changes
pnpm dev
# Build all packages
pnpm build
# Run tests
pnpm test
# Lint code
pnpm lint
# Format code
pnpm format
# Clean build artifacts
pnpm clean
This example uses Changesets to manage versions, create changelogs, and publish to npm. It's preconfigured so you can start publishing packages immediately.
You'll need to create an NPM_TOKEN
and add it to your GitHub repository settings to enable access
to npm. It's also worth installing the Changesets bot on
your repository.
-
Create a Changeset
pnpm changeset
This will:
- Show which packages have changed
- Let you select packages to include in the changeset
- Ask about version bumps (major/minor/patch)
- Prompt for a change summary
- Create a new Markdown file in the
changeset
folder
-
Update Package Versions (optional, needs GITHUB_TOKEN
pnpm version-packages
This command:
- Reads all changesets
- Updates package versions
- Updates CHANGELOG files
- Commits these changes directly (skipping the PR process)
-
Release There are two paths for releasing:
a) Direct Release (if you ran
pnpm version-packages
locally):- Push your changes to GitHub
- When merged to main, the GitHub Action will automatically:
- Build all packages
- Publish to npm
- Create GitHub releases
b) PR-based Release (if you only created changesets):
- Push your changes with changesets to GitHub
- The GitHub Action will:
- Create a "Version Packages" PR that:
- Updates package versions
- Updates changelogs
- After merging this PR, the action will automatically:
- Build all packages
- Publish to npm
- Create GitHub releases
- Create a "Version Packages" PR that:
You'll need to set up a GitHub Personal Access Token (PAT):
-
Create the token:
- Go to https://github.com/settings/tokens/new
- Name it (e.g., "Changesets Token")
- Set the expiration as needed
- Under "Repository permissions", grant:
repo:status
read:user
-
Add to Local Environment (for local development):
# For bash users echo 'export GITHUB_TOKEN=your_token_here' >> ~/.bashrc source ~/.bashrc # For zsh users echo 'export GITHUB_TOKEN=your_token_here' >> ~/.zshrc source ~/.zshrc
This Turborepo includes the following packages and applications:
apps/next-app
: A placeholder documentation site powered by Next.jspackages/config
: Shared configuration (ESLint, TypeScript, etc.)packages/themes
: Shared theme configuration and color utilitiespackages/types
: Shared TypeScript typespackages/ui
: Core React componentspackages/utils
: Shared React utilities
Each package and app is 100% TypeScript. Workspaces enables us to
"hoist" dependencies that are shared between packages to the root package.json
. This means smaller
node_modules
folders and a better local dev experience. To install a dependency for the entire
monorepo, use the -w
workspaces flag with pnpm add
.
This example sets up your .gitignore
to exclude all generated files, other folders like
node_modules
used to store your dependencies.
The UI components are organized in the following structure:
packages/ui/src/
βββ components/ # Higher-level components
βββ features/ # Feature-specific components
βββ primitives/ # Basic UI building blocks
βββ ui-shadcn/ # Shadcn UI components
Each component follows a standard structure:
βββ ComponentName/
β βββ ComponentName.tsx # Main component
β βββ ComponentName.stories.tsx # Storybook stories
β βββ ComponentName.mdx # Documentation
β βββ index.ts # Public exports
This monorepo uses different build tools for different packages:
@gitcoin/ui
: Uses Vite for building the component library with features like SVG imports, TypeScript declaration files, and CSS processing- All other packages: Use Tsup for fast, efficient TypeScript/JavaScript bundling
- Component Library
Contributing Guide(comming soon)Architecture Decisions(comming soon)
(Comming soon)
Please read our Contributing Guide for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
- You can freely use, modify, and distribute this software
- If you modify this software and provide it as a network service, you must:
- Make your modified source code available to users
- License your modifications under AGPL-3.0
- Preserve all copyright notices and license information
- All derivative works must also be licensed under AGPL-3.0
- Join our Discord for discussions
- Report bugs via GitHub Issues
- Follow @gitcoin for updates