MCPcopy Index your code
hub / github.com/dfinity/cancan

github.com/dfinity/cancan @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
165 symbols 341 edges 45 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

CanCan

Build Status

A scalable video-sharing service.

Installation

Prerequisites

If you don't have vessel yet you can install it by running an install script included in the project:

$ ./scripts/vessel-install.sh

MacOS might ask if you're sure you trust this package. You can safely accept

Double-check you have vessel installed at version 0.6.*, then clone this repository and navigate to the cancan directory.

$ vessel --version
# vessel 0.6.0

$ git clone git@github.com:dfinity/cancan.git
$ cd cancan

Start a local Internet Computer replica.

$ dfx start

Execute the following commands in another terminal tab in the same directory.

$ npm ci # <- This installs packages from the lockfile for consistency

$ ./bootstrap.sh

This will deploy a local canister called cancan_ui. To open the front-end, get the asset canister id by running dfx canister id cancan_ui. Then open your browser, and navigate to http://<cancan_ui-canister-id>.localhost:8000/sign-in.

Frontend Development

To run a development server with fast refreshing and hot-reloading, you can use this command in the app's root directory:

$ npm run start

Your default browser will open (or focus) a tab at localhost:3000, to which you must then append /?canisterId=${cancan_ui_canister_id}, where cancan_ui_canister_id is typically (at current) ryjl3-tyaaa-aaaaa-aaaba-cai.

Now you can make changes to any frontend code and see instant updates, in many cases not even requiring a page refresh, so UI state is preserved between changes. Occasionally adding a CSS rule won't trigger an update, and the user has to manually refresh to see those changes.

Internet Identity Locally

Clone and setup the project and make sure that internet_identity is deployed, and you have the front-end available. That should allow you to do auth locally to try out the new Internet Identity service. For production, we will probably configure identity.ic0.app to be running this canister, but for now this is how to get it running.

Extension points exported contracts — how you extend this code

VideoProps (Interface)
(no doc)
src/components/SearchVideoItem.tsx
UploadVideoInit (Interface)
(no doc)
src/utils/video.ts
DiscoverProps (Interface)
(no doc)
src/views/Discover.tsx
Video (Interface)
(no doc)
scripts/seed.ts
VideoProps (Interface)
(no doc)
src/components/Video.tsx
AuthContext (Interface)
(no doc)
src/utils/auth.tsx
LottieAnimationProps (Interface)
(no doc)
src/components/LottieAnimation.tsx
CreateProfile (Interface)
(no doc)
src/utils/canister/typings.d.ts

Core symbols most depended-on inside this repo

unwrap
called by 10
src/utils/index.ts
getUserFromCanister
called by 6
src/utils/canister.ts
setDestination
called by 5
src/components/MainNav.tsx
getPathRoot
called by 4
src/components/MainNav.tsx
getIdentity
called by 4
src/utils/authClient.ts
useAuth
called by 3
src/utils/auth.tsx
getUserFromStorage
called by 3
src/utils/canister.ts
initBaseActor
called by 3
src/utils/canister/actor.ts

Shape

Function 125
Interface 25
Method 11
Class 4

Languages

TypeScript100%

Modules by API surface

src/utils/canister.ts23 symbols
src/utils/canister/typings.d.ts16 symbols
scripts/seed.ts11 symbols
src/utils/video.ts9 symbols
src/utils/canister/actor.ts9 symbols
src/utils/authClient.ts8 symbols
src/views/Profile.tsx7 symbols
src/utils/auth.tsx7 symbols
src/utils/index.ts6 symbols
src/components/Video.tsx6 symbols
src/components/RewardShowerNotification.tsx6 symbols
src/components/DropDayNotification.tsx5 symbols

For agents

$ claude mcp add cancan \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact