Giter Club home page Giter Club logo

bandada's Introduction

Bandada

Github license GitHub Workflow test GitHub Workflow style Coveralls Linter eslint Code style prettier

Bandada is a public good plug-and-play infrastructure that empowers anyone to create and manage privacy-preserving groups of anonymous individuals, without necessitating prior expertise.

Bandada comprises a versatile back-end, two user-friendly front-ends (the dashboard to manage groups and members and a demo application to allow end-users to join the groups), Ethereum smart contracts for proof verification, and a collection of JavaScript libraries for seamless integration. From the Bandada dashboard, you can effortlessly create two types of groups: manual and credential groups. In manual groups, you can add members directly or generate invite links while, in credential groups, members must demonstrate their credentials for access. Bandada provides developers with JavaScript libraries, including @bandada/api-sdk to make it easier to work with the APIs. Furthermore, it provides preconfigured credential validators and allows for additional functionality through the @bandada/credentials library. This feature allows for manual or automated management of both off-chain and on-chain groups by specifying eligibility criteria. It can be used for a variety of applications, such as organizing private organizational members, grouping contributors of a particular GitHub repository, or uniting holders of a specific NFT, among others.

Please see the latest documentation to learn more about Bandada.

โš™๏ธ Applications

๐Ÿ“ฆ Libraries

Package Version Downloads
@bandada/hardhat NPM version Downloads
@bandada/contracts NPM version Downloads
@bandada/utils NPM version Downloads
@bandada/credentials NPM version Downloads
@bandada/api-sdk NPM version Downloads

๐Ÿ”ง Configuration

Prerequisites

Each package and application brings its own set of environment variables. To getting started with Bandada, you can get rid of the configuration and just use the default settings. Copy the environment variables used by the api application by running this command:

cp apps/api/.env.example apps/api/.env

NB. Bandada requires an SQL database (see api application for usage). Currently, PostgreSQL and SQLite (default) has been successfully tested (watch out that others SQL flavors may work but have not been tested). We are assuming you are using SQLite as the database.

The applications will be deployed at the following URLs without any changes to the default configurations:

App Development Production Staging
Bandada API http://localhost:3000 https://api.bandada.pse.dev https://api-staging.bandada.pse.dev
Bandada Dashboard http://localhost:3001 https://app.bandada.pse.dev https://app-staging.bandada.pse.dev
Bandada Client App http://localhost:3002 https://client.bandada.pse.dev https://client-staging.bandada.pse.dev

๐Ÿ›  Installation

Clone this repository:

git clone https://github.com/bandada-infra/bandada.git

and install the dependencies:

cd bandada && yarn

๐Ÿ“œ Usage

To build the applications, libraries and compile the contracts, run the following command:

yarn build

A dist folder will be created in each library/application.

To start the applications in a development environment, run the following command:

yarn dev

Use the following command to start the applications in the production environment:

yarn start

Testing

Run Jest to test the code with coverage:

yarn test

๐Ÿณ Running in Docker

Prerequisites

To run Bandada using Docker, execute the following command in the project root:

docker-compose up -d

Local Development

To begin local development, use the following command to start essential dependencies such as a local Ethereum network (with data persistence) and TheGraph node:

docker-compose -f docker-compose.dev.yml up -d

The Ethereum node (Ganache) will run on port 8545 with accounts pre-funded with 100 ETH:

0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
# this is the same first account generated by Hardhat network as well.
Private Key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

To deploy the contracts to the local network, use the command below:

yarn workspace contracts deploy:bandada-semaphore --network local

The contract addresses deployed in a new local network are:

Pairing library has been deployed to:               0x5FbDB2315678afecb367f032d93F642f64180aa3
SemaphoreVerifier contract has been deployed to:    0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
Bandada contract has been deployed to:             0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
BandadaSemaphore contract has been deployed to:    0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9

Default values for contract addresses are set in libs/utils/src/contract-addresses.ts. If you make changes to the contract and redeploy, you will need to update the address here.

To reset the local network or TheGraph node, stop the docker containers and delete the corresponding folders inside ./.data.

๐Ÿ“ก Enable API Access for a Group

Bandada offers APIs for retrieving group data and managing group members. As an admin of a manual or invitation group, you can use the API key to add or remove members.

To enable API access for a group, go to the group page in the dashboard and toggle the Enable API Access button. Once enabled, a new API key will be generated for you. You can disable API access at any time using the same toggle button.

Screencast.from.25-01-2024.15.21.32.webm

๐Ÿ”Œ APIs endpoints

To see the complete list of available endpoints, please visit https://api.bandada.pse.dev.

๐Ÿ‘จโ€๐Ÿ’ป Contributing

Code quality and formatting

Run ESLint to analyze the code and catch bugs:

yarn lint

Run Prettier to check formatting rules:

yarn prettier

or to format the code automatically:

yarn prettier:write

Conventional commits

Bandada utilises conventional commits, which follow a standardised format for commit messages. To use this format, you can run the command line utility by running:

yarn commit

The command will automatically verify that the modified files adhere to the rules of ESLint and Prettier.

Releases

Steps:

  1. Bump a new version with:
yarn version:bump <version>
# e.g. yarn version:bump 2.0.0

This step creates a commit and a git tag.

  1. Push the changes to main:
git push origin main
  1. Push the new git tag:
git push origin <version>
# e.g. git push origin v2.0.0

After pushing the new git tag, a workflow will be triggered and will publish the Bandada packages on npm and release a new version on Github with its changelogs automatically.

bandada's People

Contributors

0xjei avatar 0xlws avatar aguzmant103 avatar ariesjia avatar ayoseun avatar baumstern avatar cedoor avatar code-gambler avatar dozie2001 avatar gooddaisy avatar iamonuwa avatar insun35 avatar intldds avatar jdhyun09 avatar jennyg0 avatar kalidiagne avatar namanag0502 avatar neel-ds avatar ntampakas avatar omahs avatar qope avatar rex4539 avatar ryanpwaldon avatar saleel avatar sandipgyawali avatar tanya-ruby avatar tanyas-codes avatar volantxs avatar vplasencia avatar waddaboo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bandada's Issues

Create admin on-chain group flow

This is an issue specifically for design.
Design needs: button to create a group, input for name, select depth of merkel tree, manually add members (copy and paste id commitment)

M2 - Goal 3: Invitation codes

Description:

When admins create a permissioned group they generate a magic link with an invitation code that can only be used once by users who receive the link.

Tasks:

On-chain proof verification

Description:

The ZK-Groups contract should be independent from the protocol used to verify proofs. For each protocol a new specific contract can be added.

Tasks:

  • Make ZKGroups.sol contract independent
  • Create specific contract to verify proofs with Semaphore
  • Update contract-utils lib

Test services using a temporary DB

Description:

Mocking too many functions in our service tests is quite limiting. Using a test DB can allow us to make our tests more effective.

Create Docker files

  • Add Dockerfile for client and dashboard packages
  • Update docker-compose to include client and dashboard

M2 - Goal 4: Smart contracts

Description:

ZK-Groups will allow admins to create on-chain permissioned groups with Metamask and the Semaphore.sol contract on the Dashboard. Admins will manually add/remove/update members.

A ZK-Groups contract will also be created and it will be used to save the Merkle roots of the off-chain permissioned groups, which will then allow members of off-chain groups to verify their zero-knowledge proofs in that contract.

Additional group filters and sorting will be added to the Dashboard.

Tasks:

  • Create a NX Solidity app with a ZKGroups.sol contract for the off-chain Merkle roots
  • #34
  • #51
  • #52
  • #53

M2 - Goal 2: Client application

Description:

Users will be able to join reputation groups with a simple application where they will need to authenticate with Twitter, Reddit or Github. They will also be able to join the permissioned groups with a magic link created by the admins, which can only be used once. This application should also show the list of available reputation groups.

Tasks:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.