Download the source code on GitHub from refinerycms.org
Read the developer/API documentation at api.refinerycms.org