This repository includes all the code deployed by Unlock, including smart contracts and the web app running at unlock-protocol.com.
Unlock is an access control protocol built on a blockchain. It enables creators to monetize their content or software without relying on a middleman. It lets consumers manage all of their subscriptions in a consistent way, as well as earn discounts when they share the best content and applications they use.
Read more about why we're building Unlock.
We recorded a screencast to show how Unlock works for a paywall.
We are building this in the open, which means you can also run the code locally (see instructions below). You can try out the staging version - which runs the latest, in-progress code - at https://staging.unlock-protocol.com. Finally, you can learn more on our documentation wiki.
Thanks for your interest in contributing to Unlock! We're excited you're here. There are a variety of ways to contribute to the project. Please read more about contributing in our contributor guide. Please also check our code of conduct for all participants in our community.
- Ensure your dev environment is correct
unlock requires node version 8.11.4, and the latest npm in order to build. You can ensure that npm is the latest version with:
$ npm i -g npm
To manage node versions, there are several options. If you are using nvm, note that the default version of npm installed with node version 8.11.4 is outdated, and will result in several node-gyp errors. Upgrading npm will fix these errors.
- Check out the code from this repository
git clone https://github.com/unlock-protocol/unlock cd unlock
- Install all deps
This will install all dependencies required for all the Unlock components (smart contracts and react app).
$ npm install
- Run the app (this should also compile and deploy the smart contract to a local truffle node)
cd unlock-app && npm run dev
We deploy with docker/docker-compose:
docker-compose -f docker/docker-compose.ci.yml build docker-compose -f docker/docker-compose.ci.yml up --abort-on-container-exit
Thank you to BrowserStack for their open source browser testing infrastructure.