Javascript Content Management System running on Node.js

Overview

Cody CMS

A Javascript Content Management System running on Node.js

We finally took upon the task, we are happy to announce the transition to Express 4 is now done! (dixit Slawo)

See http://www.cody-cms.org for more info and examples on http://github.com/jcoppieters/cody-samples

You can now use npm to install Cody thanks to Jonas.

Features

  • Node.js CMS
  • Easy-to-use graphical interface + wysiwyg (what you see is what you get) editor that allows non-programmers to manage the site's content, users, files, forms and images.
  • Tree structured GUI to manage the structure of the site and the editable content by using templates and drag-and-drop.
  • Works seamless with your existing node.js code.

Getting Started

By following these steps you will be running your own CMS system in no time. If any of the steps do not work for you, please report this as an issue on this github repository and we will look into it as soon as possible!

  • Install nodejs and mysql

  • Create a new directory for your cms and navigate to it (in unix):

      $ mkdir codydev
      $ cd codydev
  • Install cody and its dependencies

      $ npm install cody
  • Set up a new web site using the guided scaffolding

      $ node ./node_modules/cody/bin/create_site
      
      Creating cody web tree in current directory
      1) Enter sitename: mysite
      Note: also using my site as database name.
      Note: by default the mysql root user has no password so you can just hit enter, if you forgot the root password see http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
      2) Enter root password for mysql so we can create a new database and user: 
      3) Enter site database user: mysitename
      4) Enter site database password: mysitepassword
      5) Enter hostname for site: mysite.local (or localhost)
      Site mysite has been prepared.
      
      Please create DNS entries, or add to /etc/hosts:
      127.0.0.1     mysite.local
      
      Also check index.js and config.json to fine-tune extra parameters, encryption key, ...
      
      Start your site using:
      forever start mysite.js
      or
      node mysite.js
  • Add a DNS entry for given hostname, e.g.

      $ sudo bash -c 'echo 127.0.0.1 mysite.local >> /etc/hosts'
  • Run the server

      $ node mysite.js

    or if you want to automatically restart the server on changes

      $ forever start mysite.js
  • Go to "http://mysite.local:3001" to see your current site and go to "http://mysite.local:3001/en/dashboard" to see the CMS of the site.

    the default users are: 'super', 'admin', 'test' and 'user' which all have password 'empty' you can ofcourse use "http://localhost:3001" too.

Configuration

The create_site scaffolding creates a config.json file in the root of your project directory. This configuration can be adjust in the following three ways, listed in order of overwriting order (e.g. values of 2 will overwrite those of 1, etc.):

  1. Manually adjust the values in the config.json file
  2. Create your own config file and supply it at command-line with the -c option (since v3.2.5, thanks to andretw)
$ node index.js -c my_overwriting_config.json
  1. Provide environment variables
$ dbuser=dbuser dbpassword=dbpassword port=8080 node index.js

Careful, all three cases need a server restart before they take effect! Have a look at the generated config.json file to see which configuration variables you can use.

Troubleshooting

I get "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" when running the scaffold script

Your mysql server is not started.

  • On Mac OS: go to "System Preferences" -> "Mysql" -> "Start"
  • On any unix machine: $ mysqld &
After "5) Enter hostname for site" it prompts for "Enter password:"

You entered the incorrect password for your root user of the mysql database.

Try to figure out the correct password or reset it: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

Contributors

  • Johan Coppieters

  • Jonas Maes

  • Tim Coppieters

  • Dieter

  • Laurens

  • Jelle

  • devoidfury

  • Andretw

  • You? We are always happy to review and accept your issues/pull requests!

License

Copyright (c) 2012-2015 Johan Coppieters, Howest Brugge. See the LICENSE.md file for license rights and limitations. This project is licensed under the terms of the MIT license.

Johan Coppieters, Jonas Maes, Howest Brugge - Tim Coppieters, VUB.

Comments
  • New install fails to load

    New install fails to load

    I am testing Cody and install went smothless.

    Now I have a problem. I have started node with forever and in the web page I get error.

    Cody looks for the files in /mysite/mysite/ for some unknown reason.

    Error: Failed to lookup view "/home/ulf/Dokument/mysite/mysite/views/index.ejs" in views directory "/home/ulf/Dokument/mysite/views" at EventEmitter.app.render (/home/ulf/Dokument/mysite/node_modules/cody/node_modules/express/lib/application.js:555:17) at ServerResponse.res.render (/home/ulf/Dokument/mysite/node_modules/cody/node_modules/express/lib/response.js:938:7) at Application.renderView (/home/ulf/Dokument/mysite/node_modules/cody/apps/Application.js:354:15) at /home/ulf/Dokument/mysite/node_modules/cody/apps/Application.js:325:12 at Controller.doRequest (/home/ulf/Dokument/mysite/node_modules/cody/controllers/Controller.js:49:5) at Application.handToController (/home/ulf/Dokument/mysite/node_modules/cody/apps/Application.js:308:14) at Application.servePage (/home/ulf/Dokument/mysite/node_modules/cody/apps/Application.js:249:10) at /home/ulf/Dokument/mysite/node_modules/cody/startWebApp.js:40:15 at Layer.handle as handle_request at next (/home/ulf/Dokument/mysite/node_modules/cody/node_modules/express/lib/router/route.js:110:13)

    opened by faktaochkunskap 20
  • Unable to create a new site

    Unable to create a new site

    I was following the guidelines from here: http://cody-cms.org/en/install Each time am trying to use create_site.js I am getting this error in the last step:

    Creating project in  /Users/newscred/projects/personal/portfolio-ideations/portfolio-cody/
    
    1) Enter projectname: pfoliocms
    Note: also using pfoliocms as database name.
    Note: by default the mysql root user has no password so you can just hit enter, if you forgot the root password http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
    
    2) Enter root password for mysql so we can create a new database and user:
    
    3) Enter site database user: admin
    
    4) Enter site database password: mypassword
    
    5) Enter hostname for site: pfoliocms.local
    
    6) Enter a location for storing documents: ../../../../codydata
    
    /Users/newscred/node_modules/cody/node_modules/mysql/lib/protocol/Parser.js:77
            throw err; // Rethrow non-MySQL errors
            ^
    
    Error: ENOENT: no such file or directory, scandir '/Users/newscred/projects/personal/portfolio-ideations/portfolio-cody/node_modules/cody/doc/empty'
        at Error (native)
        at Object.fs.readdirSync (fs.js:808:18)
        at Query._callback (/Users/newscred/node_modules/cody/bin/create_site.js:123:24)
        at Query.Sequence.end (/Users/newscred/node_modules/cody/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
        at Query._handleFinalResultPacket (/Users/newscred/node_modules/cody/node_modules/mysql/lib/protocol/sequences/Query.js:144:8)
        at Query.OkPacket (/Users/newscred/node_modules/cody/node_modules/mysql/lib/protocol/sequences/Query.js:78:10)
        at Protocol._parsePacket (/Users/newscred/node_modules/cody/node_modules/mysql/lib/protocol/Protocol.js:280:23)
        at Parser.write (/Users/newscred/node_modules/cody/node_modules/mysql/lib/protocol/Parser.js:73:12)
        at Protocol.write (/Users/newscred/node_modules/cody/node_modules/mysql/lib/protocol/Protocol.js:39:16)
        at Socket.<anonymous> (/Users/newscred/node_modules/cody/node_modules/mysql/lib/Connection.js:96:28)
    

    Any idea?

    opened by dibosh 11
  • Do not create controllers

    Do not create controllers

    Error: ENOENT, no such file or directory 'd:\workspace\codydev\mysite\controller s' at Error (native) at Object.fs.readdirSync (fs.js:761:18) at Object. (d:\workspace\codydev\mysite.js:50:16) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:501:10) at startup (node.js:129:16) at node.js:814:3

    bug 
    opened by linksgo2011 9
  • Unable to install new site

    Unable to install new site

    Getting this when following the installation guid: mkdir /Users/Micke/Projects/codysites/codyTest/controllers mkdir /Users/Micke/Projects/codysites/codyTest/locales mkdir /Users/Micke/Projects/codysites/codyTest/static mkdir /Users/Micke/Projects/codysites/codyTest/static/css mkdir /Users/Micke/Projects/codysites/codyTest/static/images mkdir /Users/Micke/Projects/codysites/codyTest/static/js mkdir /Users/Micke/Projects/codysites/codyTest/views /Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/protocol/Parser.js:82 throw err; ^ Error: ER_INVALID_DEFAULT: Invalid default value for 'created' at Query.Sequence._packetToError (/Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/protocol/sequences/Sequence.js:48:14) at Query.ErrorPacket (/Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/protocol/sequences/Query.js:83:18) at Protocol._parsePacket (/Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/protocol/Protocol.js:274:23) at Parser.write (/Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/protocol/Parser.js:77:12) at Protocol.write (/Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/protocol/Protocol.js:39:16) at Socket. (/Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/Connection.js:96:28) at Socket.emit (events.js:107:17) at readableAddChunk (_stream_readable.js:163:16) at Socket.Readable.push (_stream_readable.js:126:10) at TCP.onread (net.js:538:20) -------------------- at Protocol._enqueue (/Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/protocol/Protocol.js:135:48) at Connection.query (/Users/Micke/Projects/codysites/node_modules/cody/node_modules/mysql/lib/Connection.js:201:25) at /Users/Micke/Projects/codysites/node_modules/cody/bin/create_site.js:130:27 at fs.js:334:14 at FSReqWrap.oncomplete (fs.js:95:15)

    opened by tjet-lw 7
  • { [Error: connect ECONNREFUSED] come after enter location of storing DOC.

    { [Error: connect ECONNREFUSED] come after enter location of storing DOC.

    Hello I trying to do these for testing but I face issue when doing your steps. here i attached one snapshot and check out what actually it's about.

    PFA 9-30-2015 3-33-22 pm

    opened by higunjan 6
  • Unable to login

    Unable to login

    Hi guys, I am trying Cody for a small personal project. I am able to run the website, but unable to login in the dashboard I am using the same user and password (codydev2) I put on the site creation, but I got login-failed

    2) Enter root password for mysql so we can create a new database and user: root
    
    3) Enter site database user: codydev2
    
    4) Enter site database password: codydev2
    
    5) Enter hostname for site: localhost
    
    6) Enter a location for storing documents: /mysql
    

    What could be the reason?

    opened by maufarinelli 4
  • When the user password is empty, this can lead to wrong password

    When the user password is empty, this can lead to wrong password

    In the Application.js file

    this.dbuser = config.dbuser || "cody"; this.dbpassword = config.dbpassword || "ydoc"; // When the user password is empty, this can lead to wrong password this.dbhost = config.dbhost || "localhost"; this.db = config.db || "cody"; this.smtp = config.smtp || "smtp.telenet.be"; this.smtpoptions = config.smtpoptions; // see https://github.com/andris9/Nodemailer this.mailFrom = config.mailFrom || "[email protected]";

    opened by linksgo2011 4
  • INDEX SUPPORT

    INDEX SUPPORT

    HI GUYS,

    I tried 2 start the index.js, However, when I go to "mysite.local:3001", it showed this error: Error: Failed to lookup view "/Users/WorkBitch/mycms/mysite/views/index.ejs" in views directory "/Users/WorkBitch/mycms/views" at EventEmitter.app.render (/Users/WorkBitch/mycms/node_modules/cody/node_modules/express/lib/application.js:555:17) at ServerResponse.res.render (/Users/WorkBitch/mycms/node_modules/cody/node_modules/express/lib/response.js:938:7) at Application.renderView (/Users/WorkBitch/mycms/node_modules/cody/apps/Application.js:354:15) at /Users/WorkBitch/mycms/node_modules/cody/apps/Application.js:325:12 at Controller.doRequest (/Users/WorkBitch/mycms/node_modules/cody/controllers/Controller.js:49:5) at Application.handToController (/Users/WorkBitch/mycms/node_modules/cody/apps/Application.js:308:14) at Application.servePage (/Users/WorkBitch/mycms/node_modules/cody/apps/Application.js:249:10) at /Users/WorkBitch/mycms/node_modules/cody/startWebApp.js:40:15 at Layer.handle as handle_request at next (/Users/WorkBitch/mycms/node_modules/cody/node_modules/express/lib/router/route.js:110:13)

    Can anyone help me with this? THX

    opened by Chris-Jukebox 4
  • User customized config

    User customized config

    I'm using this on Heroku. I just need to write a config_heroku.json and write "web: node index.js -c config_heroku.json" in Procfile. And the variables will be overridden by config_heroku.json. Thus, I don't need to set env variables or change any other stuff any more. I can test my cody-cms on localhost or heroku easily.

    enhancement 
    opened by andretw 4
  • How to Deploy ? :)

    How to Deploy ? :)

    Hi,

    I am trying to get the CMS deployed with no luck so far :)

    It seems the steps here are out dated ? http://www.cody-cms.org/en/install

    1. when I follow npm steps, i won't find a folder with name 'mysite' generated. should it be generated ?
    2. when I follow install from source code, It asks to import setup.sql but I cannot find it.

    Please kindly help :)

    enhancement 
    opened by elkhawajah 4
  • License?

    License?

    Is Cody available under a particular open source license? I have been looking for information about this on both your website and this GitHub repository but have been unable to find licensing information.

    Cody is fully open source. You can copy it, read the code, modify it, use it however you want. There is no fee, licence price.
    

    The above from your website homepage is the closest I could find as a sort of custom license, however that simply isn't good enough for my purposes. If Cody is already licensed under a particular open source license you may want to make it more obvious (such as adding it to the README.md and/or adding a license file in the root project directory) otherwise you may want to look into the common open source licenses and consider using one of them. Unfortunately a small blurb appearing solely on your website rather than in the project repository and therefore which could simply disappear at any time isn't going to be good enough for my purposes so I am forced to pass on Cody for now.

    enhancement 
    opened by jpeg 4
  • Use template-literal instead of EJS

    Use template-literal instead of EJS

    Template Literal is fastest, smallest and simplest template engine, because it use JS's literal template feature.

    It's 55 times faster than EJS, and it also use less CPU and RAM ressources, so it may be a good idea to use it instead of EJS 😀

    opened by Drulac 2
  • Forgot password

    Forgot password

    Add it to UserController.

    But first get the flow right: (any one has better idea's?)

    • In the login page, have a "tab" with "forget password"
    • accept email address,
    • look it up in the userlist,
    • generate (and save in user table) a url with a long random string + timestamp,
    • send it by email,
    • have a form to enter the new password,
    • check the random string against the user record + check if timestamp is not older than 1 day
    • change the password
    • log in
    opened by jcoppieters 2
  • Force project naming to comply with MySQL DB naming schema, or convert it

    Force project naming to comply with MySQL DB naming schema, or convert it

    I decided to test Cody and when asked for a project name I used "codeCms Test" then I got an error on DB creation because you cannot have spaces in MySQL DB names.

    This is the relevant output from create_site run:

    6) Enter a location for storing documents: doc
    
    { [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Test default charset utf8' at line 1]
      code: 'ER_PARSE_ERROR',
      errno: 1064,
      sqlState: '42000',
      index: 0 }
    { [Error: ER_NO_DB_ERROR: No database selected]
      code: 'ER_NO_DB_ERROR',
      errno: 1046,
      sqlState: '3D000',
      index: 0 }
    { [Error: ER_NO_DB_ERROR: No database selected]
      code: 'ER_NO_DB_ERROR',
      errno: 1046,
      sqlState: '3D000',
      index: 0 }
    mkdir /home/conan/csoft/test/codycms/codyCms Test/controllers
    mkdir /home/conan/csoft/test/codycms/codyCms Test/static
    mkdir /home/conan/csoft/test/codycms/codyCms Test/static/css
    mkdir /home/conan/csoft/test/codycms/codyCms Test/static/images
    mkdir /home/conan/csoft/test/codycms/codyCms Test/static/js
    mkdir /home/conan/csoft/test/codycms/codyCms Test/views
    /home/conan/csoft/test/codycms/node_modules/cody/bin/create_site.js:131
                            if (err) throw err;
                                           ^
    Error: ER_BAD_DB_ERROR: Unknown database 'codyCms Test'
    

    The fix is simple, but you have two options: force appropriate project naming, like npm init does, or let the creator to use any name but convert it so wherever it's used, it has the correct syntax.

    I'm inclined for the first option, but it's up to you.

    opened by fernandocanizo 1
  • Error: User.getUser failed with sql errors

    Error: User.getUser failed with sql errors

    This is the second time I have this error. It seems to happen after a while. Under development I am using forever with no time settings. So maybe something has stopped running. The front-end is still working.

    If I restart forever the problem is solved.

    Error: User.getUser failed with sql errors at Query._callback (/home/billgates/Dokument/ipro5/node_modules/cody/models/User.js:78:46) at Query.Sequence.end (/home/billgates/Dokument/ipro5/node_modules/cody/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24) at Protocol._validateEnqueue (/home/billgates/Dokument/ipro5/node_modules/cody/node_modules/mysql/lib/protocol/Protocol.js:218:6) at Protocol._enqueue (/home/billgates/Dokument/ipro5/node_modules/cody/node_modules/mysql/lib/protocol/Protocol.js:129:13) at Connection.query (/home/billgates/Dokument/ipro5/node_modules/cody/node_modules/mysql/lib/Connection.js:185:25) at Controller.query (/home/billgates/Dokument/ipro5/node_modules/cody/controllers/Controller.js:404:19) at Function.User.getUser (/home/billgates/Dokument/ipro5/node_modules/cody/models/User.js:77:16) at Controller.LoginController.tryLogin (/home/billgates/Dokument/ipro5/node_modules/cody/controllers/LoginController.js:90:13) at Controller.LoginController.doRequest (/home/billgates/Dokument/ipro5/node_modules/cody/controllers/LoginController.js:50:10) at Application.handToController (/home/billgates/Dokument/ipro5/node_modules/cody/apps/Application.js:308:14)

    enhancement 
    opened by faktaochkunskap 4
Owner
Johan Coppieters
Johan Coppieters
Business class content management for Node.js (plugins, server cluster management, data-driven pages)

PencilBlue A full featured Node.js CMS and blogging platform (plugins, server cluster management, data-driven pages) First and foremost: If at any poi

PencilBlue, LLC. 1.6k Dec 30, 2022
Calipso is a simple NodeJS content management system based on Express, Connect & Mongoose.

Calipso Calipso is a simple NodeJS content management system, built along similar themes to Drupal and Wordpress, that is designed to be fast, flexibl

Clifton Cunningham 1.7k Dec 21, 2022
Use the Google Drive API as a Content Management System

Google Drive CMS This shared Google Drive folder serves as the backend for this sample webpage. Quick links: Github / NPM / Dockerhub / Heroku NPM npm

Nathan Babcock 40 Nov 22, 2022
The most powerful headless CMS for Node.js — built with GraphQL and React

A scalable platform and CMS to build Node.js applications. schema => ({ GraphQL, AdminUI }) Keystone Next is a preview of the next major release of Ke

KeystoneJS 7.3k Dec 31, 2022
Reaction is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.

Reaction Commerce Reaction is a headless commerce platform built using Node.js, React, and GraphQL. It plays nicely with npm, Docker and Kubernetes. G

Reaction Commerce 11.9k Jan 3, 2023
👻 The #1 headless Node.js CMS for professional publishing

Ghost.org | Features | Showcase | Forum | Docs | Contributing | Twitter Love open source? We're hiring Node.js Engineers to work on Ghost full-time Th

Ghost 42.1k Jan 5, 2023
ApostropheCMS is a full-featured, open-source CMS built with Node.js that seeks to empower organizations by combining in-context editing and headless architecture in a full-stack JS environment.

ApostropheCMS ApostropheCMS is a full-featured, open source CMS built with Node.js that seeks to empower organizations by combining in-context editing

Apostrophe Technologies 3.9k Jan 4, 2023
We.js, extensible Node.js MVC framework - CLI

We.js ;) We.js is a extensible node.js MVC framework For information and documentation see: http://wejs.org This repository (wejs/we) have the We.js C

We.js 208 Nov 10, 2022
A Node.js CMS written in CoffeeScript, with a user friendly backend

Nodizecms A Node.js CMS written in CoffeeScript, with a user friendly backend Status NodizeCMS is still under heavy development, there's a ton of unim

Nodize CMS 176 Sep 24, 2022
🚀 Open source Node.js Headless CMS to easily build customisable APIs

API creation made simple, secure and fast. The most advanced open-source headless CMS to build powerful APIs with no effort. Try live demo Strapi is a

strapi 50.8k Dec 27, 2022
👻 The #1 headless Node.js CMS for professional publishing

Ghost.org | Features | Showcase | Forum | Docs | Contributing | Twitter Love open source? We're hiring Node.js Engineers to work on Ghost full-time Th

Ghost 37k Apr 5, 2021
ApostropheCMS is a full-featured, open-source CMS built with Node.js that seeks to empower organizations by combining in-context editing and headless architecture in a full-stack JS environment.

ApostropheCMS ApostropheCMS is a full-featured, open source CMS built with Node.js that seeks to empower organizations by combining in-context editing

Apostrophe Technologies 3.9k Jan 4, 2023
Minimalistic, lean & mean, node.js cms

enduro.js Enduro is minimalistic, lean & mean, node.js cms. See more at enduro.js website Other repositories: Enduro • samples • Enduro admin • enduro

Martin Gottweis 688 Dec 31, 2022
We.js, extensible Node.js MVC framework - CLI

We.js ;) We.js is a extensible node.js MVC framework For information and documentation see: http://wejs.org This repository (wejs/we) have the We.js C

We.js 208 Nov 10, 2022
AdminBro is an admin panel for apps written in node.js

Admin Bro AdminBro is An automatic admin interface which can be plugged into your application. You, as a developer, provide database models (like post

Software Brothers 6.5k Jan 2, 2023
A Node.js Express backend for a Stackoverflow like answering forum, with RESTful endpoints

A Node.js Express backend for a Stackoverflow like answering forum, with RESTful endpoints, written in es6 style with linted and comprehensively unit-tested code. Utilizes a local json database using fs but has full separation of concern to implement anything else.

Dhiman Seal 3 Jan 9, 2022
Javascript Content Management System running on Node.js

Cody CMS A Javascript Content Management System running on Node.js We finally took upon the task, we are happy to announce the transition to Express 4

Johan Coppieters 669 Oct 31, 2022
The LMS (Life Management System) is a free tool for personal knowledge management and goal management based on Obsidian.md.

README Documentation | 中文帮助 The LMS (Life Management System) is a tool for personal knowledge management and goal management based on Obsidian.md. It

null 27 Dec 21, 2022
Business class content management for Node.js (plugins, server cluster management, data-driven pages)

PencilBlue A full featured Node.js CMS and blogging platform (plugins, server cluster management, data-driven pages) First and foremost: If at any poi

PencilBlue, LLC. 1.6k Dec 30, 2022
Business class content management for Node.js (plugins, server cluster management, data-driven pages)

PencilBlue A full featured Node.js CMS and blogging platform (plugins, server cluster management, data-driven pages) First and foremost: If at any poi

PencilBlue, LLC. 1.6k Dec 30, 2022