├── .babelrc ├── .env ├── .eslintrc ├── .eslintrc.js ├── .gitignore ├── Procfile ├── Public ├── GitHub-Mark-120.png ├── GitHub-Mark.png ├── intro-bg.jpg ├── macbook-pro-keyboard.png.jpg ├── sheepHostFaviCon.png ├── sheepHostSheep.png └── stylesheet.css ├── README.md ├── client ├── Auth.js ├── actions │ ├── GetData.js │ ├── loginAction.js │ └── signupActions.js ├── components │ ├── .DS_Store │ ├── BottomGreetings.js │ ├── Dashboard │ │ ├── Create │ │ │ ├── clientInput.js │ │ │ └── createDBValidation.js │ │ ├── DashNavBar.js │ │ ├── Dashboard.js │ │ ├── Data │ │ │ ├── ColNavBar.js │ │ │ ├── DBNavBar.js │ │ │ ├── DataItem.js │ │ │ ├── Display.js │ │ │ └── apiSandbox.js │ │ ├── Docs │ │ │ └── Docs.js │ │ └── Profile │ │ │ ├── PermissionsForm.js │ │ │ ├── PublicAPI.js │ │ │ ├── SecretClick.js │ │ │ └── UserProfileInfo.js │ ├── Greetings.js │ ├── NavigationBar.js │ ├── WaitPage.js │ ├── app.js │ ├── login │ │ ├── LoginForm.js │ │ ├── LoginFormValidation.js │ │ ├── LoginInput.js │ │ └── LoginPage.js │ ├── logout │ │ └── Logout.js │ └── signup │ │ ├── SignupForm.js │ │ ├── SignupFormValidation.js │ │ ├── SignupInput.js │ │ └── SignupPage.js ├── index.js └── routes.js ├── database ├── SheepDB.js ├── methods │ ├── apiKeyMethods.js │ ├── apiMethods.js │ ├── cookieMethods.js │ ├── devMethods.js │ ├── schemaParser.js │ └── sharedMethods.js └── models │ ├── devModel.js │ └── verifyModel.js ├── demo ├── index.html ├── populateDB.js └── style.css ├── gallery demo ├── LICENSE ├── README.md ├── css │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── style.css │ └── thumbnail-gallery.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── index.html └── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ └── jquery.js ├── package.json ├── public ├── A91743E99713AF60AC681E8272F0A717.txt ├── B152B255AA2EE1390613B103448F71A0.txt ├── index.html └── public_api.js ├── server ├── .DS_Store ├── index.html ├── routes │ ├── api.js │ ├── create.js │ ├── getDashboardData.js │ ├── login.js │ ├── permission.js │ └── signup.js ├── server.js └── verify.js ├── test ├── .setup.js ├── App.spec.js ├── api-key-generator_test.js ├── client │ ├── ClientInput_test.js │ └── index.js ├── cookieMethods_test.js ├── devDbMethods_test.js ├── devMethods_test.js ├── devModel_test.js └── sheepDB_test.js └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "react"] 3 | } -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: 'development', 3 | PORT: 443 4 | } 5 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "airbnb", 3 | "root": true, 4 | "plugins": [ 5 | "react" 6 | ], 7 | "parserOptions": { 8 | "ecmaVersion": 6, 9 | "sourceType": "module", 10 | "ecmaFeatures": { 11 | "jsx": true 12 | } 13 | }, 14 | "ev": { 15 | "es6": true, 16 | "node": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "airbnb", 3 | "plugins": [ 4 | "react", 5 | "jsx-a11y", 6 | "import" 7 | ], 8 | "rules": { 9 | "no-param-reassign": 0, 10 | "max-len": 0, 11 | "no-underscore-dangle": 0, 12 | "no-restricted-syntax": [0,"ForInStatement"], 13 | "no-console": 0, 14 | } 15 | }; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | public/bundle.js 4 | .DS_Store 5 | certs 6 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node server.js 2 | -------------------------------------------------------------------------------- /Public/GitHub-Mark-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheep-host/Sheep-host/9fe23fdd49f27c25d0eeb990f7b673735192f949/Public/GitHub-Mark-120.png -------------------------------------------------------------------------------- /Public/GitHub-Mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheep-host/Sheep-host/9fe23fdd49f27c25d0eeb990f7b673735192f949/Public/GitHub-Mark.png -------------------------------------------------------------------------------- /Public/intro-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheep-host/Sheep-host/9fe23fdd49f27c25d0eeb990f7b673735192f949/Public/intro-bg.jpg -------------------------------------------------------------------------------- /Public/macbook-pro-keyboard.png.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheep-host/Sheep-host/9fe23fdd49f27c25d0eeb990f7b673735192f949/Public/macbook-pro-keyboard.png.jpg -------------------------------------------------------------------------------- /Public/sheepHostFaviCon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheep-host/Sheep-host/9fe23fdd49f27c25d0eeb990f7b673735192f949/Public/sheepHostFaviCon.png -------------------------------------------------------------------------------- /Public/sheepHostSheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheep-host/Sheep-host/9fe23fdd49f27c25d0eeb990f7b673735192f949/Public/sheepHostSheep.png -------------------------------------------------------------------------------- /Public/stylesheet.css: -------------------------------------------------------------------------------- 1 | .container{ 2 | background: url('./macbook-pro-keyboard.png.jpg'); 3 | height: 100%; 4 | } 5 | html { 6 | height: 100%; 7 | zoom: 87%; 8 | } 9 | 10 | body { 11 | background-color: #FFFFFF; 12 | font-family: 'Raleway', sans-serif; 13 | height: 100%; 14 | } 15 | 16 | .h { 17 | background: url('./macbook-pro-keyboard.png.jpg'); 18 | } 19 | 20 | .top { 21 | /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#1e5799+0,207cca+16,207cca+16,2989d8+50,3c89c9+72,7db9e8+100 */ 22 | background: url('./macbook-pro-keyboard.png.jpg'); 23 | background-size: 120% 100% ; 24 | } 25 | 26 | 27 | .font { 28 | font-family: 'Raleway', sans-serif; 29 | } 30 | 31 | .login-signup-words { 32 | color: black; 33 | font-size: 44px; 34 | } 35 | 36 | .login-input-outer { 37 | background-color: white; 38 | border: 1px solid white; 39 | padding: 30px; 40 | margin: 20px; 41 | width: 100%; 42 | 43 | box-shadow: 0px 0px 30px #000; 44 | -moz-box-shadow: 0px 0px 30px #000; 45 | -webkit-box-shadow: 0px 0px 30px #000; 46 | } 47 | 48 | .error{ 49 | color: red; 50 | } 51 | 52 | .put-input { 53 | padding-bottom: 10px; 54 | margin-bottom: 20px; 55 | margin-top: 20px; 56 | } 57 | 58 | 59 | 60 | .landing-button { 61 | display: block; 62 | text-align:center; 63 | margin-top: 20px; 64 | margin: 0 auto; 65 | /*margin-left: 43.5%;*/ 66 | background: #134e75; 67 | background-image: -webkit-linear-gradient(top, #134e75, #2980b9); 68 | background-image: -moz-linear-gradient(top, #134e75, #2980b9); 69 | background-image: -ms-linear-gradient(top, #134e75, #2980b9); 70 | background-image: -o-linear-gradient(top, #134e75, #2980b9); 71 | background-image: linear-gradient(to bottom, #134e75, #2980b9); 72 | -webkit-border-radius: 60; 73 | -moz-border-radius: 60; 74 | border-radius: 5px; 75 | -webkit-box-shadow: 0px 1px 3px #666666; 76 | -moz-box-shadow: 0px 1px 3px #666666; 77 | box-shadow: 0px 1px 3px #666666; 78 | color: #ffffff; 79 | font-size: 2px; 80 | height: 80px; 81 | font-weight: 100; 82 | padding: 5px 10px 5px 10px; 83 | border: solid #1f628d 2px; 84 | text-decoration: none; 85 | } 86 | 87 | .landing-button:hover { 88 | background: #3cb0fd; 89 | background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db); 90 | background-image: -moz-linear-gradient(top, #3cb0fd, #3498db); 91 | background-image: -ms-linear-gradient(top, #3cb0fd, #3498db); 92 | background-image: -o-linear-gradient(top, #3cb0fd, #3498db); 93 | background-image: linear-gradient(to bottom, #3cb0fd, #3498db); 94 | text-decoration: none; 95 | } 96 | 97 | .welcome-to-sheep { 98 | text-align: center; 99 | vertical-align: middle; 100 | } 101 | 102 | .welcome-to-sheep-tagline { 103 | padding-bottom: 70px; 104 | text-align: center; 105 | } 106 | .how-it-works-title { 107 | font-size: 40px; 108 | } 109 | 110 | /*how it works container */ 111 | .bottom { 112 | padding-top: 50px; 113 | padding-right: 15px; 114 | padding-left: 15px; 115 | padding-bottom: 20px; 116 | margin-right: auto; 117 | margin-left: auto; 118 | margin-bottom: 300px; 119 | } 120 | @media (min-width: 768px) { 121 | .container { 122 | width: 750px; 123 | } 124 | } 125 | @media (min-width: 992px) { 126 | .container { 127 | width: 970px; 128 | } 129 | } 130 | @media (min-width: 1200px) { 131 | .container { 132 | width: 1170px; 133 | } 134 | } 135 | 136 | /*image */ 137 | .build-flow { 138 | height: 300px; 139 | width: 400px; 140 | } 141 | /*image */ 142 | .prototype-image { 143 | width: 35%; 144 | height: 400%; 145 | margin-right: 3%; 146 | } 147 | 148 | .navbar { 149 | margin-bottom: 0; 150 | height: 70px; 151 | /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#45484d+0,000000+100;Black+3D+%231 */ 152 | background: #45484d; /* Old browsers */ 153 | background: -moz-linear-gradient(top, #45484d 0%, #000000 100%); /* FF3.6-15 */ 154 | background: -webkit-linear-gradient(top, #45484d 0%,#000000 100%); /* Chrome10-25,Safari5.1-6 */ 155 | background: linear-gradient(to bottom, #45484d 0%,#000000 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ 156 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#45484d', endColorstr='#000000',GradientType=0 ); /* IE6-9 */ 157 | } 158 | 159 | /* header */ 160 | .sheep-host { 161 | font-size: 50px; 162 | color:white; 163 | margin-left: 100px; 164 | } 165 | /* header */ 166 | .header-action-words { 167 | padding-right: 15px; 168 | font-size: 22px; 169 | color: white; 170 | margin-top: 4px; 171 | } 172 | 173 | .api-sandbox-words { 174 | font-size: 40px; 175 | } 176 | 177 | .docs-text { 178 | font-size: 18px; 179 | } 180 | 181 | .code { 182 | background-color: white; 183 | } 184 | 185 | .landing-page-text-snippet { 186 | font-size: 25px; 187 | 188 | font-weight: 200; 189 | 190 | } 191 | 192 | .landing-page-text-snippet-buildFast { 193 | font-size: 34px; 194 | font-weight: 200; 195 | } 196 | 197 | .landing-page-text-snippet-header { 198 | vertical-align: middle; 199 | margin-top: 100px; 200 | font-size: 50px; 201 | 202 | 203 | } 204 | 205 | .landing-page-text-snippet-buildFast{ 206 | font-size:34px; 207 | } 208 | 209 | .landing-page-text-snippet-buildFast-bullets { 210 | padding-top: 20px; 211 | font-size: 28px; 212 | } 213 | 214 | .footer { 215 | bottom:0; 216 | width:100%; 217 | height:60px; /* Height of the footer */ 218 | background:#6cf; 219 | } 220 | 221 | .display { 222 | padding-top: 10px; 223 | width: 80%; 224 | margin-left: 10%; 225 | 226 | } 227 | 228 | .database-display-name { 229 | font-size: 40px; 230 | padding-left: 60px; 231 | font-weight: 900; 232 | } 233 | .collection-display-name { 234 | font-size: 30px; 235 | padding-left: 60px; 236 | font-weight: 800; 237 | } 238 | 239 | .panel { 240 | background-color: #357A5E; 241 | } 242 | 243 | .welcome-bottom { 244 | color: black; 245 | } 246 | 247 | .data-key { 248 | font-size: 20px; 249 | color: gray; 250 | } 251 | 252 | .Collection-Input { 253 | float: left; 254 | } 255 | 256 | .hide-true { 257 | display: none; 258 | } 259 | 260 | .text-center .banner { 261 | background-color: red; 262 | } 263 | 264 | .h { 265 | /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#1e5799+0,207cca+16,207cca+16,2989d8+50,3c89c9+72,7db9e8+100 */ 266 | background-size: cover; 267 | height: 100vh; 268 | } 269 | 270 | .wait { 271 | background-size: 100%; 272 | background-repeat: no-repeat; 273 | height: 550px; 274 | } 275 | 276 | #wait-header { 277 | padding-top: 100px; 278 | margin: 0; 279 | } 280 | 281 | .logo { 282 | height: auto; 283 | width: auto; 284 | max-width: 60px; 285 | max-height: 60px; 286 | margin-left: 20px; 287 | margin-top: 0px; 288 | } 289 | 290 | #mainHeaderWrapper{ 291 | position: relative; 292 | } 293 | 294 | #mainHeaderWrapper img{ 295 | vertical-align: top; 296 | width: 100%; /* max width */ 297 | opacity: 0; /* make it transparent */ 298 | } 299 | 300 | #mainHeaderWrapper > div{ 301 | position: absolute; 302 | top: 0; 303 | width: 100%; 304 | height: 100%; 305 | } 306 | 307 | 308 | .welcome-info-tag { 309 | color: #000000; 310 | border-top: 1px solid; 311 | padding: 15px; 312 | text-align: center; 313 | } 314 | 315 | .tabTitle{ 316 | margin-right:10px; 317 | font-weight: bold; 318 | } 319 | 320 | .text-center { 321 | font-size: 30px; 322 | font-style: serif; 323 | opacity: 1.0; 324 | } 325 | 326 | .tab-active { 327 | background-color: #fff; 328 | } 329 | 330 | .tab{ 331 | padding-left: 10px; 332 | padding-right: 10px; 333 | border: 1px solid #00327A; 334 | border-top-left-radius: 5px; 335 | border-top-right-radius: 5px; 336 | } 337 | 338 | .tab #active{ 339 | border-bottom: none; 340 | } 341 | 342 | .user-profile { 343 | font-size: 24px; 344 | } 345 | 346 | .post-put-delete { 347 | font-size: 20px; 348 | } 349 | 350 | td { 351 | padding: 5px 15px 5px 0; 352 | } 353 | 354 | input[type=radio] { 355 | border: 0px; 356 | width: 20px; 357 | height: 1em; 358 | } 359 | 360 | .SDK { 361 | font-size: 18px; 362 | } 363 | 364 | .schema-text-area { 365 | font-size: 18px; 366 | } 367 | 368 | .active { 369 | color:red; 370 | } 371 | 372 | .nav-link { 373 | display: inline; 374 | padding-left: 50px; 375 | padding-right: 20px; 376 | } 377 | 378 | .btn-group { 379 | margin-bottom: 10px; 380 | } 381 | 382 | .btn-default { 383 | font-size:30px; 384 | font-weight: 1; 385 | color: #F2F2F2; 386 | background: #134e75; 387 | background-image: -webkit-linear-gradient(top, #134e75, #2980b9); 388 | background-image: -moz-linear-gradient(top, #134e75, #2980b9); 389 | background-image: -ms-linear-gradient(top, #134e75, #2980b9); 390 | background-image: -o-linear-gradient(top, #134e75, #2980b9); 391 | background-image: linear-gradient(to bottom, #134e75, #2980b9); 392 | } 393 | .btn-group-justified .btn-group .btn { 394 | font-weight: 100; 395 | transition: all 0.3s ease-in-out; 396 | 397 | } 398 | 399 | 400 | .btn-group-justified .btn-group .btn-default .active { 401 | background:#fff; 402 | } 403 | 404 | .tabs { 405 | font-weight: 40; 406 | margin-top: 20px; 407 | margin-left: 10px; 408 | color: #134e75; 409 | background-color: white; 410 | font-size: 17px; 411 | font-style: Sans-Serif; 412 | } 413 | 414 | .tabs .btn .btn-primary .info { 415 | color: black; 416 | } 417 | 418 | .add-db-button { 419 | width: 300px; 420 | font-weight: 100; 421 | margin-left: 25%; 422 | } 423 | 424 | .login-button { 425 | margin-left: 40%; 426 | font-weight: 100; 427 | } 428 | .submit-button { 429 | margin-left: 40%; 430 | font-weight: 100; 431 | } 432 | 433 | .tab-button { 434 | color: #ffffff; 435 | background-color: #611BBD; 436 | } 437 | .api-button { 438 | font-size: 22px; 439 | height: 46px; 440 | width: 150px; 441 | margin-top: 15px; 442 | margin-left: 37%; 443 | font-weight: 100; 444 | padding-bottom: 20px; 445 | } 446 | 447 | footer{ 448 | background: #45484d; /* Old browsers */ 449 | background: -moz-linear-gradient(top, #45484d 0%, #000000 100%); /* FF3.6-15 */ 450 | background: -webkit-linear-gradient(top, #45484d 0%,#000000 100%); /* Chrome10-25,Safari5.1-6 */ 451 | background: linear-gradient(to bottom, #45484d 0%,#000000 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ 452 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#45484d', endColorstr='#000000',GradientType=0 ); /* IE6-9 */ 453 | height: 70px; 454 | bottom: 0; 455 | left: 0; 456 | width: 100% 457 | } 458 | 459 | .footer-contact { 460 | padding-top: 30px; 461 | color: #fff; 462 | text-align: center; 463 | font-size: 16px; 464 | } 465 | .tab-button:hover, 466 | .tab-button:focus, 467 | .tab-button:active, 468 | .tab-button.active, 469 | .open .dropdown-toggle.tab-button { 470 | color: #ffffff; 471 | background-color: #49247A; 472 | border-color: #130269; 473 | } 474 | 475 | .tab-button:active, 476 | .tab-button.active, 477 | .open .dropdown-toggle.tab-button { 478 | background-image: none; 479 | } 480 | 481 | .tab-button.disabled, 482 | .tab-button[disabled], 483 | fieldset[disabled] .tab-button, 484 | .tab-button.disabled:hover, 485 | .tab-button[disabled]:hover, 486 | fieldset[disabled] .tab-button:hover, 487 | .tab-button.disabled:focus, 488 | .tab-button[disabled]:focus, 489 | fieldset[disabled] .tab-button:focus, 490 | .tab-button.disabled:active, 491 | .tab-button[disabled]:active, 492 | fieldset[disabled] .tab-button:active, 493 | .tab-button.disabled.active, 494 | .tab-button[disabled].active, 495 | fieldset[disabled] .tab-button.active { 496 | background-color: #611BBD; 497 | border-color: #130269; 498 | } 499 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sheep.host 2 | Sheep.host is a backend-as-as-service built on top of MongoDB that gives developers the ability to quickly generate hosted databases with the click of a button. 3 | 4 | Sheep was born out of our desire to make full-stack prototyping more nimble. Sheep provides an out-of-the-box backend platform that abstracts away the tedious infrastructure and API tasks required to host, save, and retrieve data. 5 | 6 | To get started, a developer simply needs to: 7 | 8 | - Sign-up and log-in 9 | - Create a database by inputting their database name, collection name, and schema through their GUI dashboard 10 | - Add the script tag that is provided on the profile page to their client side application 11 | - Interact with the data using Sheep’s SDK 12 | 13 | ## Features: 14 | 15 | - Dashboard GUI: View data stored in each database and collection 16 | - API Sandbox: Developers can make CRUD instructions to their database through their GUI dashboard to create and manipulate data without writing a single line of code. 17 | - SDK: Applications can interact directly with databases by using Sheep’s SDK/API 18 | - 2-Tier Permissions: Since applications can interact with directly databases, developer are given a full-access secret key as well as a permissions-based client key that they can place directly in their application. Developers can dynamically change permissions through their dashboard. 19 | - Email Verification: New accounts require email verification to create an account 20 | - JWT: Dashboard sessions are secured using JSON web tokens 21 | - Bcrypt: All passwords are hashed using Bcrypt 22 | 23 | ## Navigating the Site: 24 | 25 | ### CREATE 26 | 27 | The CREATE tab is where you instantiate all of your databases and collections. You are currently limited to three (3) databases. Please email us at administrator@sheep.host if you need to rename a database or delete it or any collections within. 28 | 29 | #### Creating a Database 30 | 31 | Enter the desired name of your database and the name of its first collection. 32 | 33 | Enter your desired schema in the form of a JSON object. Incorrect schema input will be rejected and neither the database or collection will be created. 34 | - Correct example: {"firstName": "String", "lastName": "String", "age": "Number"} 35 | - Inorrect example: firstName: String, lastName: String, age: Number 36 | 37 | #### Creating a Collection 38 | 39 | To create a new collection within an existing database, simply enter the name of that database in lieu of a new one. 40 | 41 | ### DATA 42 | 43 | The Dashboard tab contains all of your data we are hosting. You can navigate between all of your databases and each collection within those databases. 44 | 45 | The particular collection displayed on the dashboard at any given moment will display new documents, updates to existing documents and the removel of documents as those changes come in from your apps. 46 | 47 | #### API Sandbox 48 | 49 | Below the data is a sandbox for you to prototype your data performing simple CRUD instructions to the collection you are viewing. 50 | 51 | To update or delete documents, enter a JSON object with the {key:value} pair of the document you wish to change into the designated input field. 52 | To update or add documents, enter the desired information in the form of a JSON object the same way you enter your schema on the CREATE page. 53 | - Example: {"firstName": "John", "lastName": "Doe", "age": "30"} 54 | 55 | ### PROFILE 56 | 57 | The PROFILE tab contains all of your user information, a list of your databases and collections, as well as your API key information. 58 | 59 | Below all of this information is the auto-generated series of script tags to access our SDK... 60 | 61 | #### Using the SDK 62 | 63 | To use the globally exposed sheep object, simply copy the script tags and paste them into the app's HTML file above your Javascript. 64 | 65 | Call the SDK methods via the sheep object, and enter the desired database name and collection as the first two arguments. 66 | 67 | ##### GET 68 | - sheep.get( [database_name], [collection_name], callback ) 69 | 70 | Returns all of the documents in the collection to the callback in the third argument as an array of objects. 71 | 72 | Example: 73 | 74 | // Gets all records from the Users collection in the MyApp database and logs them individually{{ 75 | sheep.get(MyApp, Users, (results => { 76 | results.forEach(record){ 77 | console.log(record); 78 | }); 79 | }); 80 | 81 | ##### POST 82 | 83 | - sheep.post( [database_name], [collection_name], {data}) 84 | 85 | Adds a record to a given collection. The third argument, data refers to an object with the key:value pairs, that follows the schema you created for that collection. A successful post will receive a response with status code 200. 86 | 87 | Example: 88 | 89 | // Adds a record with "John Doe" in the "name field" and "Los Angeles" in the "location" field from the Users collection in the MyApp database{{ 90 | sheep.post(MyApp, Users, { name: "John Doe", location: "New York" }) 91 | 92 | ##### PUT 93 | 94 | - sheep.put( [database_name], [collection_name], { query }, { data } ) 95 | 96 | Updates a record in a given collection. The third argument, query refers to an object with the key:value pair of the record you want to change, that follows the schema you created for that collection. The fourth argument, data refers to an object with the key:value pair(s) to change. A successful post will receive a response with status code 200. 97 | 98 | Example: 99 | 100 | // Changes the "location" field of the record with "name" of "John Doe" to "New York" in the Users collection in the MyApp database{{ 101 | sheep.put(MyApp, Users,{ name: "John Doe" }, { location: "New York" }) 102 | 103 | ##### DELETE 104 | 105 | - sheep.delete( [database_name], [collection_name], { query } ) 106 | 107 | Deletes a record in a given collection. The third argument, query refers to an object with the key:value pair of the record you want to delete, that follows the schema you created for that collection. A successful post will receive a response with status code 200. 108 | 109 | Example: 110 | 111 | // Deletes the record with "John Doe" in the "name" field from the Users collection in the MyApp database{{ 112 | sheep.delete(MyApp, Users, { name: "John Doe" }) 113 | 114 | #### Setting Client Permissions 115 | 116 | You can modify your API Client Key permissions to your data by setting each CRUD method to TRUE or FALSE and clicking save. Changes will not be made until you click the save button. They can be changed at any time. Once a method is set to false, users on your app cannot access that route. This is helpful if you don't want to let users delete or update own records. 117 | 118 | -------------------------------------------------------------------------------- /client/Auth.js: -------------------------------------------------------------------------------- 1 | import jwtDecode from 'jwt-decode'; 2 | import { browserHistory } from 'react-router'; 3 | 4 | function loggedIn() { 5 | if (localStorage.sheepToken) { 6 | const sheepToken = jwtDecode(localStorage.sheepToken); 7 | console.log('token exp', sheepToken.exp * 1000, Date.now()); 8 | if (sheepToken.exp * 1000 < Date.now()) return false; 9 | return true; 10 | } 11 | return false; 12 | } 13 | 14 | function redirect() { 15 | localStorage.clear(); 16 | document.cookie.split(';').forEach((c) => { 17 | document.cookie = c.replace(/^ +/, '').replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/'); 18 | }); 19 | browserHistory.push('/login'); 20 | } 21 | 22 | module.exports = { loggedIn, redirect }; 23 | -------------------------------------------------------------------------------- /client/actions/GetData.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | export default function getUserData(id) { 4 | return () => axios.get(`/api/ + ${id}`); 5 | } 6 | -------------------------------------------------------------------------------- /client/actions/loginAction.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | export default function userLogin(userData) { 4 | return () => axios.post('/login', userData); 5 | } 6 | -------------------------------------------------------------------------------- /client/actions/signupActions.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | export default function userSignupRequest(data) { 4 | return () => axios.post('/signup', data); 5 | } 6 | -------------------------------------------------------------------------------- /client/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sheep-host/Sheep-host/9fe23fdd49f27c25d0eeb990f7b673735192f949/client/components/.DS_Store -------------------------------------------------------------------------------- /client/components/BottomGreetings.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import GitHubImage from '../../Public/GitHub-Mark.png'; 3 | 4 | const BottomGreetings = () => { 5 | return ( 6 |
7 | How it works 8 |
9 |
10 | Click a Button 11 |
12 | Spool up a database in less than 1 minute 13 |
14 |
15 | Copy and Paste 16 |
17 | Connect the database to your app with a script tag 18 |
19 |
20 | Build 21 |
22 | Read and write to the database using our SDK 23 |
24 |
25 |
GitHub
26 | 27 |
28 | ); 29 | }; 30 | 31 | export default BottomGreetings; 32 | -------------------------------------------------------------------------------- /client/components/Dashboard/Create/clientInput.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ClientInput = (props) => { 4 | return ( 5 |
6 |
7 |
8 |

Your Profile

9 |
10 | 11 | {props.error.dbName && 12 |
{props.error.dbName}
13 | } 14 |
15 | If you would like to create a new database, enter a new database name. Otherwise, enter the name of an existing database you would like to add a collection to 19 | 26 |
27 |
28 |
29 | 30 | {props.error.collectionName && 31 |
{props.error.collectionName}
32 | } 33 |
34 | Enter name of collection you are creating 38 | 45 |
46 |
47 |
48 | 49 | {props.error.schema && 50 |
{props.error.schema}
51 | } 52 |
53 | Use JSON format and please highlight the type 57 |