Decko (formerly "Wagn") makes elegant web development fun.
Install a new deck, and you can immediately open a browser and start collaborating on content, design, and structure. Decko creators, or "Card Sharks", use Decko to create open community sites, private knowledge management sites, project management systems, wikis, blogs, journals, forums, and more.
Ruby developers can take these creations even further with Decko's development framework. As a Decko "Monkey", you can use the innovative Mods API to create sophisticated web systems that integrate seamlessly with structures that "Sharks" create on the site.
Installation help is below. And there's lots of info at Decko.org, including:
And info about contributing to Decko is right next door.
On our docs site:
Elsewhere on Github:
We also have API Docs on Swaggerhub.
requirement | variants |
---|---|
Ruby | 2.5+ |
Bundler | 1.0+ |
ImageMagick | 6.7.8+ |
A database engine | MySQL (5.7+) or PostgreSQL (9.4+) |
A JavaScript runtime | Node.js (8.9+) or other |
gem install decko
Watch carefully for errors!
decko new MY_DECK
MY_DECK
is, of course, a variable. Use any name you like.
Options:
-f, [--force] # Overwrite files that already exist
-p, [--pretend], [--no-pretend] # Run but do not make any changes
-q, [--quiet], [--no-quiet] # Suppress status output
-s, [--skip], [--no-skip] # Skip files that already exist
-M, [--monkey], [--no-monkey] # Prepare deck for monkey (mod developer)
-P, [--platypus], [--no-core-dev] # Prepare deck for platypus (core developer)
-R, [--repo-path=PATH] # Path to local decko repository.
# Can also specify via `env DECKO_REPO_PATH=PATH`
-I, [--interactive], [--no-interactive] # Prompt with dynamic installation options
Edit the config/database.yml file as necessary. More about database configuration at https://www.decko.org/database_configuration.
Then run
cd MY_DECK
decko setup
..to create and seed the database
Options:
-p, --production decko:seed production database (default)
-t, --test decko:seed test database
-d, --development decko:seed development database
-a, --all decko:seed production, test, and development database
To fire up the default, built-in WEBrick server, just run:
decko server
...and point your browser to http://localhost:3000 (unless otherwise configured).
Options:
-p, [--port=port] # Runs Decko on the specified port.
Defaults to 3000.
-b, [--binding=IP] # Binds Decko to the specified IP.
Defaults to 'localhost' in development
and '0.0.0.0' in other environments'.
-c, [--config=file] # Uses a custom rackup configuration.
Default is config.ru.
-d, [--daemon], [--no-daemon] # Runs server as a Daemon.
-e, [--environment=name] # Specifies the environment in which to run
this server (development/test/production).
-P, [--pid=PID] # Specifies the PID file.
Default is tmp/pids/server.pid.
[--early-hints], [--no-early-hints] # Enables HTTP/2 early hints.
For more information, see https://decko.org/get_started.
Always back up your database and uploaded files.
From your decko root directory run:
bundle update
Run the following:
decko update
If you have an old site (pre 2018), haven't upgraded in a long time, and see many references to "Wagn" in your deck, you may need to do a more involved update.
In your decko's root directory, edit Gemfile
, config/application.rb
,
config/routes.rb
, and script/wagn
, replacing "wagn" with "decko". (Keep the
same capitalization pattern.)
From your decko root directory run:
mv script/wagn script/decko
See above.
First check the Wagn version of your existing site.
- Create a new deck using steps 1 and 2 from the installation section above.
- Copy
config/database.yml
from the old site to the new one. - Copy the old
local/files
contents to the newfiles
directory. - If you have edited
wagn.yml
in your old site, make the corresponding changes to the newconfig/application.rb
file. - Follow the standard upgrade procedure above.
Ho. Ly. Cow. Welcome back!
First update your Wagn to version 1.10 via the old update mechanisms, and then follow the directions above.
Mods are little bits of code that alter Decko behavior.
Many mods have been made into ruby gems that follow the naming pattern card-mod-X
.
All you have to do to install one of these mods is:
gem "card-mod-mymod"
bundle update
decko update
...and then restart your server.
If you're interested in making your own mod, the first thing to do is set up a good
development environment. This is most easily done by creating a new deck with the
--monkey
(or -M
) options, eg:
decko new MY_DECK --monkey
If you're working on an existing deck, it's often easiest just to do the above and then make the new deck use your existing files and database. However, if that's not an option, you can instead follow the following procedure:
- Make sure you have all the monkey-friendly gems in your Gemfile. If your deck was generated recently, you'll probably already have several references to these gems (eg card-mod-monkey) and will just need to uncomment them. If not, you can run the above command to create a dummy deck and copy the Gemfile over to your real one.
- In your real deck, comment out
ENV['RAILS_ENV'] ||= 'production'
inconfig/boot.rb
. This will mean your default mode is now "development." - Configure
config/database.yml
to your liking.