UNPKG

2.92 kBMarkdownView Raw
1# Punchcard CMS [![Build Status](https://travis-ci.org/punchcard-cms/punchcard.svg?branch=master)](https://travis-ci.org/punchcard-cms/punchcard) [![Coverage Status](https://coveralls.io/repos/github/punchcard-cms/punchcard/badge.svg?branch=master)](https://coveralls.io/github/punchcard-cms/punchcard?branch=master) [![Code Climate](https://codeclimate.com/github/punchcard-cms/punchcard/badges/gpa.svg)](https://codeclimate.com/github/punchcard-cms/punchcard)
2
3[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/punchcard-cms/demo)
4
5Headless Content Management System designed with content strategy at its heart. Built with Node.
6
7## Install and Usage
8
9```bash
10npm i punchcard-cms --save
11```
12
13```javascript
14const punchcard = require('punchcard-cms');
15
16punchcard().then(app => {
17 app.listen(8080);
18})
19```
20
21## Setting File Storage
22
23Punchcard uses any [Vinyl Adapter](https://www.npmjs.com/package/vinyl#what-is-a-vinyl-adapter) that your heart desires. A good first place to start is searching for [vinyl on NPM](https://www.npmjs.com/search?q=vinyl). Punchcard assumes all vinyl adapters are named `vinyl-adapter`.
24
25## Developing Locally
26
27Make sure PostgresSQL is set up locally (see below)
28
29Install all the things
30
31```bash
32npm install
33```
34
35Run the following to run both the database and get the server running:
36
37```bash
38$ npm run dev
39```
40
41## debug mode
42
43Uses node's [built in inspector](https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27#.vgad4zqg9). This works in **chrome only**.
44
45```bash
46$ npm run dev:database
47```
48
49then in a separate window:
50
51```bash
52$ npm run debug
53```
54
55There will be instructions and a link to paste into chrome shown in the terminal after this `debug` command is run.
56
57
58
59## Setting up PostgreSQL locally
60
611. Make sure you have homebrew installed: `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
62
632. `brew update`
643. `brew install postgres`
654. start the postgres server: `postgres -D /usr/local/var/postgres`
66
675. open new terminal tab
686. create a postgres user (it'll prompt for a password use `W@ts0n`): `createuser punchcard -P`
69
707. Create local CMS database: `createdb -O punchcard punchcard`
71
728. Create local test database: `createdb -O punchcard punchcard_test`
73
749. reconnect to psql as new user: `psql -d punchcard -U punchcard`
75
7610. connect to db: `\connect punchcard`
77
78Once you are connected you should be able to use psql cli syntax to check tables.
79* `\d+` checks table relations
80* `\l` lists all available databases
81* `select * from "database_name";` Displays all rows in database, replacing database_name with the table you want to see.
82* list all tables for user punchcard: `\c punchcard \dt`
83
84## Changelog
85
86See the [latest release](https://github.com/punchcard-cms/punchcard/releases/latest) for the most recent changelog