Skip to content

decide-ai/modclub_src

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

107 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modclub

ModClub is a moderation platform for online apps deployed on the IC. Moderation as a service (MaaS) is the concept of outsourcing controversial decisions or risky content in order to protect users and maintain trust within communities.

Prerequisites

  • Dfx 0.20.1
  • Node.js >=20.0.0

Quick start

Follow the steps to start qa env on locally:

  1. Start dfx server:
    dfx start --clean

  2. Delopy canisters locally:
    scripts/infra/up_infra.sh

  3. Start UI from modclub_assets:
    yarn start

Go to http://localhost:9000/ and will see the Modclub pages.

Modclub Assets

The Modclub asset canister delivers assets for Modclub, crafted using the React framework. Modclub Frontend architecture

AuthProvider

This is top-level provider for authentication. We've chosen Connect2IC as our authentication library and have tailored wallets specifically for Modclub support.

The useConnect() hook offers insights such as connection status, principal. More details can be found here.

ProfileProvider

The ProfileProvider supplies fundamental user details, including email, ID, is_admin, and so on.

Use the useProfile() hook to access the ProfileContext.

Hooks and Utils

You can leverage all hooks offered by Connect2IC, such as:

  • useWallet() for accessing wallet information and addresses.
  • useBalance() to retrieve a user's assets when their wallet is linked.

We've also developed proprietary hooks like:

utils/apis are also provided:

  • api.ts houses the majority of canister-related APIs.
  • jwt.ts includes APIs associated with JWT.
  • util.tx provides offers standalone utility functions.

Loggings

Customized logger is provided to have controlled logging levels and environment-based filtering.

Auto-generated files by environment

The declarations_by_env.ts file is automatically generated to offer declarations specific to the current environment(prod/qa/dev).

Running Local Tests

  1. Ensure you have docker running
  2. Run make run

About

Moderation as a Service on the Internet Computer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6