Nick is a nearly headless CMS written in Node.js. Starting out as proof of concept it is now on par with the Plone REST API and works flawlessly with the Volto front-end. This talk will show you how you can create a site using Nick.
3. WHAT WILL WE COVER?
What is Nick?
Why?
Architecture
4. Bootstrap a project
Configuration file
i18n
Logging
Profiles
Contenttypes
Behaviors
Initial Content
Permissions, Users,
Groups & Workflows
Vocabularies
Catalog & Search
Events
Controlpanels
Tests
Docs
WHAT WILL WE COVER?
5. WHAT IS NICK?
Headless CMS
Build with Node.js
RESTfull API compatible with plone.restapi (Volto)
6. WHY?
Fun to build!
Plone has a great architecture, great way to learn the
internals
Plone has a great Rest API
Started as a proof of concept on Ploneconf 2018 in
Tokyo
Frontend and backend using the same language
18. CREATE THE DATABASE
CREATE DATABASE myproject;
CREATE USER myproject WITH ENCRYPTED PASSWORD 'myproject';
GRANT ALL PRIVILEGES ON DATABASE myproject TO myproject;
19. YEOMAN GENERATOR
$ npm install -g yo
$ npm install -g @robgietema/generator-nick
$ yo @robgietema/nick myproject
39. DOCUMENT MODEL
/**
* Document Model.
* @module models/document/document
*/
/**
* A model for Document.
* @class Document
* @extends Model
*/
export class Document extends Model {
...
/**
40. ID_TITLE_FROM_YEAR.JS
/**
* Id and title from year behavior.
* @module behaviors/id_title_from_year/id_title_from_year
*/
import { uniqueId } from '@robgietema/nick/src/helpers/utils/u
/**
* Id and title from year behavior.
* @constant id_title_from_year
*/
export const id_title_from_year = {
/**
* Set id
* @method setId
41. SRC/BEHAVIORS/INDEX.JS
/**
* Point of contact for behaviors.
* @module behaviors
*/
import { id_title_from_year } from './id_title_from_year/id_ti
const behaviors = {
id_title_from_year,
};
export default behaviors;
49. PERMISSION SYSTEM
Permissions
Roles (have permissions)
Groups (have roles)
Users (have roles, groups)
Local roles (user/group has a role on an object)
Local role permissions are inherited from the parent
Local role inheritence can be disabled per object
Workflows (have states and transitions)
States (have permissions per role)
Transitions (have permissions)
72. TOTALTIME INDEX
/**
* Total time index behavior.
* @module behaviors/total_time_index/total_time_index
*/
import { map } from 'lodash';
/**
* Total time index behavior.
* @constant total_time_index
*/
export const total_time_index = {
/**
* Get total time
* @method totalTime
73. SRC/BEHAVIORS/INDEX.JS
/**
* Point of contact for behaviors.
* @module behaviors
*/
import { author_index } from './author_index/author_index';
import { id_title_from_year } from './id_title_from_year/id_ti
import { total_time_index } from './total_time_index/total_tim
const behaviors = {
author_index,
id_title_from_year,
total_time_index,
};
98. TYPES.MD
---
nav_order: 1
permalink: /types
---
# Types
## Get the schema with GET
To get the schema of a content type, access the `/@types` endp
```
{% include_relative examples/types/schedule.req %}
```