Code for SocialCake NEM Project
Branch: master
Clone or download
Amru Amru
Latest commit c635e41 Feb 8, 2018


What is SocialCake

SocialCake allows content creators of all kinds to sell digital goods directly to their audience. Artists, musicians, writers, and more can sell digital content simply by sharing a message.

How it Works

Using SocialCake is easy. First, users can upload a file and specify how much the file costs, what address should receive payments, and how many Mosaics should be created for the file in question (or unlimited). Then, the file will be uploaded to SocialCake’s Firebase database (in the future we plan to decentralize this by using a blockchain storage platform) and a Mosaic is created in the “socialcake” namespace.

This Mosaic is very important because it’s description includes the file name, last modified date, the file’s MD5 and SHA1 hashes, and a levy to credit the user in the event of a sale. The file hashes in the description are especially critical because they serve as proof of ownership for the file in question, and can be used to assert the integrity of the file they download at any time. The app then displays a unique ID that can be shared to purchase the file.

When a buyer comes along to purchase the file, they simply send a payment of the specified amount to SocialCake’s NEM address and include the unique ID in the message body. In return, the buyer will automatically receive a Mosaic with an encrypted message containing the download link for their file. The levy on the Mosaic will deduct the fees from SocialCake and fund the original uploader. This is a great way to guarantee that the profits from the transaction go directly to the creator.


SocialCake upload

SocialCake share

Tech Stack

This project was bootstraped with React Firebase Starter by Kriasoft.

Directory Layout

├── node_modules/                  # 3rd-party libraries and utilities
├── public/                        # Static files such as favicon.ico etc.
├── src/                           # Application source code
│   ├── components/                # Shared React components
│   ├── nem/                       # Nem utilities and services
│   ├── routes/                    # Components for pages/screens + routing information
│   ├── auth.js                    # Authentication manager
│   ├── history.js                 # Client-side navigation manager
│   ├── index.js                   # <== Application entry point (main) <===
│   ├── registerServiceWorker.json # This list of application routes
│   ├── relay.js                   # Relay Modern client
│   ├── graphql.schema             # GraphQL schema obtained from a GraphQL API
│   └── theme.js                   # Overrides for Material UI default styles
├── package.json                   # The list of project dependencies + NPM scripts
└── setup.js                       # Customizations for create-react-app


Getting Started

Just clone the repo and start hacking:

$ git clone MyApp
$ cd MyApp
$ yarn install                     # Install project dependencies listed in package.json
$ yarn start                       # Compiles the app and opens it in a browser with "live reload"

Then open http://localhost:3000/ to see your app.

npm start

How to Test

$ yarn lint                        # Check JavaScript and CSS code for potential issues
$ yarn fix                         # Attempt to automatically fix ESLint warnings
$ yarn test                        # Run unit tests. Or, `yarn test -- --watch`

How to Deploy

$ yarn build                      # Build the app for production
$ firebase deploy                 # Deploy to Firebase


Copyright © 2018-present SocialCake. This source code is licensed under the MIT license found in the LICENSE.txt file.