Git Product home page Git Product logo

clay-starter's Introduction

Clay Starter

A basic starter for Clay

Docs

Documentation around Clay is being refined in cojunction with iteration on this starter. For beginning documentation about Clay and its data structures you can browse this link: https://claycms.gitbook.io/clay/

Requirements

Assumptions

  • This repo uses Google for OAuth by default. To use your Google account to authenticate locally change the username field in sample_users.yml
  • You're running Node 8.12.0 or greater
  • You've installed Clay CLI

Setup

Clone the repo and run the following commands:

  • cp app/.env.sample app/.env (This will create a file with the required env variables)
  • make (This will download the containers, run an npm install and start the app)
  • make add-access-key (Please read this doc for more information about your Clay access key)
  • make bootstrap (This command seeds some starting data)
  • make bootstrap-user (This command seeds a user from sample_users.yml file at the root of this project)

You should be able to navigate to http://localhost/_pages/sample-article.html to see an article page render!

Accessing The Edit UI

The edit interface of Clay is a component itself called Kiln! To begin editing with the UI you'll need to make sure you've run make boostrap-user after replacing the sample user with your own credentials or using the default one. Here's an example of what can be included in the sample_users.yml file:

_users:
  -
    username: admin
    password: clay
    provider: local
    auth: admin
  -
    username: <your full email address> # i.e.: [email protected]
    provider: google # Can be either google, twitter, slack, ldap or cognito
    auth: admin # Can be either admin or write

Once you've done that, you can access edit mode from any page by adding ?edit=true or by holding down Shift and typing CLAY. For example, navigating to http://localhost/_pages/sample-article.html?edit=true will grant you access to the edit interface. In the login screen, you can gain access to edit mode by setting Username: admin and Password: clay, or the credentials you set in sample_users.yml.

Stopping & Clearing Out Data

  • make burn (Stops and removes all service containers)
  • make clear-data (Removes all local data)
  • make clear-public (Removes the app/public directory which is Express' static asset directory)

What's Running?

The project consists of four services running in Docker and Clay running on your host machine.

  • NGINX: locally it allows us to forward port 80 to Clay to make working with Clay easy. The current configuration is set to only route requests to localhost. If you want to change the host that clay listens to you'll need to update the NGINX config
  • Postgres: the primary data store for Clay data
  • Redis: locally this container is the cache for Postgres, the session store for PassportJS and the event bus for Clay
  • ElasticSearch: integrated for search functionality

clay-starter's People

Contributors

amelvisfranco avatar dependabot[bot] avatar james-owen avatar jeanrodriguez avatar jonwinton avatar jpope19 avatar manuelurenah avatar mattoberle avatar phyllisstein avatar ritsok avatar robcombs avatar scottnash avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.