1000fans is a token-gated content platform for artists, creators, producers, music labels and distributors to connect with their 1000 most dedicated fans. This platform provides fans with exclusive content, music and video players, link to private events and a private chat for fans and their favorite artist. All secured by crypto tokens technology.
The idea behind the name 1000fans is coming from a 2008 essay saying that to make a living as an artist or a craftsperson, you don't need millions of clients or millions of fans. You need only a thousand of true fans, and create enough each year that you can earn $100 profit from each true fan.
An example of a deployed 1000fans fan club is available at https://theosis.1000fans.xyz
A 10-min video presentation is available here: https://youtu.be/YdDj1CHCW6Q.
- a smart contract, written in rust, generated by "cargo near new contract" and stored in the /contract subfolder of the root folder 1000fans.
- a frontend, written in javascript, generated by "npx create-near-app@latest" and stored in the /frontend subfolder of the root folder 1000fans.
- backend scripts, written in python, called metadata_extractor.py, upload.py, and chatHistory.py, and stored in the /scripts subfolder of the root folder 1000fans.
The gated content is stored an AWS s3 bucket: /music and /videos folders to store the audio and video files, and metadata files such as audioMetadata.json, chatHistory.json, eventsMetadata.json, videoMetadata.json, nocoverfound.jpg (a default cover image when no album cover is found in the audio files' metadata).
An automation is setup to scan for updates in the local /music and /videos folders every 24 hours, and update the AWS s3 storage in case audio or video files changed.
- Blockchain: NEAR Blockchain
- Frontend: JavaScript with the latest Next.js framework
- Smart Contract: A fan-token minter contract, limited to 1000 tokens.
- Homepage: Contains cards to trigger widgets displaying the gated content.
- Navigation Bar: User authentication and link to web3 interaction console.
- Console: Where fans can get and manage their tokens.
- Footer: Credits and dark/light toggle.
The smart contract can mint, transfer and check ownership of 1000 fans tokens (from fan000 to fan999). Any near wallet can get tokens. At term token holder will be able to offer their tokens for sale.
Upon wallet connection, the platform checks for the presence of a fan token:
- Valid Fan Token: Unlocks content.
- No Fan Token: Redirects to the console to request a token.
- Music Catalog: Styled like a Spotify playlist, displaying tracks with artist names, song titles, and icons.
- Video Catalog: Mimics a YouTube channel interface with video previews, sortable by various filters for user convenience.
- Event Schedule: Features a calendar view and a carousel of upcoming events. Clicking an event card leads to a ticket purchase.
- Chat Room: Private p2p discussions between token holders and the content creator.
Build the frontend with Javascript, HTML and CSS.Write the smart contract with Rust.Deploy and test the smart contract on testnet.Implement a "token check" in the wallet login.Implement a shop to allow the mint and transfer of fans token. (route users based on wallet connect? and token ownership? action buttons and input fields on the shop UI.)Update the smart contract: max 1 token per account, token count to automatically set the token ID: fan000, fan001, ..., fan999.Redeploy the contract on a new account 1000fans.testnet. start from scratch with token fan000. re-test all access-keys etc.Improve platform's design.Add a private chat for fans.fix the chat history saving.- Smart-contract update:
Allow multiple token holding.Remove 1-year-holding-before-sale rule. Add a paiement system: anyone can buy/sell tokens from their console. Add function listTokensForSale, and a buy function. Batch mint/transfer tokens? - Console update:
on token ownership check : "claim your fans token" or "transfer your token".display the text lower on the page to match background. - Automate events metadata: fetch resident advisor API?
- Test the platform with a closed group of users on testnet.
- Update the platform on user feedback:
- music widget => a player for encrypted .mp3 that only this player can play (@vandigital).
- chat widget => link to near social and/or curate.news (@elliot_braem)
- login => allow login with email/social accounts (@ThePiVortex)
- upload.py =>
drag and drop window in the console to upload new files with ai-extracted features for better file organization in storage. (@jcarbonnell) - video widget => live stream (@bandit_sonore)
- Deploy the contract on mainnet.
At term, anyone should be able to clone their own 1000fans from the main domain at 1000fans.xyz, with a couple of clicks and forms to fill in their personal data. So far, to clone and deploy your own 1000fans, you have to do it manually by following these steps:
- Clone the Repository:
git clone https://github.com/partagexyz/1000fans
cd 1000fans
- Setup the Smart Contract Environment:
-
Navigate to the contract directory:
cd contract
-
Install Rust: If you don't have Rust installed, follow the official installation guide:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Add WebAssembly Target:
rustup target add wasm32-unknown-unknown
-
Install NEAR CLI-RS:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh
-
Install cargo-near:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
- Test and Deploy the Smart Contract:
-
Run tests for the smart contract:
cargo test
-
Create or login to a NEAR testnet account:
near create-account <your-account-id.testnet> --useFaucet
or
near login
-
Build your contract:
cargo near build
-
Deploy your contract:
near deploy <created-account> ./target/near/athousandfans.wasm
- Setup and Run the Frontend:
-
Move to the frontend directory:
cd ../frontend
-
Install npm packages:
npm install
-
Build the project:
npm run build
-
Run the development server:
npm run dev
-
Access your local version of the platform via the URL provided in the console (usually
http://localhost:3000
).
- Configure AWS S3:
- Ensure you have an AWS account and set up an S3 bucket for storing content.
- Update the
.env
file or environment variables with your AWS credentials:AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY AWS_S3_BUCKET_NAME=YOUR_BUCKET_NAME
- Update AWS Credentials in Scripts:
- Navigate to the
scripts
directory:cd scripts
- Open
metadata_extractor.py
andupload.py
with a text editor. Update theAWS_S3_BUCKET_NAME
at the beginning of each script to reflect your bucket name. These scripts use environment variables, so ensure these are correctly set in your environment or.env
file.
- Navigate to the
- Run Metadata Extraction and Upload Scripts:
-
Extract Metadata:
python metadata_extractor.py
This script will scan your local
music
andvideos
folders in the frontend/public directory, extract metadata, and prepare it for S3 upload. -
Upload Files to S3:
python upload.py
This script will upload your music, videos, and metadata files to your AWS S3 bucket. Make sure your AWS credentials are correctly set, as it uses them to authenticate with AWS services.
- Testing:
- Test your deployment thoroughly, especially the interaction between the frontend, the smart contract, and the gated content.
- Deployment:
-
Create a New Branch:
git checkout -b <your-branch-name>
Give your branch the name of
your-account-id
. -
Commit Your Changes:
git add . git commit -m "Added <your-account-id> fans club"
Make sure to commit all changes you've made for your fans club.
-
Push to GitHub:
git push origin <your-branch-name>
This will push your new branch to the remote repository.
-
Create a Pull Request:
- Go to your repository on GitHub.
- You'll see your branch listed under "Pull requests" or "Branches". Click on "New pull request" for your branch.
- Set the base branch to where you want your changes merged (usually
main
ormaster
). - Add a detailed description of your changes, why they are necessary, and any special notes for reviewers.
- Submit the pull request.
-
Review Process:
- After submission, your pull request will be reviewed. You might need to respond to comments, make adjustments, and push new commits to your branch, which will automatically update the pull request.
-
Deployment on Approval:
- Once approved, your fans club will be deployed and accessible at your-account-id.1000fans.xyz.