{"id":17123730,"url":"https://github.com/plaristote/crails","last_synced_at":"2025-04-13T05:53:38.692Z","repository":{"id":7628045,"uuid":"8987507","full_name":"Plaristote/crails","owner":"Plaristote","description":"The Crails Framework for C++ MVC development of web applications.","archived":false,"fork":false,"pushed_at":"2022-10-24T17:23:58.000Z","size":2121,"stargazers_count":39,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-13T05:53:34.281Z","etag":null,"topics":["boost","mvc","odb","webframework"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Plaristote.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-24T14:39:41.000Z","updated_at":"2024-09-14T09:22:42.000Z","dependencies_parsed_at":"2023-01-11T19:15:48.616Z","dependency_job_id":null,"html_url":"https://github.com/Plaristote/crails","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Plaristote%2Fcrails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Plaristote%2Fcrails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Plaristote%2Fcrails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Plaristote%2Fcrails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Plaristote","download_url":"https://codeload.github.com/Plaristote/crails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670502,"owners_count":21142901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boost","mvc","odb","webframework"],"created_at":"2024-10-14T18:27:04.565Z","updated_at":"2025-04-13T05:53:38.667Z","avatar_url":"https://github.com/Plaristote.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Crails has moved\n======\n/!\\ This repository has been moved and split to [https://github.com/crails-framework](https://github.com/crails-framework).\nThe v2 of the framework has moved from cpp-netlib to boost.beast and no longer relies on Ruby for file generation and build management.\nMany modules have been added, through the refactoring of all the projects I've developed using this framework: support for ssh, oauth,\ndeployment tools, etc.\n\nThis repository will no longer be maintained.\n\nCrails\n======\nCrails Framework is an MVC web development framework aiming to bring a Rails-like experience to C++\ndevelopers. Despite being inspired by Ruby on Rails, it is much lighter and simpler.\n\nIt's a cpp-netlib based HTTP server using a routing system, MVC design, C++-compiled templates, asset\nprecompilation and database abstraction.\n\nCrails is modular, and comes by default with a bunch of modules:\n- With crails-html and crails-json, you have the ability to write templates that are then compiled into C++\n- With crails-mongodb and crails-odb, you get an object oriented database abstraction\n- With crails-cache, you get a simple API to handle your caching using memcached\n- With crails-mail, you get the ability to easily render and send mails\n- With crails-image, you can store image in your models, and use Magick++ to generate thumbnails\n- With crails-sentry, you can monitor server exceptions using [Sentry](http://sentry.io)\n\nInstall Crails Framework\n========\nCompiling\n--------\nThis project has been compiled using `gcc 4.9`. It should support `clang` as well, though this support is not actively maintained for now.\n\nHere's a list of the dependecies:\n- ruby \u003e= 1.9 (development only)\n- cpp-netlib\n- segvcatch (optional)\n- [ODB](http://www.codesynthesis.com/products/odb/) (optional, used by crails-odb)\n- [mongo-cxx-driver](https://github.com/mongodb/mongo-cxx-driver/tree/legacy) (optional, used by crail-mongodb)\n- [libmemcached](http://libmemcached.org) (optional, used by crails-cache)\n- [Magick++](http://www.imagemagick.org/Magick++/) (optional, used by crails-image)\n\nMacOSX users: this project requires the `thread_local` feature from C++11, which isn't available on Apple's clang.\n\nBuilding the Crails Framework\n--------\nTo the root of the project's directory, create a build directory, go in there, and once again, type:\n\n    cmake ..\n    make\n    sudo make install\n\nWhen the developer mode is on, the Crails Framework provides a number of tools (disabled caching of assets, using renderers to display exceptions) that you simply need while working on a Crails application. On your development machine, you would want to compile the framework with this command line:\n\n    cmake -DDEVELOPER_MODE=ON\n\nDeveloper and Production server do not conflict: you may want to compile the project twice, with and without the developer mode option, which would give you the ability to swap between developer and production mode simply by changing the CMAKE_BUILD_TYPE variable to Release or Debug in your project's CMakeCache.txt.\n\nThere are two types of server available: aysnchronous and synchronous. To compile one or the other, use the `-DUSE_MULTITHREAD=[ON|OFF]` option with cmake.\n\nIf you want to swap between environments, make sure you have installed every flavour of Crails that you are going to use.\n\nWalkthrough\n=======\nThe Crails Framework comes with the `crails` command, which is a Ruby toolset giving you a large set of commands to create and manage your application.\nThe first step you'll have to go through is the creation of your application:\n\n    crails new my_crails_app\n\nThis will generate all the necessary files in the folder `./my_crails_app`.\nOnce you've done that, the next thing you should do is pick which modules from crails you are going to be using. To do that, use the `crails module` command.\n\n    cd my_crails_app\n    crails module # lists the available modules\n    crails module html install\n    crails module mongodb install\n\nAt any point, you may also change some of the framework internal settings, using `crails set-env`:\n\n    # disable development mode\n    crails set-env production\n    # enable development mode\n    crails set-env development\n\nOnce your application is created and configured, you may launch the `crails guard` tool. It has several applications:\n  - The task `assets` compiles your javascript and stylesheet assets;\n  - The task `before_compile` generates code for modules that need it (crails-html, crails-json, ...);\n  - The task `compile` compiles your code and run the tests;\n  - It watches your files to automatically re-run the tasks when needed;\n\nHere's how you'd use `crails guard`:\n\n    crails guard # launches the guard shell\n    guard\u003e assets\n    guard\u003e before_compile\n    guard\u003e compile\n\nNow that everything is ready, you may launch your server by running the binary:\n\n    build/server -p 8080 -h 0.0.0.0\n\nNote that by defaults, the server binds to port 3001 and host 127.0.0.1.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaristote%2Fcrails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaristote%2Fcrails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaristote%2Fcrails/lists"}