├── .gitignore ├── README.md ├── cockpit ├── docker │ ├── docker-compose.yml │ └── docker-sync.yml ├── example │ ├── collections │ │ ├── banner.collection.php │ │ ├── basicpage.collection.php │ │ ├── carousel.collection.php │ │ ├── columns.collection.php │ │ ├── faq.collection.php │ │ ├── googlemap.collection.php │ │ ├── quote.collection.php │ │ ├── rules │ │ │ ├── banner.create.php │ │ │ ├── banner.delete.php │ │ │ ├── banner.read.php │ │ │ ├── banner.update.php │ │ │ ├── basicpage.create.php │ │ │ ├── basicpage.delete.php │ │ │ ├── basicpage.read.php │ │ │ ├── basicpage.update.php │ │ │ ├── carousel.create.php │ │ │ ├── carousel.delete.php │ │ │ ├── carousel.read.php │ │ │ ├── carousel.update.php │ │ │ ├── columns.create.php │ │ │ ├── columns.delete.php │ │ │ ├── columns.read.php │ │ │ ├── columns.update.php │ │ │ ├── faq.create.php │ │ │ ├── faq.delete.php │ │ │ ├── faq.read.php │ │ │ ├── faq.update.php │ │ │ ├── googlemap.create.php │ │ │ ├── googlemap.delete.php │ │ │ ├── googlemap.read.php │ │ │ ├── googlemap.update.php │ │ │ ├── quote.create.php │ │ │ ├── quote.delete.php │ │ │ ├── quote.read.php │ │ │ ├── quote.update.php │ │ │ ├── showmore.create.php │ │ │ ├── showmore.delete.php │ │ │ ├── showmore.read.php │ │ │ ├── showmore.update.php │ │ │ ├── simpleblock.create.php │ │ │ ├── simpleblock.delete.php │ │ │ ├── simpleblock.read.php │ │ │ ├── simpleblock.update.php │ │ │ ├── table.create.php │ │ │ ├── table.delete.php │ │ │ ├── table.read.php │ │ │ ├── table.update.php │ │ │ ├── text.create.php │ │ │ ├── text.delete.php │ │ │ ├── text.read.php │ │ │ └── text.update.php │ │ ├── showmore.collection.php │ │ ├── simpleblock.collection.php │ │ ├── table.collection.php │ │ └── text.collection.php │ ├── config │ │ └── config.yaml │ ├── data │ │ ├── .htaccess │ │ ├── cockpit.sqlite │ │ ├── collections.sqlite │ │ └── index.html │ └── uploads │ │ ├── 2018 │ │ ├── 01 │ │ │ ├── 23 │ │ │ │ ├── 5a67b2b3542fbfire.jpg │ │ │ │ ├── 5a67b2b3720e0tree.jpg │ │ │ │ ├── 5a67b2b38ed77kayaker.jpg │ │ │ │ └── 5a67b2b3a9abdmountains.jpg │ │ │ ├── 30 │ │ │ │ ├── 5a70f36d293ffdummy-454x280-Glass.jpg │ │ │ │ └── 5a70f7023b738pexels-photo-325185.jpeg │ │ │ └── 31 │ │ │ │ ├── 5a710e3dec77fpexels-photo-373076.jpeg │ │ │ │ ├── 5a710f6c4b00b0.jpg │ │ │ │ ├── 5a710f6c63fb060.jpg │ │ │ │ ├── 5a710f6c7a48c32.jpg │ │ │ │ ├── 5a710f6c95abe80.jpg │ │ │ │ ├── 5a710f6cadc3d91.jpg │ │ │ │ ├── 5a710f6cc4a5f46.jpg │ │ │ │ ├── 5a710f6cde43290.jpg │ │ │ │ ├── 5a710f6d0237981.jpg │ │ │ │ ├── 5a71197ff0ee2html5-2-2.png │ │ │ │ ├── 5a71198012e6fdocker2.png │ │ │ │ ├── 5a711980224a1jira_icon_colour.png │ │ │ │ ├── 5a71198030a42mulesoft2.png │ │ │ │ └── 5a7119803e6c4drupal2.png │ │ └── 02 │ │ │ └── 01 │ │ │ └── 5a738cc976931docker2.png │ │ └── index.html ├── install.sh ├── start.sh └── stop.sh └── react ├── .env.local ├── .env.production ├── .eslintrc ├── .gitignore ├── .prettierrc ├── .snyk ├── README.md ├── package.json ├── public ├── favicon.ico ├── index.html └── manifest.json ├── src ├── App.js ├── App.test.js ├── components │ ├── Banner │ │ ├── Banner.js │ │ └── index.js │ ├── Carousel │ │ ├── Carousel.js │ │ └── index.js │ ├── ColumnsBlock │ │ ├── ColumnsBlock.js │ │ └── index.js │ ├── Faq │ │ ├── Faq.js │ │ └── index.js │ ├── Footer │ │ ├── Footer.js │ │ └── index.js │ ├── GoogleMap │ │ ├── GoogleMap.js │ │ └── index.js │ ├── NavigationBar │ │ ├── NavigationBar.css │ │ ├── NavigationBar.js │ │ ├── Sidebar.js │ │ └── index.js │ ├── Quote │ │ ├── Quote.js │ │ └── index.js │ ├── ShowMore │ │ ├── ShowMore.js │ │ └── index.js │ ├── SimpleBlock │ │ ├── SimpleBlock.js │ │ └── index.js │ ├── TextBlock │ │ ├── TextBlock.js │ │ └── index.js │ └── index.js ├── containers │ ├── BasicPage │ │ ├── BasicPage.js │ │ ├── Components.js │ │ ├── SubHeader.js │ │ └── index.js │ ├── Main │ │ ├── Main.js │ │ └── index.js │ ├── PageNotFound │ │ ├── PageNotFound.js │ │ └── index.js │ └── index.js ├── index.css ├── index.js ├── logo.svg ├── modules │ ├── index.js │ └── pages.js ├── mui.js ├── registerServiceWorker.js ├── store.js └── utils.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /react/node_modules 5 | 6 | # testing 7 | /react/coverage 8 | 9 | # production 10 | /react/build 11 | 12 | # misc 13 | .DS_Store 14 | # .env.local 15 | # .env.development.local 16 | # .env.test.local 17 | # .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | 23 | cockpit/www 24 | cockpit/docker/.docker-sync 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Example Cockpit CMS/React Headless website 2 | 3 | An example project that provides a simple headless experience by combining Cockpit CMS and ReactJS. 4 | 5 | Example site can be accessed on [http://pauloamgomes.github.io/cockpit-react-example](http://pauloamgomes.github.io/cockpit-react-example) 6 | 7 | ## Installation 8 | 9 | First confirm that you have [docker](https://www.docker.com) and [docker-sync](http://docker-sync.io) installed on your system. 10 | 11 | 1. Clone this repo or [download it as a zip file](https://github.com/pauloamgomes/cockpit-react-example/archive/master.zip) and extract it. 12 | 2. Run the Cockpit Example install script inside cockpit folder: 13 | ``` 14 | $ cd cockpit-react-example/cockpit 15 | $ ./install.sh 16 | ``` 17 | it shall initialize the Cockpit CMS with example data 18 | 3. Install React dependencies 19 | ``` 20 | $ cd cockpit-react-example/react 21 | $ yarn install 22 | ``` 23 | 24 | ## Usage 25 | 26 | The example consists on a Cockpit CMS installation with example data and a ReactJS application that will consume Cockpit CMS data. 27 | In way to use it just run the following commands. 28 | 29 | 1. Start the Cockpit CMS docker instance 30 | ``` 31 | $ cd cockpit-react-example/cockpit 32 | $ ./start.sh 33 | ``` 34 | 2. Start the React App 35 | ``` 36 | $ cd cockpit-react-example/react 37 | $ yarn start 38 | ``` 39 | 3. Open Cockpit CMS admin interface at http://cockpit-example.docker.localhost/ 40 | 41 | Username: admin 42 | Password: admin 43 | 44 | 4. Open the example React App at http://localhost:3000/ 45 | 46 | 47 | The url http://cockpit-example.docker.localhost/ should be accessible form your browser as the docker-compose uses Traefik, however if not, add it to your /etc/hosts file: 48 | 49 | ``` 50 | $ sudo echo "127.0.0.1 cockpit-example.docker.localhost" >> /etc/hosts 51 | ``` 52 | 53 | ## Copyright and license 54 | 55 | Copyright 2018 pauloamgomes under the MIT license. 56 | 57 | 58 | -------------------------------------------------------------------------------- /cockpit/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | cockpit-example-php: 5 | image: wodby/php:7.1 6 | environment: 7 | PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025 8 | PHP_FPM_CLEAR_ENV: "no" 9 | volumes: 10 | - cockpit-example-sync:/var/www/html:nocopy 11 | 12 | cockpit-example-nginx: 13 | image: wodby/php-nginx:1.13 14 | depends_on: 15 | - cockpit-example-php 16 | environment: 17 | NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off" 18 | NGINX_ERROR_LOG_LEVEL: error 19 | NGINX_BACKEND_HOST: cockpit-example-php 20 | NGINX_SERVER_ROOT: /var/www/html 21 | volumes: 22 | - cockpit-example-sync:/var/www/html:nocopy 23 | labels: 24 | - 'traefik.backend=nginx' 25 | - 'traefik.port=80' 26 | - 'traefik.frontend.rule=Host:cockpit-example.docker.localhost' 27 | 28 | cockpit-example-mailhog: 29 | image: mailhog/mailhog 30 | labels: 31 | - 'traefik.backend=mailhog' 32 | - 'traefik.port=8025' 33 | - 'traefik.frontend.rule=Host:mailhog.cockpit-example.docker.localhost' 34 | 35 | cockpit-example-traefik: 36 | image: traefik 37 | command: -c /dev/null --web --docker --logLevel=INFO 38 | ports: 39 | - '80:80' 40 | volumes: 41 | - /var/run/docker.sock:/var/run/docker.sock 42 | 43 | volumes: 44 | cockpit-example-sync: 45 | external: true 46 | -------------------------------------------------------------------------------- /cockpit/docker/docker-sync.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | options: 4 | verbose: true 5 | 6 | syncs: 7 | cockpit-example-sync: 8 | src: '../www' 9 | sync_userid: '82' 10 | sync_prefer: 'default' 11 | sync_excludes: ['.gitignore', '.git/', '.idea/', '.DS_Store', 'node_modules'] 12 | -------------------------------------------------------------------------------- /cockpit/example/collections/banner.collection.php: -------------------------------------------------------------------------------- 1 | 'banner', 4 | 'label' => 'Banner', 5 | '_id' => 'banner5a70f1cfbf4ca', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'name', 11 | 'label' => 'Name', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | ), 19 | 'width' => '1-1', 20 | 'lst' => true, 21 | 'required' => true, 22 | ), 23 | 1 => 24 | array ( 25 | 'name' => 'title', 26 | 'label' => 'Title', 27 | 'type' => 'set', 28 | 'default' => '', 29 | 'info' => '', 30 | 'group' => '', 31 | 'localize' => false, 32 | 'options' => 33 | array ( 34 | 'fields' => 35 | array ( 36 | 0 => 37 | array ( 38 | 'name' => 'text', 39 | 'type' => 'text', 40 | ), 41 | 1 => 42 | array ( 43 | 'name' => 'color', 44 | 'type' => 'color', 45 | ), 46 | ), 47 | ), 48 | 'width' => '1-2', 49 | 'lst' => true, 50 | 'acl' => 51 | array ( 52 | ), 53 | ), 54 | 2 => 55 | array ( 56 | 'name' => 'heading', 57 | 'label' => '', 58 | 'type' => 'set', 59 | 'default' => '', 60 | 'info' => '', 61 | 'group' => '', 62 | 'localize' => false, 63 | 'options' => 64 | array ( 65 | 'fields' => 66 | array ( 67 | 0 => 68 | array ( 69 | 'name' => 'text', 70 | 'type' => 'text', 71 | ), 72 | 1 => 73 | array ( 74 | 'name' => 'color', 75 | 'type' => 'color', 76 | ), 77 | ), 78 | ), 79 | 'width' => '1-2', 80 | 'lst' => true, 81 | 'acl' => 82 | array ( 83 | ), 84 | ), 85 | 3 => 86 | array ( 87 | 'name' => 'image', 88 | 'label' => 'Banner Image', 89 | 'type' => 'image', 90 | 'default' => '', 91 | 'info' => '', 92 | 'group' => '', 93 | 'localize' => false, 94 | 'options' => 95 | array ( 96 | 'meta' => 97 | array ( 98 | 'title' => 99 | array ( 100 | 'type' => 'text', 101 | 'label' => 'Title', 102 | ), 103 | 'alt' => 104 | array ( 105 | 'type' => 'text', 106 | 'label' => 'Alt', 107 | ), 108 | ), 109 | ), 110 | 'width' => '1-1', 111 | 'lst' => true, 112 | 'acl' => 113 | array ( 114 | ), 115 | 'required' => true, 116 | ), 117 | ), 118 | 'sortable' => false, 119 | 'in_menu' => false, 120 | '_created' => 1517351375, 121 | '_modified' => 1518912279, 122 | 'color' => '#AC92EC', 123 | 'acl' => 124 | array ( 125 | ), 126 | 'rules' => 127 | array ( 128 | 'create' => 129 | array ( 130 | ), 131 | 'read' => 132 | array ( 133 | ), 134 | 'update' => 135 | array ( 136 | ), 137 | 'delete' => 138 | array ( 139 | ), 140 | ), 141 | 'icon' => 'photo.svg', 142 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/basicpage.collection.php: -------------------------------------------------------------------------------- 1 | 'basicpage', 4 | 'label' => 'Basic Page', 5 | '_id' => 'basicpage5a613d518cf05', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'title', 11 | 'label' => 'Title', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | 'slug' => true, 19 | 'maxlength' => 60, 20 | 'minlength' => 5, 21 | 'required' => true, 22 | ), 23 | 'width' => '1-1', 24 | 'lst' => true, 25 | 'required' => true, 26 | ), 27 | 1 => 28 | array ( 29 | 'name' => 'published', 30 | 'label' => 'Published', 31 | 'type' => 'boolean', 32 | 'default' => '', 33 | 'info' => '', 34 | 'localize' => false, 35 | 'options' => 36 | array ( 37 | 'default' => false, 38 | 'label' => false, 39 | ), 40 | 'width' => '1-4', 41 | 'lst' => true, 42 | ), 43 | 2 => 44 | array ( 45 | 'name' => 'menu', 46 | 'label' => 'Visible on menu', 47 | 'type' => 'boolean', 48 | 'default' => '', 49 | 'info' => '', 50 | 'group' => '', 51 | 'localize' => false, 52 | 'options' => 53 | array ( 54 | 'label' => false, 55 | ), 56 | 'width' => '1-4', 57 | 'lst' => true, 58 | 'acl' => 59 | array ( 60 | ), 61 | ), 62 | 3 => 63 | array ( 64 | 'name' => 'subheading', 65 | 'label' => 'Subheading', 66 | 'type' => 'boolean', 67 | 'default' => '', 68 | 'info' => '', 69 | 'group' => '', 70 | 'localize' => false, 71 | 'options' => 72 | array ( 73 | ), 74 | 'width' => '1-4', 75 | 'lst' => true, 76 | 'acl' => 77 | array ( 78 | ), 79 | ), 80 | 4 => 81 | array ( 82 | 'name' => 'components', 83 | 'label' => 'Components', 84 | 'type' => 'multiplecollectionlink', 85 | 'default' => '', 86 | 'info' => 'Select components to use on that page', 87 | 'group' => '', 88 | 'localize' => false, 89 | 'options' => 90 | array ( 91 | 'links' => 92 | array ( 93 | 0 => 94 | array ( 95 | 'name' => 'banner', 96 | 'display' => 'name', 97 | ), 98 | 1 => 99 | array ( 100 | 'name' => 'carousel', 101 | 'display' => 'name', 102 | ), 103 | 2 => 104 | array ( 105 | 'name' => 'showmore', 106 | 'display' => 'name', 107 | ), 108 | 3 => 109 | array ( 110 | 'name' => 'faq', 111 | 'display' => 'name', 112 | ), 113 | 4 => 114 | array ( 115 | 'name' => 'simpleblock', 116 | 'display' => 'name', 117 | ), 118 | 5 => 119 | array ( 120 | 'name' => 'quote', 121 | 'display' => 'name', 122 | ), 123 | 6 => 124 | array ( 125 | 'name' => 'googlemap', 126 | 'display' => 'name', 127 | ), 128 | 7 => 129 | array ( 130 | 'name' => 'text', 131 | 'display' => 'name', 132 | ), 133 | 8 => 134 | array ( 135 | 'name' => 'columns', 136 | 'display' => 'name', 137 | ), 138 | ), 139 | 'limit' => false, 140 | ), 141 | 'width' => '1-1', 142 | 'lst' => true, 143 | 'acl' => 144 | array ( 145 | ), 146 | ), 147 | ), 148 | 'sortable' => true, 149 | 'in_menu' => false, 150 | '_created' => 1516322129, 151 | '_modified' => 1518828697, 152 | 'color' => '', 153 | 'acl' => 154 | array ( 155 | 'public' => 156 | array ( 157 | 'entries_view' => true, 158 | ), 159 | ), 160 | 'rules' => 161 | array ( 162 | 'create' => 163 | array ( 164 | ), 165 | 'read' => 166 | array ( 167 | ), 168 | 'update' => 169 | array ( 170 | ), 171 | 'delete' => 172 | array ( 173 | ), 174 | ), 175 | 'contentpreview' => 176 | array ( 177 | 'enabled' => true, 178 | ), 179 | 'icon' => 'module.svg', 180 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/carousel.collection.php: -------------------------------------------------------------------------------- 1 | 'carousel', 4 | 'label' => 'Carousel', 5 | '_id' => 'carousel5a614094ed198', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'name', 11 | 'label' => 'Name', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | ), 19 | 'width' => '1-1', 20 | 'lst' => true, 21 | 'required' => true, 22 | ), 23 | 1 => 24 | array ( 25 | 'name' => 'title', 26 | 'label' => 'Title', 27 | 'type' => 'text', 28 | 'default' => '', 29 | 'info' => '', 30 | 'group' => '', 31 | 'localize' => false, 32 | 'options' => 33 | array ( 34 | ), 35 | 'width' => '1-1', 36 | 'lst' => true, 37 | 'acl' => 38 | array ( 39 | ), 40 | 'required' => true, 41 | ), 42 | 2 => 43 | array ( 44 | 'name' => 'images', 45 | 'label' => 'Images', 46 | 'type' => 'gallery', 47 | 'default' => '', 48 | 'info' => '', 49 | 'group' => '', 50 | 'localize' => false, 51 | 'options' => 52 | array ( 53 | 'meta' => 54 | array ( 55 | 'title' => 56 | array ( 57 | 'type' => 'text', 58 | 'label' => 'Title', 59 | ), 60 | 'details' => 61 | array ( 62 | 'type' => 'text', 63 | 'label' => 'Details', 64 | ), 65 | 'alt' => 66 | array ( 67 | 'type' => 'text', 68 | 'label' => 'Alt', 69 | ), 70 | 'desc' => 71 | array ( 72 | 'type' => 'text', 73 | 'label' => 'Description', 74 | ), 75 | ), 76 | ), 77 | 'width' => '1-1', 78 | 'lst' => true, 79 | 'acl' => 80 | array ( 81 | ), 82 | 'required' => true, 83 | ), 84 | ), 85 | 'sortable' => false, 86 | 'in_menu' => false, 87 | '_created' => 1516322964, 88 | '_modified' => 1517830267, 89 | 'color' => '#AC92EC', 90 | 'acl' => 91 | array ( 92 | ), 93 | 'rules' => 94 | array ( 95 | 'create' => 96 | array ( 97 | ), 98 | 'read' => 99 | array ( 100 | ), 101 | 'update' => 102 | array ( 103 | ), 104 | 'delete' => 105 | array ( 106 | ), 107 | ), 108 | 'icon' => 'gallery.svg', 109 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/columns.collection.php: -------------------------------------------------------------------------------- 1 | 'columns', 4 | 'label' => 'Columns Block', 5 | '_id' => 'columns5a877b8813bc1', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'name', 11 | 'label' => '', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'group' => '', 16 | 'localize' => false, 17 | 'options' => 18 | array ( 19 | ), 20 | 'width' => '1-1', 21 | 'lst' => true, 22 | 'acl' => 23 | array ( 24 | ), 25 | ), 26 | 1 => 27 | array ( 28 | 'name' => 'column1', 29 | 'label' => 'Column 1', 30 | 'type' => 'set', 31 | 'default' => '', 32 | 'info' => '', 33 | 'group' => 'Column 1', 34 | 'localize' => false, 35 | 'options' => 36 | array ( 37 | 'fields' => 38 | array ( 39 | 0 => 40 | array ( 41 | 'name' => 'title', 42 | 'type' => 'text', 43 | ), 44 | 1 => 45 | array ( 46 | 'name' => 'picture', 47 | 'type' => 'image', 48 | ), 49 | 2 => 50 | array ( 51 | 'name' => 'text', 52 | 'type' => 'markdown', 53 | ), 54 | ), 55 | ), 56 | 'width' => '1-1', 57 | 'lst' => false, 58 | 'acl' => 59 | array ( 60 | ), 61 | ), 62 | 2 => 63 | array ( 64 | 'name' => 'column2', 65 | 'label' => 'Column 2', 66 | 'type' => 'set', 67 | 'default' => '', 68 | 'info' => '', 69 | 'group' => 'Column 2', 70 | 'localize' => false, 71 | 'options' => 72 | array ( 73 | 'fields' => 74 | array ( 75 | 0 => 76 | array ( 77 | 'name' => 'title', 78 | 'type' => 'text', 79 | ), 80 | 1 => 81 | array ( 82 | 'name' => 'picture', 83 | 'type' => 'image', 84 | ), 85 | 2 => 86 | array ( 87 | 'name' => 'text', 88 | 'type' => 'markdown', 89 | ), 90 | ), 91 | ), 92 | 'width' => '1-1', 93 | 'lst' => false, 94 | 'acl' => 95 | array ( 96 | ), 97 | ), 98 | 3 => 99 | array ( 100 | 'name' => 'column3', 101 | 'label' => 'Column 3', 102 | 'type' => 'set', 103 | 'default' => '', 104 | 'info' => '', 105 | 'group' => 'Column 3', 106 | 'localize' => false, 107 | 'options' => 108 | array ( 109 | 'fields' => 110 | array ( 111 | 0 => 112 | array ( 113 | 'name' => 'title', 114 | 'type' => 'text', 115 | ), 116 | 1 => 117 | array ( 118 | 'name' => 'picture', 119 | 'type' => 'image', 120 | ), 121 | 2 => 122 | array ( 123 | 'name' => 'text', 124 | 'type' => 'markdown', 125 | ), 126 | ), 127 | ), 128 | 'width' => '1-1', 129 | 'lst' => false, 130 | 'acl' => 131 | array ( 132 | ), 133 | ), 134 | ), 135 | 'sortable' => false, 136 | 'in_menu' => false, 137 | '_created' => 1518828424, 138 | '_modified' => 1518831322, 139 | 'color' => '#AC92EC', 140 | 'acl' => 141 | array ( 142 | ), 143 | 'rules' => 144 | array ( 145 | 'create' => 146 | array ( 147 | ), 148 | 'read' => 149 | array ( 150 | ), 151 | 'update' => 152 | array ( 153 | ), 154 | 'delete' => 155 | array ( 156 | ), 157 | ), 158 | 'icon' => 'layout.svg', 159 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/faq.collection.php: -------------------------------------------------------------------------------- 1 | 'faq', 4 | 'label' => 'FAQ', 5 | '_id' => 'faq5a61417dd61e3', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'name', 11 | 'label' => 'Name', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | 'maxlength' => 20, 19 | ), 20 | 'width' => '1-1', 21 | 'lst' => true, 22 | 'required' => true, 23 | ), 24 | 1 => 25 | array ( 26 | 'name' => 'title', 27 | 'label' => '', 28 | 'type' => 'text', 29 | 'default' => '', 30 | 'info' => '', 31 | 'group' => '', 32 | 'localize' => false, 33 | 'options' => 34 | array ( 35 | ), 36 | 'width' => '1-1', 37 | 'lst' => true, 38 | 'acl' => 39 | array ( 40 | ), 41 | ), 42 | 2 => 43 | array ( 44 | 'name' => 'faqs', 45 | 'label' => '', 46 | 'type' => 'repeater', 47 | 'default' => '', 48 | 'info' => '', 49 | 'group' => '', 50 | 'localize' => false, 51 | 'options' => 52 | array ( 53 | 'fields' => 54 | array ( 55 | 0 => 56 | array ( 57 | 'type' => 'text', 58 | 'label' => 'Question', 59 | ), 60 | 1 => 61 | array ( 62 | 'type' => 'markdown', 63 | 'label' => 'Answer', 64 | ), 65 | ), 66 | ), 67 | 'width' => '1-1', 68 | 'lst' => true, 69 | 'acl' => 70 | array ( 71 | ), 72 | 'required' => true, 73 | ), 74 | ), 75 | 'sortable' => false, 76 | 'in_menu' => false, 77 | '_created' => 1516323197, 78 | '_modified' => 1517830195, 79 | 'color' => '#AC92EC', 80 | 'acl' => 81 | array ( 82 | 'public' => 83 | array ( 84 | 'entries_view' => true, 85 | ), 86 | ), 87 | 'rules' => 88 | array ( 89 | 'create' => 90 | array ( 91 | ), 92 | 'read' => 93 | array ( 94 | ), 95 | 'update' => 96 | array ( 97 | ), 98 | 'delete' => 99 | array ( 100 | ), 101 | ), 102 | 'icon' => 'items.svg', 103 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/googlemap.collection.php: -------------------------------------------------------------------------------- 1 | 'googlemap', 4 | 'label' => 'Google Map', 5 | '_id' => 'googlemap5a6bcf015e18a', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'name', 11 | 'label' => 'Block Name', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | ), 19 | 'width' => '1-1', 20 | 'lst' => true, 21 | 'required' => true, 22 | ), 23 | 1 => 24 | array ( 25 | 'name' => 'url', 26 | 'label' => 'Google Map embed url', 27 | 'type' => 'text', 28 | 'default' => '', 29 | 'info' => '', 30 | 'group' => '', 31 | 'localize' => false, 32 | 'options' => 33 | array ( 34 | ), 35 | 'width' => '1-1', 36 | 'lst' => true, 37 | 'acl' => 38 | array ( 39 | ), 40 | 'required' => true, 41 | ), 42 | ), 43 | 'sortable' => false, 44 | 'in_menu' => false, 45 | '_created' => 1517014785, 46 | '_modified' => 1517830152, 47 | 'color' => '#AC92EC', 48 | 'acl' => 49 | array ( 50 | ), 51 | 'rules' => 52 | array ( 53 | 'create' => 54 | array ( 55 | ), 56 | 'read' => 57 | array ( 58 | ), 59 | 'update' => 60 | array ( 61 | ), 62 | 'delete' => 63 | array ( 64 | ), 65 | ), 66 | 'icon' => 'map.svg', 67 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/quote.collection.php: -------------------------------------------------------------------------------- 1 | 'quote', 4 | 'label' => 'Quote', 5 | '_id' => 'quote5a6bcdded94e3', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'name', 11 | 'label' => 'Block Name', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | ), 19 | 'width' => '1-1', 20 | 'lst' => true, 21 | 'required' => true, 22 | ), 23 | 1 => 24 | array ( 25 | 'name' => 'variant', 26 | 'label' => '', 27 | 'type' => 'select', 28 | 'default' => '', 29 | 'info' => '', 30 | 'group' => '', 31 | 'localize' => false, 32 | 'options' => 33 | array ( 34 | 'options' => 'Darken, Lighten', 35 | ), 36 | 'width' => '1-1', 37 | 'lst' => true, 38 | 'acl' => 39 | array ( 40 | ), 41 | ), 42 | 2 => 43 | array ( 44 | 'name' => 'author', 45 | 'label' => '', 46 | 'type' => 'text', 47 | 'default' => '', 48 | 'info' => '', 49 | 'group' => '', 50 | 'localize' => false, 51 | 'options' => 52 | array ( 53 | ), 54 | 'width' => '1-1', 55 | 'lst' => true, 56 | 'acl' => 57 | array ( 58 | ), 59 | ), 60 | 3 => 61 | array ( 62 | 'name' => 'content', 63 | 'label' => 'Content', 64 | 'type' => 'markdown', 65 | 'default' => '', 66 | 'info' => '', 67 | 'localize' => false, 68 | 'options' => 69 | array ( 70 | ), 71 | 'width' => '1-1', 72 | 'lst' => true, 73 | ), 74 | ), 75 | 'sortable' => true, 76 | 'in_menu' => false, 77 | '_created' => 1517014494, 78 | '_modified' => 1517830175, 79 | 'color' => '#AC92EC', 80 | 'acl' => 81 | array ( 82 | 'public' => 83 | array ( 84 | 'entries_view' => true, 85 | ), 86 | 'author' => 87 | array ( 88 | 'entries_view' => true, 89 | ), 90 | 'api' => 91 | array ( 92 | 'entries_view' => true, 93 | ), 94 | ), 95 | 'rules' => 96 | array ( 97 | 'create' => 98 | array ( 99 | ), 100 | 'read' => 101 | array ( 102 | ), 103 | 'update' => 104 | array ( 105 | ), 106 | 'delete' => 107 | array ( 108 | ), 109 | ), 110 | 'icon' => 'horn.svg', 111 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/rules/banner.create.php: -------------------------------------------------------------------------------- 1 | 'showmore', 4 | 'label' => 'Show More', 5 | '_id' => 'showmore5a61410ac2265', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'title', 11 | 'label' => 'Title', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | ), 19 | 'width' => '1-1', 20 | 'lst' => true, 21 | 'required' => true, 22 | ), 23 | 1 => 24 | array ( 25 | 'name' => 'summary', 26 | 'label' => 'Summary', 27 | 'type' => 'markdown', 28 | 'default' => '', 29 | 'info' => '', 30 | 'group' => '', 31 | 'localize' => false, 32 | 'options' => 33 | array ( 34 | ), 35 | 'width' => '1-1', 36 | 'lst' => true, 37 | 'acl' => 38 | array ( 39 | ), 40 | 'required' => true, 41 | ), 42 | 2 => 43 | array ( 44 | 'name' => 'contents', 45 | 'label' => '', 46 | 'type' => 'markdown', 47 | 'default' => '', 48 | 'info' => '', 49 | 'group' => '', 50 | 'localize' => false, 51 | 'options' => 52 | array ( 53 | ), 54 | 'width' => '1-1', 55 | 'lst' => true, 56 | 'acl' => 57 | array ( 58 | ), 59 | 'required' => true, 60 | ), 61 | ), 62 | 'sortable' => false, 63 | 'in_menu' => false, 64 | '_created' => 1516323082, 65 | '_modified' => 1517830185, 66 | 'color' => '#AC92EC', 67 | 'acl' => 68 | array ( 69 | ), 70 | 'rules' => 71 | array ( 72 | 'create' => 73 | array ( 74 | ), 75 | 'read' => 76 | array ( 77 | ), 78 | 'update' => 79 | array ( 80 | ), 81 | 'delete' => 82 | array ( 83 | ), 84 | ), 85 | 'icon' => 'plus-circle.svg', 86 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/simpleblock.collection.php: -------------------------------------------------------------------------------- 1 | 'simpleblock', 4 | 'label' => 'Simple Block', 5 | '_id' => 'simpleblock5a6bcd6e5d5ff', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'name', 11 | 'label' => 'Block Name', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | ), 19 | 'width' => '1-2', 20 | 'lst' => true, 21 | 'required' => true, 22 | ), 23 | 1 => 24 | array ( 25 | 'name' => 'variant', 26 | 'label' => '', 27 | 'type' => 'select', 28 | 'default' => '', 29 | 'info' => '', 30 | 'group' => '', 31 | 'localize' => false, 32 | 'options' => 33 | array ( 34 | 'options' => 'Darken, Lighten', 35 | ), 36 | 'width' => '1-2', 37 | 'lst' => true, 38 | 'acl' => 39 | array ( 40 | ), 41 | ), 42 | 2 => 43 | array ( 44 | 'name' => 'headline', 45 | 'label' => 'Headline', 46 | 'type' => 'text', 47 | 'default' => '', 48 | 'info' => '', 49 | 'group' => '', 50 | 'localize' => false, 51 | 'options' => 52 | array ( 53 | ), 54 | 'width' => '1-1', 55 | 'lst' => true, 56 | 'acl' => 57 | array ( 58 | ), 59 | ), 60 | 3 => 61 | array ( 62 | 'name' => 'content', 63 | 'label' => 'Content', 64 | 'type' => 'markdown', 65 | 'default' => '', 66 | 'info' => '', 67 | 'localize' => false, 68 | 'options' => 69 | array ( 70 | ), 71 | 'width' => '1-1', 72 | 'lst' => false, 73 | ), 74 | 4 => 75 | array ( 76 | 'name' => 'cta', 77 | 'label' => 'Call to Action', 78 | 'type' => 'set', 79 | 'default' => '', 80 | 'info' => '', 81 | 'group' => '', 82 | 'localize' => false, 83 | 'options' => 84 | array ( 85 | 'fields' => 86 | array ( 87 | 0 => 88 | array ( 89 | 'name' => 'link', 90 | 'type' => 'text', 91 | ), 92 | 1 => 93 | array ( 94 | 'name' => 'text', 95 | 'type' => 'text', 96 | ), 97 | 2 => 98 | array ( 99 | 'name' => '_blank', 100 | 'type' => 'boolean', 101 | ), 102 | ), 103 | ), 104 | 'width' => '1-1', 105 | 'lst' => false, 106 | 'acl' => 107 | array ( 108 | ), 109 | ), 110 | 5 => 111 | array ( 112 | 'name' => 'picture', 113 | 'label' => 'Picture', 114 | 'type' => 'image', 115 | 'default' => '', 116 | 'info' => '', 117 | 'group' => '', 118 | 'localize' => false, 119 | 'options' => 120 | array ( 121 | 'meta' => 122 | array ( 123 | 'title' => 124 | array ( 125 | 'type' => 'text', 126 | 'label' => 'Title', 127 | ), 128 | ), 129 | ), 130 | 'width' => '1-2', 131 | 'lst' => true, 132 | 'acl' => 133 | array ( 134 | ), 135 | ), 136 | 6 => 137 | array ( 138 | 'name' => 'float', 139 | 'label' => 'Picture Float', 140 | 'type' => 'select', 141 | 'default' => '', 142 | 'info' => '', 143 | 'group' => '', 144 | 'localize' => false, 145 | 'options' => 146 | array ( 147 | 'options' => 'None, Left, Right', 148 | ), 149 | 'width' => '1-2', 150 | 'lst' => true, 151 | 'acl' => 152 | array ( 153 | ), 154 | ), 155 | ), 156 | 'sortable' => false, 157 | 'in_menu' => false, 158 | '_created' => 1517014382, 159 | '_modified' => 1518825877, 160 | 'color' => '#AC92EC', 161 | 'acl' => 162 | array ( 163 | ), 164 | 'rules' => 165 | array ( 166 | 'create' => 167 | array ( 168 | ), 169 | 'read' => 170 | array ( 171 | ), 172 | 'update' => 173 | array ( 174 | ), 175 | 'delete' => 176 | array ( 177 | ), 178 | ), 179 | 'icon' => 'text.svg', 180 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/table.collection.php: -------------------------------------------------------------------------------- 1 | 'table', 4 | 'label' => 'Table', 5 | '_id' => 'table5a801a98c6bb4', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'title', 11 | 'label' => '', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'group' => '', 16 | 'localize' => false, 17 | 'options' => 18 | array ( 19 | ), 20 | 'width' => '1-1', 21 | 'lst' => true, 22 | 'acl' => 23 | array ( 24 | ), 25 | ), 26 | 1 => 27 | array ( 28 | 'name' => 'caption', 29 | 'label' => '', 30 | 'type' => 'text', 31 | 'default' => '', 32 | 'info' => '', 33 | 'group' => '', 34 | 'localize' => false, 35 | 'options' => 36 | array ( 37 | ), 38 | 'width' => '1-1', 39 | 'lst' => true, 40 | 'acl' => 41 | array ( 42 | ), 43 | ), 44 | 2 => 45 | array ( 46 | 'name' => 'rows', 47 | 'label' => '', 48 | 'type' => 'layout-grid', 49 | 'default' => '', 50 | 'info' => '', 51 | 'group' => '', 52 | 'localize' => false, 53 | 'options' => 54 | array ( 55 | ), 56 | 'width' => '1-1', 57 | 'lst' => true, 58 | 'acl' => 59 | array ( 60 | ), 61 | ), 62 | ), 63 | 'sortable' => false, 64 | 'in_menu' => false, 65 | '_created' => 1518344856, 66 | '_modified' => 1518345413, 67 | 'color' => '#EC87C0', 68 | 'acl' => 69 | array ( 70 | 'public' => 71 | array ( 72 | 'entries_view' => true, 73 | ), 74 | 'api' => 75 | array ( 76 | 'entries_view' => true, 77 | ), 78 | 'author' => 79 | array ( 80 | 'entries_view' => true, 81 | ), 82 | ), 83 | 'rules' => 84 | array ( 85 | 'create' => 86 | array ( 87 | ), 88 | 'read' => 89 | array ( 90 | ), 91 | 'update' => 92 | array ( 93 | ), 94 | 'delete' => 95 | array ( 96 | ), 97 | ), 98 | 'icon' => 'newspaper.svg', 99 | ); -------------------------------------------------------------------------------- /cockpit/example/collections/text.collection.php: -------------------------------------------------------------------------------- 1 | 'text', 4 | 'label' => 'Text Block', 5 | '_id' => 'text5a783f0fe373f', 6 | 'fields' => 7 | array ( 8 | 0 => 9 | array ( 10 | 'name' => 'name', 11 | 'label' => 'Block Name', 12 | 'type' => 'text', 13 | 'default' => '', 14 | 'info' => '', 15 | 'localize' => false, 16 | 'options' => 17 | array ( 18 | ), 19 | 'width' => '1-1', 20 | 'lst' => true, 21 | 'required' => true, 22 | ), 23 | 1 => 24 | array ( 25 | 'name' => 'contents', 26 | 'label' => 'Content', 27 | 'type' => 'markdown', 28 | 'default' => '', 29 | 'info' => '', 30 | 'localize' => false, 31 | 'options' => 32 | array ( 33 | ), 34 | 'width' => '1-1', 35 | 'lst' => false, 36 | ), 37 | ), 38 | 'sortable' => true, 39 | 'in_menu' => false, 40 | '_created' => 1517829903, 41 | '_modified' => 1518826900, 42 | 'color' => '#AC92EC', 43 | 'acl' => 44 | array ( 45 | ), 46 | 'rules' => 47 | array ( 48 | 'create' => 49 | array ( 50 | ), 51 | 'read' => 52 | array ( 53 | ), 54 | 'update' => 55 | array ( 56 | ), 57 | 'delete' => 58 | array ( 59 | ), 60 | ), 61 | 'icon' => 'text.svg', 62 | ); -------------------------------------------------------------------------------- /cockpit/example/config/config.yaml: -------------------------------------------------------------------------------- 1 | # Cockpit settings 2 | app.name: Cockpit Example 3 | # cockpit session name 4 | #session.name: cockpit 5 | 6 | # define the languages you want to manage 7 | #languages: 8 | # en: English 9 | # pt: Portuguese 10 | 11 | # define additional groups 12 | groups: 13 | api: 14 | $admin: false 15 | cockpit: 16 | backend: false 17 | finder: false 18 | author: 19 | $admin: false 20 | $vars: 21 | finder.path: /storage/upload 22 | cockpit: 23 | backend: true 24 | finder: true 25 | 26 | 27 | # use mongodb as main data storage 28 | #database: 29 | # server: mongodb://localhost:27017 30 | # options: 31 | # db: cockpitdb 32 | 33 | # use smtp to send emails 34 | #mailer: 35 | # from : pauloamgomes@gmail.com 36 | # transport : smtp 37 | # host : cockpit-react-mailhog 38 | # user : username 39 | # password : xxpasswordxx, 40 | # port : 1025, 41 | # auth : true, 42 | # encryption: '' # '', 'ssl' or 'tls' -------------------------------------------------------------------------------- /cockpit/example/data/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /cockpit/example/data/cockpit.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/data/cockpit.sqlite -------------------------------------------------------------------------------- /cockpit/example/data/collections.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/data/collections.sqlite -------------------------------------------------------------------------------- /cockpit/example/data/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/data/index.html -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/23/5a67b2b3542fbfire.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/23/5a67b2b3542fbfire.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/23/5a67b2b3720e0tree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/23/5a67b2b3720e0tree.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/23/5a67b2b38ed77kayaker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/23/5a67b2b38ed77kayaker.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/23/5a67b2b3a9abdmountains.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/23/5a67b2b3a9abdmountains.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/30/5a70f36d293ffdummy-454x280-Glass.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/30/5a70f36d293ffdummy-454x280-Glass.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/30/5a70f7023b738pexels-photo-325185.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/30/5a70f7023b738pexels-photo-325185.jpeg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710e3dec77fpexels-photo-373076.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710e3dec77fpexels-photo-373076.jpeg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710f6c4b00b0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710f6c4b00b0.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710f6c63fb060.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710f6c63fb060.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710f6c7a48c32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710f6c7a48c32.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710f6c95abe80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710f6c95abe80.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710f6cadc3d91.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710f6cadc3d91.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710f6cc4a5f46.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710f6cc4a5f46.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710f6cde43290.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710f6cde43290.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a710f6d0237981.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a710f6d0237981.jpg -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a71197ff0ee2html5-2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a71197ff0ee2html5-2-2.png -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a71198012e6fdocker2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a71198012e6fdocker2.png -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a711980224a1jira_icon_colour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a711980224a1jira_icon_colour.png -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a71198030a42mulesoft2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a71198030a42mulesoft2.png -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/01/31/5a7119803e6c4drupal2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/01/31/5a7119803e6c4drupal2.png -------------------------------------------------------------------------------- /cockpit/example/uploads/2018/02/01/5a738cc976931docker2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/2018/02/01/5a738cc976931docker2.png -------------------------------------------------------------------------------- /cockpit/example/uploads/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/cockpit/example/uploads/index.html -------------------------------------------------------------------------------- /cockpit/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DOCROOT="www" 4 | 5 | if [ -d "cockpit-next" ]; then 6 | echo "Cockpit already installed! Remove the cockpit-next folder first if you want to reinstall." 7 | exit 1 8 | fi 9 | 10 | # cockpit cms 11 | echo "Downloading Cockpit from https://github.com/agentejo/cockpit/archive/next.zip" 12 | wget -qO- -O next.zip https://github.com/agentejo/cockpit/archive/next.zip \ 13 | && unzip -q next.zip \ 14 | && rm next.zip \ 15 | && mv cockpit-next $DOCROOT 16 | echo "Done!" 17 | # multiple collection link addon 18 | echo "Downloading MultipleCollectionLink from https://github.com/pauloamgomes/Cockpit-MultipleCollectionLink/archive/1.1.zip" 19 | wget -qO- -O multiplecollectionlink.zip https://github.com/pauloamgomes/Cockpit-MultipleCollectionLink/archive/1.1.zip \ 20 | && unzip -q multiplecollectionlink.zip \ 21 | && rm multiplecollectionlink.zip \ 22 | && mv Cockpit-MultipleCollectionLink-1.1 $DOCROOT/addons/MultipleCollectionLink 23 | echo "Done!" 24 | # install example sqlite data 25 | echo "Installing example data" 26 | cp -r example/data $DOCROOT/storage 27 | cp -r example/collections $DOCROOT/storage 28 | cp -r example/uploads $DOCROOT/storage 29 | chmod 0755 $DOCROOT/storage 30 | # restore config 31 | cp -r example/config $DOCROOT/ 32 | chmod 0755 $DOCROOT/config 33 | chmod 0666 $DOCROOT/config/config.yaml 34 | echo "Done!" 35 | sleep 1 36 | echo 37 | echo 38 | echo "Starting cockpit docker instance.." 39 | echo 40 | ./start.sh 41 | 42 | -------------------------------------------------------------------------------- /cockpit/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd docker 4 | clear 5 | echo "Starting docker-sync and docker-compose..." 6 | docker-sync start && docker-compose up -d 7 | clear 8 | echo 9 | echo "Done. Cockpit docker instance running!" 10 | echo 11 | echo " http://cockpit-example.docker.localhost" 12 | echo 13 | exit 14 | -------------------------------------------------------------------------------- /cockpit/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd docker 4 | clear 5 | echo "Stopping docker-compose and docker-sync..." 6 | docker-compose stop && docker-sync stop 7 | exit 8 | -------------------------------------------------------------------------------- /react/.env.local: -------------------------------------------------------------------------------- 1 | REACT_APP_COCKPIT_READ_TOKEN=ecde6bbbffbbc990c0d6b347624dfc 2 | REACT_APP_COCKPIT_SAVE_TOKEN=account-15e935bfbd6c74853d2933cb2516be 3 | REACT_APP_COCKPIT_URL=http://cockpit-example.docker.localhost -------------------------------------------------------------------------------- /react/.env.production: -------------------------------------------------------------------------------- 1 | REACT_APP_COCKPIT_READ_TOKEN=ecde6bbbffbbc990c0d6b347624dfc 2 | REACT_APP_COCKPIT_SAVE_TOKEN=account-15e935bfbd6c74853d2933cb2516be 3 | REACT_APP_COCKPIT_URL=http://cockpit-example.docker.localhost -------------------------------------------------------------------------------- /react/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "react-app", 3 | "plugins": ["prettier"], 4 | "rules": { 5 | "prettier/prettier": "error" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /react/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | # .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /react/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "es5" 4 | } 5 | -------------------------------------------------------------------------------- /react/.snyk: -------------------------------------------------------------------------------- 1 | # Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. 2 | version: v1.14.1 3 | ignore: {} 4 | # patches apply the minimum changes required to fix a vulnerability 5 | patch: 6 | 'npm:hoek:20180212': 7 | - react-scripts > webpack-dev-server > chokidar > fsevents > node-pre-gyp > hawk > hoek: 8 | patched: '2018-12-07T22:46:57.576Z' 9 | - react-scripts > webpack-dev-server > chokidar > fsevents > node-pre-gyp > hawk > boom > hoek: 10 | patched: '2018-12-07T22:46:57.576Z' 11 | - react-scripts > webpack > watchpack > chokidar > fsevents > node-pre-gyp > hawk > hoek: 12 | patched: '2018-12-07T22:46:57.576Z' 13 | - react-scripts > webpack-dev-server > chokidar > fsevents > node-pre-gyp > hawk > sntp > hoek: 14 | patched: '2018-12-07T22:46:57.576Z' 15 | - react-scripts > webpack-dev-server > chokidar > fsevents > node-pre-gyp > hawk > cryptiles > boom > hoek: 16 | patched: '2018-12-07T22:46:57.576Z' 17 | - react-scripts > webpack > watchpack > chokidar > fsevents > node-pre-gyp > hawk > boom > hoek: 18 | patched: '2018-12-07T22:46:57.576Z' 19 | - react-scripts > webpack > watchpack > chokidar > fsevents > node-pre-gyp > hawk > sntp > hoek: 20 | patched: '2018-12-07T22:46:57.576Z' 21 | - react-scripts > webpack > watchpack > chokidar > fsevents > node-pre-gyp > hawk > cryptiles > boom > hoek: 22 | patched: '2018-12-07T22:46:57.576Z' 23 | SNYK-JS-LODASH-567746: 24 | - lint-staged > lodash: 25 | patched: '2020-05-01T07:31:06.844Z' 26 | - react-redux > lodash: 27 | patched: '2020-05-01T07:31:06.844Z' 28 | - redux > lodash: 29 | patched: '2020-05-01T07:31:06.844Z' 30 | -------------------------------------------------------------------------------- /react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-cockpit-simplesite", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "history": "^4.7.2", 7 | "lint-staged": "^6.1.0", 8 | "material-ui": "^0.20.0", 9 | "prettier": "^1.9.2", 10 | "prop-types": "^15.6.0", 11 | "react": "^16.2.0", 12 | "react-dom": "^16.2.1", 13 | "react-flexbox-grid": "^2.0.0", 14 | "react-markdown": "^3.1.5", 15 | "react-redux": "^5.0.6", 16 | "react-router-dom": "^4.2.2", 17 | "react-router-redux": "^5.0.0-alpha.9", 18 | "react-scripts": "2.1.3", 19 | "react-slick": "^0.16.0", 20 | "redux": "^3.7.2", 21 | "redux-thunk": "^2.2.0", 22 | "slick-carousel": "^1.8.1", 23 | "snyk": "^1.316.1" 24 | }, 25 | "lint-staged": { 26 | "src/**/*.{js,jsx,json,css}": [ 27 | "prettier --single-quote --write", 28 | "git add" 29 | ] 30 | }, 31 | "scripts": { 32 | "precommit": "lint-staged", 33 | "start": "react-scripts start", 34 | "build": "sh -ac '. .env.production; react-scripts build'", 35 | "test": "react-scripts test --env=jsdom", 36 | "eject": "react-scripts eject", 37 | "snyk-protect": "snyk protect", 38 | "prepublish": "yarn run snyk-protect" 39 | }, 40 | "devDependencies": { 41 | "husky": "^0.14.3", 42 | "pretty-quick": "^1.4.1" 43 | }, 44 | "snyk": true 45 | } 46 | -------------------------------------------------------------------------------- /react/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pauloamgomes/cockpit-react-example/18528563c0f8ce660133103a4718567c46f2095b/react/public/favicon.ico -------------------------------------------------------------------------------- /react/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 11 | 12 | 13 | 22 |41 |49 |“42 |43 |45 |44 | 46 |48 |{props.author}47 |