Skip to content

vocdoni/ui-components

Repository files navigation

Star History Chart

Vocdoni is the first universally verifiable, censorship-resistant, anonymous, and self-sovereign governance protocol.
Our main aim is a trustless voting system where anyone can speak their voice and where everything is auditable.
We are engineering building blocks for a permissionless, private and censorship resistant democracy.
Explore the developer portal »

More About Us

Vocdoni Website | Web Application | Blockchain Explorer | MIT Law Publication | Contact Us

Key Repositories

Vocdoni Node | Vocdoni SDK | UI Components | Application UI | Census3

ui-components

This repository aims to ease the creation of voting interfaces for user-facing applications. The purpose is to allow developers to easily integrate a variety of voting flow components and style these components as desired.

Included Packages

Component Description
chakra-components badge Voting-related react components built with chakra for easy integration with Vocdoni.
rainbowkit-wallets badge A set of custom wallets for rainbowkit.
react-providers badge React providers and hooks, where most of the Vocdoni protocol integration happens (required by @vocdoni/chakra-components)
extended-sdk badge Package extending our SDK functionalities (for advanced usage).

The best place to learn about using ui-components packages is the developer portal.

Table of Contents

Getting Started

Each of these packages can be used in a typescript/javascript project by importing them, eg. yarn add @vocdoni/chakra-components. Follow the developer documentation, or go to each individual package's readme file, for further details.

Each of the packages has a typescript file configured as an entrypoint, so you should be able to just run yarn dev on the included chakra template to start developing any of the included packages.

If you link (via npm/yarn link) any of the included packages to your project, your project MUST be able to run typescript code. Otherwise it will fail.

Turbo was initially configured for the development process, but its usage is minimal; still, you can use it for some global commands:

  • yarn build: will build every package in the monorepo (including templates)
  • yarn clean: removes dist, .turbo and node_modules folders in the entire monorepo.
  • yarn lint: runs the linter of each package (may vary per package, but usually prettier & tsc).
  • yarn test: runs all the tests in the monorepo. Note these are configured globally in the monorepo (testing dependencies are in the base package.json file)

Reference

The developer portal includes a reference for the @vocdoni/chakra-components package that also incorporates the full functionality of @vocdoni/react-providers.

Examples

You can find mock-functional examples of each of the chakra components in the ui-components documentation. There is also real-world usage of many of the components and providers from this library in the code for the Vocdoni application front-end.

Preview

In addition to the live examples in the documentation, you can see many of the components in use at https://app.vocdoni.io/

Disclaimer

This project is a WIP and is subject to continuous changes during its development. We encourage you to review this repository and the developer portal for any changes.

Contributing

While we welcome contributions from the community, we do not track all of our issues on Github and we may not have the resources to onboard developers and review complex pull requests. That being said, there are multiple ways you can get involved with the project.

Please review our development guidelines.

License

This repository is licensed under the GNU Affero General Public License v3.0.

Vocdoni UI React Components
Copyright (C) 2024 Vocdoni Association

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

License: AGPL v3