punchcard-cms / demo

Demonstration Repository of Punchcard
Apache License 2.0
0 stars 1 forks source link

Punchcard Demo Build Status Coverage Status

Deploy

Quickly deploy Punchcard CMS to Heroku, or use this repository as an example to deploy Punchcard anywhere.

Requirements

Punchcard is a Node.js based headless Content Management System that uses PostgreSQL as its database. It requires the following at a minimum to run:

Running Locally

Ensure that PostgreSQL is available on the command line and accessible via the postgres command. Create a user that has a password W@ts0n and ensure that there is a punchcard database created.

If working on a Mac, Homebrew is a convenient way to install PostgreSQL up and running. After installing Homebrew, do the following:

  1. Update Homebrew - brew update
  2. Install PostgreSQL - brew install postgres
  3. Start the PostgreSQL Server - postgres -D /user/local/var/postgres
  4. In a new terminal window or tab, create a new PostgreSQL user and set the password to W@ts0n when prompted - createuser punchcard -P
  5. Create a local database - createdb -0 punchcard punchcard

Local Development Commands

When working locally, there are two things that need to run: the database and the server. There are a number of helper scripts that ship with this repository to help with that:

Testing

Canonically, Punchcard uses AVA for testing (both as a runner and as an assertion library) and nyc for code coverage. Due to outstanding issues in later versions, nyc is pegged to v6. JavaScript is linted using ESLint Config Punchcard, using the relevant configurations (node, ava, or browser). Sass is linted using Sass Lint.

The basic test that ships with this repository checks to ensure that Punchcard can run with any modifications an end-user may want to make to the application coming from Punchcard. Custom input plugins are tested using Punchcard Shared Tests.

Punchcard Boilerplate

The following files and folders represent a fairly basic example of Punchcard Boilerplate to get Punchcard up and running. They are divided in to server, browser, test, and config. There are also generated files that can be mostly ignored.

Server Boilerplate

Server boilerplate are required (marked with *) and optional files and folders to get Punchcard running. All files and folders are relative to the running root of the application.

Browser Boilerplate

Browser boilerplate is based on the default source and destination targets using Punchcard Runner. These can be modified, and methods for compiling can be changed, as long as settings are updated as appropriate for Punchcard Runner.

Test Boilerplate

Tests, while not required to run Punchcard, are recommended in order to ensure Punchcard runs and is extended as expected.

AVA Tests

Linting

Config Boilerplate

There is a handful of general configuration files. Files that are required are marked with *.