Meme-Chain is a social network of memes with a good cause for charity and donations built on NEAR Protocol. Users can browse the trends and can upload the memes on it. Other users can just browse the memes and have a good time. They can also tip as well where the 90% of the money goes to the charity selected by the memer and rest 10% goes to him. This way the memer has incentives to create more memes and we feel good as we have donated our money to a charity. It supports all kinds of meme format from jpg to gifs and is stored in IPFS. The application is hosted in NEAR Protocol as it is the best choice for an application like this which will have traffic and NEAR has relatively less gas usage.
Finally! With Meme-Chain we can escape the toxic world of Social Networks (Twitter, Faceboook, you name it) into the world of Memes :)
You can find the demo of the application here.
Thanks a lot to NEAR Community for all the support.
Sign in with NEAR and add a message to the guest book! A starter app built with an AssemblyScript backend and a React frontend.
To run this project locally:
- Prerequisites: Make sure you have Node.js ≥ 12 installed (https://nodejs.org), then use it to install yarn:
npm install --global yarn
(or justnpm i -g yarn
) - Install dependencies:
yarn install
(or justyarn
) - Run the local development server:
yarn dev
(seepackage.json
for a full list ofscripts
you can run withyarn
)
Now you'll have a local development environment backed by the NEAR TestNet! Running yarn dev
will tell you the URL you can visit in your browser to see the app.
- The backend code lives in the
/assembly
folder. This code gets deployed to the NEAR blockchain when you runyarn deploy:contract
. This sort of code-that-runs-on-a-blockchain is called a "smart contract" – learn more about NEAR smart contracts. - The frontend code lives in the
/src
folder. /src/index.html is a great place to start exploring. Note that it loads in/src/index.js
, where you can learn how the frontend connects to the NEAR blockchain. - Tests: there are different kinds of tests for the frontend and backend. The
backend code gets tested with the asp command for running the backend
AssemblyScript tests, and jest for running frontend tests. You can run
both of these at once with
yarn test
.
Both contract and client-side code will auto-reload as you change source files.
Every smart contract in NEAR has its own associated account. When you run yarn dev
, your smart contracts get deployed to the live NEAR TestNet with a throwaway account. When you're ready to make it permanent, here's how.
You need near-shell installed globally. Here's how:
npm install --global near-shell
This will give you the near
CLI tool. Ensure that it's installed with:
near --version
Visit NEAR Wallet and make a new account. You'll be deploying these smart contracts to this new account.
Now authorize NEAR shell for this new account, and follow the instructions it gives you:
near login
Modify the line in src/config.js
that sets the account name of the contract. Set it to the account id you used above.
const CONTRACT_NAME = process.env.CONTRACT_NAME || 'your-account-here!'
One command:
yarn deploy
As you can see in package.json
, this does two things:
- builds & deploys smart contracts to NEAR TestNet
- builds & deploys frontend code to GitHub using gh-pages. This will only work if the project already has a repository set up on GitHub. Feel free to modify the
deploy
script inpackage.json
to deploy elsewhere.