├── .gitignore ├── LICENSE ├── README.md ├── backend ├── .gitignore ├── handler.js ├── mapping-templates │ ├── Mutation.createBook.request.vtl │ ├── Mutation.createBook.response.vtl │ ├── Query.getBookById.request.vtl │ ├── Query.getBookById.response.vtl │ ├── Query.listBooks.request.vtl │ └── Query.listBooks.response.vtl ├── package-lock.json ├── package.json ├── resources.yml ├── schema.graphql └── serverless.yml ├── frontend └── book-store │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt │ ├── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── graphql │ │ └── queries │ │ │ └── book.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── reportWebVitals.js │ └── setupTests.js │ └── yarn.lock └── new-schema.graphql /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Manoj Fernando 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # amplify-serverless-appsync-course -------------------------------------------------------------------------------- /backend/.gitignore: -------------------------------------------------------------------------------- 1 | # package directories 2 | node_modules 3 | jspm_packages 4 | 5 | # Serverless directories 6 | .serverless -------------------------------------------------------------------------------- /backend/handler.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports.hello = async event => { 4 | return { 5 | statusCode: 200, 6 | body: JSON.stringify( 7 | { 8 | message: 'Go Serverless v1.0! Your function executed successfully!', 9 | input: event, 10 | }, 11 | null, 12 | 2 13 | ), 14 | }; 15 | 16 | // Use this code if you don't use the http event with the LAMBDA-PROXY integration 17 | // return { message: 'Go Serverless v1.0! Your function executed successfully!', event }; 18 | }; 19 | -------------------------------------------------------------------------------- /backend/mapping-templates/Mutation.createBook.request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2017-02-28", 3 | "operation" : "PutItem", 4 | "key": { 5 | "bookId" : $util.dynamodb.toDynamoDBJson($util.autoId()) 6 | }, 7 | "attributeValues" : { 8 | "title" : $util.dynamodb.toDynamoDBJson($ctx.args.newBook.title), 9 | "description": $util.dynamodb.toDynamoDBJson($ctx.args.newBook.description), 10 | "imageUrl": $util.dynamodb.toDynamoDBJson($ctx.args.newBook.imageUrl), 11 | "author": $util.dynamodb.toDynamoDBJson($ctx.args.newBook.author), 12 | "price": $util.dynamodb.toDynamoDBJson($ctx.args.newBook.price), 13 | "createdAt": $util.dynamodb.toDynamoDBJson($util.time.nowISO8601()), 14 | "updatedAt": $util.dynamodb.toDynamoDBJson($util.time.nowISO8601()) 15 | } 16 | } -------------------------------------------------------------------------------- /backend/mapping-templates/Mutation.createBook.response.vtl: -------------------------------------------------------------------------------- 1 | $util.toJson($ctx.result) -------------------------------------------------------------------------------- /backend/mapping-templates/Query.getBookById.request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2017-02-28", 3 | "operation" : "GetItem", 4 | "key" : { 5 | "bookId" : $util.dynamodb.toDynamoDBJson($ctx.args.bookId) 6 | } 7 | } -------------------------------------------------------------------------------- /backend/mapping-templates/Query.getBookById.response.vtl: -------------------------------------------------------------------------------- 1 | $util.toJson($ctx.result) -------------------------------------------------------------------------------- /backend/mapping-templates/Query.listBooks.request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2017-02-28", 3 | "operation" : "Scan", 4 | "limit" : $util.toJson($context.arguments.limit), 5 | "nextToken" : $util.toJson($context.arguments.nextToken) 6 | } -------------------------------------------------------------------------------- /backend/mapping-templates/Query.listBooks.response.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "books": $util.toJson($context.result.items), 3 | "nextToken": $util.toJson($util.defaultIfNullOrBlank($context.result.nextToken, null)) 4 | } -------------------------------------------------------------------------------- /backend/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@ardatan/aggregate-error": { 8 | "version": "0.0.6", 9 | "resolved": "https://registry.npmjs.org/@ardatan/aggregate-error/-/aggregate-error-0.0.6.tgz", 10 | "integrity": "sha512-vyrkEHG1jrukmzTPtyWB4NLPauUw5bQeg4uhn8f+1SSynmrOcyvlb1GKQjjgoBzElLdfXCRYX8UnBlhklOHYRQ==", 11 | "dev": true, 12 | "requires": { 13 | "tslib": "~2.0.1" 14 | }, 15 | "dependencies": { 16 | "tslib": { 17 | "version": "2.0.3", 18 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", 19 | "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==", 20 | "dev": true 21 | } 22 | } 23 | }, 24 | "@graphql-tools/merge": { 25 | "version": "6.2.14", 26 | "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-6.2.14.tgz", 27 | "integrity": "sha512-RWT4Td0ROJai2eR66NHejgf8UwnXJqZxXgDWDI+7hua5vNA2OW8Mf9K1Wav1ZkjWnuRp4ztNtkZGie5ISw55ow==", 28 | "dev": true, 29 | "requires": { 30 | "@graphql-tools/schema": "^7.0.0", 31 | "@graphql-tools/utils": "^7.7.0", 32 | "tslib": "~2.2.0" 33 | } 34 | }, 35 | "@graphql-tools/schema": { 36 | "version": "7.1.5", 37 | "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-7.1.5.tgz", 38 | "integrity": "sha512-uyn3HSNSckf4mvQSq0Q07CPaVZMNFCYEVxroApOaw802m9DcZPgf9XVPy/gda5GWj9AhbijfRYVTZQgHnJ4CXA==", 39 | "dev": true, 40 | "requires": { 41 | "@graphql-tools/utils": "^7.1.2", 42 | "tslib": "~2.2.0", 43 | "value-or-promise": "1.0.6" 44 | } 45 | }, 46 | "@graphql-tools/utils": { 47 | "version": "7.10.0", 48 | "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-7.10.0.tgz", 49 | "integrity": "sha512-d334r6bo9mxdSqZW6zWboEnnOOFRrAPVQJ7LkU8/6grglrbcu6WhwCLzHb90E94JI3TD3ricC3YGbUqIi9Xg0w==", 50 | "dev": true, 51 | "requires": { 52 | "@ardatan/aggregate-error": "0.0.6", 53 | "camel-case": "4.1.2", 54 | "tslib": "~2.2.0" 55 | } 56 | }, 57 | "@nodelib/fs.scandir": { 58 | "version": "2.1.5", 59 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", 60 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", 61 | "dev": true, 62 | "requires": { 63 | "@nodelib/fs.stat": "2.0.5", 64 | "run-parallel": "^1.1.9" 65 | } 66 | }, 67 | "@nodelib/fs.stat": { 68 | "version": "2.0.5", 69 | "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", 70 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", 71 | "dev": true 72 | }, 73 | "@nodelib/fs.walk": { 74 | "version": "1.2.8", 75 | "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", 76 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", 77 | "dev": true, 78 | "requires": { 79 | "@nodelib/fs.scandir": "2.1.5", 80 | "fastq": "^1.6.0" 81 | } 82 | }, 83 | "accepts": { 84 | "version": "1.3.7", 85 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 86 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 87 | "dev": true, 88 | "requires": { 89 | "mime-types": "~2.1.24", 90 | "negotiator": "0.6.2" 91 | } 92 | }, 93 | "ansi-styles": { 94 | "version": "3.2.1", 95 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 96 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 97 | "dev": true, 98 | "requires": { 99 | "color-convert": "^1.9.0" 100 | } 101 | }, 102 | "any-promise": { 103 | "version": "1.3.0", 104 | "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", 105 | "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", 106 | "dev": true 107 | }, 108 | "array-union": { 109 | "version": "2.1.0", 110 | "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", 111 | "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", 112 | "dev": true 113 | }, 114 | "aws-sdk": { 115 | "version": "2.943.0", 116 | "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.943.0.tgz", 117 | "integrity": "sha512-1/WDupJrIB0SJEzIOf+UpqmG0AP5AXoDXhbW7CEujHerOd+/b5A1ubeHKGQJvBN4tAktgsvGpDiBRfB9MpJU5g==", 118 | "dev": true, 119 | "requires": { 120 | "buffer": "4.9.2", 121 | "events": "1.1.1", 122 | "ieee754": "1.1.13", 123 | "jmespath": "0.15.0", 124 | "querystring": "0.2.0", 125 | "sax": "1.2.1", 126 | "url": "0.10.3", 127 | "uuid": "3.3.2", 128 | "xml2js": "0.4.19" 129 | } 130 | }, 131 | "base64-js": { 132 | "version": "1.5.1", 133 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 134 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 135 | "dev": true 136 | }, 137 | "braces": { 138 | "version": "3.0.2", 139 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 140 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 141 | "dev": true, 142 | "requires": { 143 | "fill-range": "^7.0.1" 144 | } 145 | }, 146 | "buffer": { 147 | "version": "4.9.2", 148 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", 149 | "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", 150 | "dev": true, 151 | "requires": { 152 | "base64-js": "^1.0.2", 153 | "ieee754": "^1.1.4", 154 | "isarray": "^1.0.0" 155 | } 156 | }, 157 | "cache-content-type": { 158 | "version": "1.0.1", 159 | "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", 160 | "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", 161 | "dev": true, 162 | "requires": { 163 | "mime-types": "^2.1.18", 164 | "ylru": "^1.2.0" 165 | } 166 | }, 167 | "camel-case": { 168 | "version": "4.1.2", 169 | "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", 170 | "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", 171 | "dev": true, 172 | "requires": { 173 | "pascal-case": "^3.1.2", 174 | "tslib": "^2.0.3" 175 | } 176 | }, 177 | "chalk": { 178 | "version": "2.4.2", 179 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 180 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 181 | "dev": true, 182 | "requires": { 183 | "ansi-styles": "^3.2.1", 184 | "escape-string-regexp": "^1.0.5", 185 | "supports-color": "^5.3.0" 186 | } 187 | }, 188 | "co": { 189 | "version": "4.6.0", 190 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 191 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", 192 | "dev": true 193 | }, 194 | "color-convert": { 195 | "version": "1.9.3", 196 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 197 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 198 | "dev": true, 199 | "requires": { 200 | "color-name": "1.1.3" 201 | } 202 | }, 203 | "color-name": { 204 | "version": "1.1.3", 205 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 206 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 207 | "dev": true 208 | }, 209 | "commander": { 210 | "version": "2.20.3", 211 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 212 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", 213 | "dev": true 214 | }, 215 | "content-disposition": { 216 | "version": "0.5.3", 217 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 218 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 219 | "dev": true, 220 | "requires": { 221 | "safe-buffer": "5.1.2" 222 | } 223 | }, 224 | "content-type": { 225 | "version": "1.0.4", 226 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 227 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", 228 | "dev": true 229 | }, 230 | "cookies": { 231 | "version": "0.8.0", 232 | "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", 233 | "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", 234 | "dev": true, 235 | "requires": { 236 | "depd": "~2.0.0", 237 | "keygrip": "~1.1.0" 238 | } 239 | }, 240 | "cssfilter": { 241 | "version": "0.0.10", 242 | "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", 243 | "integrity": "sha1-xtJnJjKi5cg+AT5oZKQs6N79IK4=", 244 | "dev": true 245 | }, 246 | "debug": { 247 | "version": "3.1.0", 248 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 249 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 250 | "dev": true, 251 | "requires": { 252 | "ms": "2.0.0" 253 | } 254 | }, 255 | "deep-equal": { 256 | "version": "1.0.1", 257 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", 258 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", 259 | "dev": true 260 | }, 261 | "delegates": { 262 | "version": "1.0.0", 263 | "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", 264 | "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", 265 | "dev": true 266 | }, 267 | "depd": { 268 | "version": "2.0.0", 269 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 270 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 271 | "dev": true 272 | }, 273 | "destroy": { 274 | "version": "1.0.4", 275 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 276 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", 277 | "dev": true 278 | }, 279 | "dir-glob": { 280 | "version": "3.0.1", 281 | "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", 282 | "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", 283 | "dev": true, 284 | "requires": { 285 | "path-type": "^4.0.0" 286 | } 287 | }, 288 | "ee-first": { 289 | "version": "1.1.1", 290 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 291 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", 292 | "dev": true 293 | }, 294 | "encodeurl": { 295 | "version": "1.0.2", 296 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 297 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", 298 | "dev": true 299 | }, 300 | "escape-html": { 301 | "version": "1.0.3", 302 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 303 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", 304 | "dev": true 305 | }, 306 | "escape-string-regexp": { 307 | "version": "1.0.5", 308 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 309 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 310 | "dev": true 311 | }, 312 | "events": { 313 | "version": "1.1.1", 314 | "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", 315 | "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", 316 | "dev": true 317 | }, 318 | "fast-glob": { 319 | "version": "3.2.7", 320 | "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", 321 | "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", 322 | "dev": true, 323 | "requires": { 324 | "@nodelib/fs.stat": "^2.0.2", 325 | "@nodelib/fs.walk": "^1.2.3", 326 | "glob-parent": "^5.1.2", 327 | "merge2": "^1.3.0", 328 | "micromatch": "^4.0.4" 329 | } 330 | }, 331 | "fastq": { 332 | "version": "1.11.1", 333 | "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz", 334 | "integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==", 335 | "dev": true, 336 | "requires": { 337 | "reusify": "^1.0.4" 338 | } 339 | }, 340 | "fill-range": { 341 | "version": "7.0.1", 342 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 343 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 344 | "dev": true, 345 | "requires": { 346 | "to-regex-range": "^5.0.1" 347 | } 348 | }, 349 | "fresh": { 350 | "version": "0.5.2", 351 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 352 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", 353 | "dev": true 354 | }, 355 | "glob-parent": { 356 | "version": "5.1.2", 357 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 358 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 359 | "dev": true, 360 | "requires": { 361 | "is-glob": "^4.0.1" 362 | } 363 | }, 364 | "globby": { 365 | "version": "11.0.4", 366 | "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", 367 | "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", 368 | "dev": true, 369 | "requires": { 370 | "array-union": "^2.1.0", 371 | "dir-glob": "^3.0.1", 372 | "fast-glob": "^3.1.1", 373 | "ignore": "^5.1.4", 374 | "merge2": "^1.3.0", 375 | "slash": "^3.0.0" 376 | } 377 | }, 378 | "graphql": { 379 | "version": "14.7.0", 380 | "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.7.0.tgz", 381 | "integrity": "sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA==", 382 | "dev": true, 383 | "requires": { 384 | "iterall": "^1.2.2" 385 | } 386 | }, 387 | "graphql-playground-html": { 388 | "version": "1.6.29", 389 | "resolved": "https://registry.npmjs.org/graphql-playground-html/-/graphql-playground-html-1.6.29.tgz", 390 | "integrity": "sha512-fbF/zZKuw2sdfKp8gjTORJ/I9xBsqeEYRseWxBzuR15NHMptRTT9414IyRCs3ognZzUDr5MDJgx97SlLZCtQyA==", 391 | "dev": true, 392 | "requires": { 393 | "xss": "^1.0.6" 394 | } 395 | }, 396 | "graphql-playground-middleware-koa": { 397 | "version": "1.6.21", 398 | "resolved": "https://registry.npmjs.org/graphql-playground-middleware-koa/-/graphql-playground-middleware-koa-1.6.21.tgz", 399 | "integrity": "sha512-MswXglk3lfKN9OH2tYYZTrSLgOLEyw0onIxHmqYuBxRnMaXp79HSH/cvgk0oRK4N+4HjJZzSkcdhxIG0Wg8qhw==", 400 | "dev": true, 401 | "requires": { 402 | "graphql-playground-html": "^1.6.29" 403 | } 404 | }, 405 | "has-flag": { 406 | "version": "3.0.0", 407 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 408 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 409 | "dev": true 410 | }, 411 | "http-assert": { 412 | "version": "1.4.1", 413 | "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz", 414 | "integrity": "sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw==", 415 | "dev": true, 416 | "requires": { 417 | "deep-equal": "~1.0.1", 418 | "http-errors": "~1.7.2" 419 | }, 420 | "dependencies": { 421 | "depd": { 422 | "version": "1.1.2", 423 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 424 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", 425 | "dev": true 426 | }, 427 | "http-errors": { 428 | "version": "1.7.3", 429 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", 430 | "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", 431 | "dev": true, 432 | "requires": { 433 | "depd": "~1.1.2", 434 | "inherits": "2.0.4", 435 | "setprototypeof": "1.1.1", 436 | "statuses": ">= 1.5.0 < 2", 437 | "toidentifier": "1.0.0" 438 | } 439 | } 440 | } 441 | }, 442 | "http-errors": { 443 | "version": "1.8.0", 444 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", 445 | "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", 446 | "dev": true, 447 | "requires": { 448 | "depd": "~1.1.2", 449 | "inherits": "2.0.4", 450 | "setprototypeof": "1.2.0", 451 | "statuses": ">= 1.5.0 < 2", 452 | "toidentifier": "1.0.0" 453 | }, 454 | "dependencies": { 455 | "depd": { 456 | "version": "1.1.2", 457 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 458 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", 459 | "dev": true 460 | }, 461 | "setprototypeof": { 462 | "version": "1.2.0", 463 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 464 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", 465 | "dev": true 466 | } 467 | } 468 | }, 469 | "ieee754": { 470 | "version": "1.1.13", 471 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", 472 | "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", 473 | "dev": true 474 | }, 475 | "ignore": { 476 | "version": "5.1.8", 477 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", 478 | "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", 479 | "dev": true 480 | }, 481 | "inherits": { 482 | "version": "2.0.4", 483 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 484 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 485 | "dev": true 486 | }, 487 | "is-extglob": { 488 | "version": "2.1.1", 489 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 490 | "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", 491 | "dev": true 492 | }, 493 | "is-generator-function": { 494 | "version": "1.0.9", 495 | "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz", 496 | "integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==", 497 | "dev": true 498 | }, 499 | "is-glob": { 500 | "version": "4.0.1", 501 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", 502 | "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", 503 | "dev": true, 504 | "requires": { 505 | "is-extglob": "^2.1.1" 506 | } 507 | }, 508 | "is-number": { 509 | "version": "7.0.0", 510 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 511 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 512 | "dev": true 513 | }, 514 | "isarray": { 515 | "version": "1.0.0", 516 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 517 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", 518 | "dev": true 519 | }, 520 | "iterall": { 521 | "version": "1.3.0", 522 | "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.3.0.tgz", 523 | "integrity": "sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==", 524 | "dev": true 525 | }, 526 | "jmespath": { 527 | "version": "0.15.0", 528 | "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", 529 | "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=", 530 | "dev": true 531 | }, 532 | "keygrip": { 533 | "version": "1.1.0", 534 | "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", 535 | "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", 536 | "dev": true, 537 | "requires": { 538 | "tsscmp": "1.0.6" 539 | } 540 | }, 541 | "koa": { 542 | "version": "2.13.1", 543 | "resolved": "https://registry.npmjs.org/koa/-/koa-2.13.1.tgz", 544 | "integrity": "sha512-Lb2Dloc72auj5vK4X4qqL7B5jyDPQaZucc9sR/71byg7ryoD1NCaCm63CShk9ID9quQvDEi1bGR/iGjCG7As3w==", 545 | "dev": true, 546 | "requires": { 547 | "accepts": "^1.3.5", 548 | "cache-content-type": "^1.0.0", 549 | "content-disposition": "~0.5.2", 550 | "content-type": "^1.0.4", 551 | "cookies": "~0.8.0", 552 | "debug": "~3.1.0", 553 | "delegates": "^1.0.0", 554 | "depd": "^2.0.0", 555 | "destroy": "^1.0.4", 556 | "encodeurl": "^1.0.2", 557 | "escape-html": "^1.0.3", 558 | "fresh": "~0.5.2", 559 | "http-assert": "^1.3.0", 560 | "http-errors": "^1.6.3", 561 | "is-generator-function": "^1.0.7", 562 | "koa-compose": "^4.1.0", 563 | "koa-convert": "^1.2.0", 564 | "on-finished": "^2.3.0", 565 | "only": "~0.0.2", 566 | "parseurl": "^1.3.2", 567 | "statuses": "^1.5.0", 568 | "type-is": "^1.6.16", 569 | "vary": "^1.1.2" 570 | } 571 | }, 572 | "koa-compose": { 573 | "version": "4.1.0", 574 | "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", 575 | "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==", 576 | "dev": true 577 | }, 578 | "koa-convert": { 579 | "version": "1.2.0", 580 | "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz", 581 | "integrity": "sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA=", 582 | "dev": true, 583 | "requires": { 584 | "co": "^4.6.0", 585 | "koa-compose": "^3.0.0" 586 | }, 587 | "dependencies": { 588 | "koa-compose": { 589 | "version": "3.2.1", 590 | "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", 591 | "integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=", 592 | "dev": true, 593 | "requires": { 594 | "any-promise": "^1.1.0" 595 | } 596 | } 597 | } 598 | }, 599 | "lodash": { 600 | "version": "4.17.21", 601 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 602 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", 603 | "dev": true 604 | }, 605 | "lower-case": { 606 | "version": "2.0.2", 607 | "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", 608 | "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", 609 | "dev": true, 610 | "requires": { 611 | "tslib": "^2.0.3" 612 | } 613 | }, 614 | "media-typer": { 615 | "version": "0.3.0", 616 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 617 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", 618 | "dev": true 619 | }, 620 | "merge2": { 621 | "version": "1.4.1", 622 | "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", 623 | "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", 624 | "dev": true 625 | }, 626 | "micromatch": { 627 | "version": "4.0.4", 628 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", 629 | "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", 630 | "dev": true, 631 | "requires": { 632 | "braces": "^3.0.1", 633 | "picomatch": "^2.2.3" 634 | } 635 | }, 636 | "mime-db": { 637 | "version": "1.48.0", 638 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", 639 | "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", 640 | "dev": true 641 | }, 642 | "mime-types": { 643 | "version": "2.1.31", 644 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", 645 | "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", 646 | "dev": true, 647 | "requires": { 648 | "mime-db": "1.48.0" 649 | } 650 | }, 651 | "moment": { 652 | "version": "2.29.1", 653 | "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", 654 | "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", 655 | "dev": true 656 | }, 657 | "ms": { 658 | "version": "2.0.0", 659 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 660 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 661 | "dev": true 662 | }, 663 | "negotiator": { 664 | "version": "0.6.2", 665 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 666 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", 667 | "dev": true 668 | }, 669 | "no-case": { 670 | "version": "3.0.4", 671 | "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", 672 | "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", 673 | "dev": true, 674 | "requires": { 675 | "lower-case": "^2.0.2", 676 | "tslib": "^2.0.3" 677 | } 678 | }, 679 | "on-finished": { 680 | "version": "2.3.0", 681 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 682 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 683 | "dev": true, 684 | "requires": { 685 | "ee-first": "1.1.1" 686 | } 687 | }, 688 | "only": { 689 | "version": "0.0.2", 690 | "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", 691 | "integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q=", 692 | "dev": true 693 | }, 694 | "parseurl": { 695 | "version": "1.3.3", 696 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 697 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 698 | "dev": true 699 | }, 700 | "pascal-case": { 701 | "version": "3.1.2", 702 | "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", 703 | "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", 704 | "dev": true, 705 | "requires": { 706 | "no-case": "^3.0.4", 707 | "tslib": "^2.0.3" 708 | } 709 | }, 710 | "path-type": { 711 | "version": "4.0.0", 712 | "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", 713 | "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", 714 | "dev": true 715 | }, 716 | "picomatch": { 717 | "version": "2.3.0", 718 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", 719 | "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", 720 | "dev": true 721 | }, 722 | "punycode": { 723 | "version": "1.3.2", 724 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", 725 | "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", 726 | "dev": true 727 | }, 728 | "querystring": { 729 | "version": "0.2.0", 730 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", 731 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", 732 | "dev": true 733 | }, 734 | "queue-microtask": { 735 | "version": "1.2.3", 736 | "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", 737 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", 738 | "dev": true 739 | }, 740 | "ramda": { 741 | "version": "0.25.0", 742 | "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz", 743 | "integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==", 744 | "dev": true 745 | }, 746 | "reusify": { 747 | "version": "1.0.4", 748 | "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", 749 | "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", 750 | "dev": true 751 | }, 752 | "run-parallel": { 753 | "version": "1.2.0", 754 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", 755 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", 756 | "dev": true, 757 | "requires": { 758 | "queue-microtask": "^1.2.2" 759 | } 760 | }, 761 | "safe-buffer": { 762 | "version": "5.1.2", 763 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 764 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 765 | "dev": true 766 | }, 767 | "sax": { 768 | "version": "1.2.1", 769 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", 770 | "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=", 771 | "dev": true 772 | }, 773 | "serverless-appsync-plugin": { 774 | "version": "1.11.3", 775 | "resolved": "https://registry.npmjs.org/serverless-appsync-plugin/-/serverless-appsync-plugin-1.11.3.tgz", 776 | "integrity": "sha512-XePsEKUYuSsJh7IE3ZGXhuHmGBJ5qrz1OcLWJ/mYFwVCd5CaajGmhCLSZU5641lRTh+Emozy5z5yKaGxYsF2HA==", 777 | "dev": true, 778 | "requires": { 779 | "@graphql-tools/merge": "^6.2.11", 780 | "aws-sdk": "^2.881.0", 781 | "chalk": "^2.4.2", 782 | "globby": "^11.0.3", 783 | "graphql": "^14.7.0", 784 | "graphql-playground-middleware-koa": "^1.6.21", 785 | "koa": "^2.13.1", 786 | "lodash": "^4.17.20", 787 | "moment": "^2.29.1", 788 | "ramda": "^0.25.0" 789 | } 790 | }, 791 | "setprototypeof": { 792 | "version": "1.1.1", 793 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 794 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", 795 | "dev": true 796 | }, 797 | "slash": { 798 | "version": "3.0.0", 799 | "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", 800 | "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", 801 | "dev": true 802 | }, 803 | "statuses": { 804 | "version": "1.5.0", 805 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 806 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", 807 | "dev": true 808 | }, 809 | "supports-color": { 810 | "version": "5.5.0", 811 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 812 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 813 | "dev": true, 814 | "requires": { 815 | "has-flag": "^3.0.0" 816 | } 817 | }, 818 | "to-regex-range": { 819 | "version": "5.0.1", 820 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 821 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 822 | "dev": true, 823 | "requires": { 824 | "is-number": "^7.0.0" 825 | } 826 | }, 827 | "toidentifier": { 828 | "version": "1.0.0", 829 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 830 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", 831 | "dev": true 832 | }, 833 | "tslib": { 834 | "version": "2.2.0", 835 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", 836 | "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", 837 | "dev": true 838 | }, 839 | "tsscmp": { 840 | "version": "1.0.6", 841 | "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", 842 | "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", 843 | "dev": true 844 | }, 845 | "type-is": { 846 | "version": "1.6.18", 847 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 848 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 849 | "dev": true, 850 | "requires": { 851 | "media-typer": "0.3.0", 852 | "mime-types": "~2.1.24" 853 | } 854 | }, 855 | "url": { 856 | "version": "0.10.3", 857 | "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", 858 | "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", 859 | "dev": true, 860 | "requires": { 861 | "punycode": "1.3.2", 862 | "querystring": "0.2.0" 863 | } 864 | }, 865 | "uuid": { 866 | "version": "3.3.2", 867 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 868 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", 869 | "dev": true 870 | }, 871 | "value-or-promise": { 872 | "version": "1.0.6", 873 | "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.6.tgz", 874 | "integrity": "sha512-9r0wQsWD8z/BxPOvnwbPf05ZvFngXyouE9EKB+5GbYix+BYnAwrIChCUyFIinfbf2FL/U71z+CPpbnmTdxrwBg==", 875 | "dev": true 876 | }, 877 | "vary": { 878 | "version": "1.1.2", 879 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 880 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", 881 | "dev": true 882 | }, 883 | "xml2js": { 884 | "version": "0.4.19", 885 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", 886 | "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", 887 | "dev": true, 888 | "requires": { 889 | "sax": ">=0.6.0", 890 | "xmlbuilder": "~9.0.1" 891 | } 892 | }, 893 | "xmlbuilder": { 894 | "version": "9.0.7", 895 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", 896 | "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", 897 | "dev": true 898 | }, 899 | "xss": { 900 | "version": "1.0.9", 901 | "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.9.tgz", 902 | "integrity": "sha512-2t7FahYnGJys6DpHLhajusId7R0Pm2yTmuL0GV9+mV0ZlaLSnb2toBmppATfg5sWIhZQGlsTLoecSzya+l4EAQ==", 903 | "dev": true, 904 | "requires": { 905 | "commander": "^2.20.3", 906 | "cssfilter": "0.0.10" 907 | } 908 | }, 909 | "ylru": { 910 | "version": "1.2.1", 911 | "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz", 912 | "integrity": "sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ==", 913 | "dev": true 914 | } 915 | } 916 | } 917 | -------------------------------------------------------------------------------- /backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "handler.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "serverless-appsync-plugin": "^1.11.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /backend/resources.yml: -------------------------------------------------------------------------------- 1 | # Book table 2 | booksTable: 3 | Type: "AWS::DynamoDB::Table" 4 | Properties: 5 | AttributeDefinitions: 6 | - AttributeName: "bookId" 7 | AttributeType: "S" 8 | BillingMode: "PAY_PER_REQUEST" 9 | KeySchema: 10 | - AttributeName: "bookId" 11 | KeyType: "HASH" 12 | Tags: 13 | - Key: "Name" 14 | Value: "books-table" 15 | 16 | # Order table 17 | orderTable: 18 | Type: "AWS::DynamoDB::Table" 19 | Properties: 20 | AttributeDefinitions: 21 | - AttributeName: "userId" 22 | AttributeType: "S" 23 | - AttributeName: "orderId" 24 | AttributeType: "S" 25 | - AttributeName: "bookId" 26 | AttributeType: "S" 27 | - AttributeName: "createdAt" 28 | AttributeType: "S" 29 | BillingMode: "PAY_PER_REQUEST" 30 | KeySchema: 31 | - AttributeName: "userId" 32 | KeyType: "HASH" 33 | - AttributeName: "orderId" 34 | KeyType: "RANGE" 35 | GlobalSecondaryIndexes: 36 | - IndexName: "byOrder" 37 | KeySchema: 38 | - AttributeName: "bookId" 39 | KeyType: "HASH" 40 | - AttributeName: "createdAt" 41 | KeyType: "RANGE" 42 | Projection: 43 | ProjectionType: "ALL" 44 | Tags: 45 | - Key: "Name" 46 | Value: "order-table" 47 | 48 | # Cognito user pool 49 | cognitoUserPool: 50 | Type: "AWS::Cognito::UserPool" 51 | Properties: 52 | UsernameAttributes: 53 | - "email" 54 | UserPoolName: "YouTubeBookstoreUserpool" 55 | 56 | # Cognito user pool client 57 | cognitoUserPoolClient: 58 | Type: "AWS::Cognito::UserPoolClient" 59 | Properties: 60 | ClientName: "web" 61 | UserPoolId: !Ref cognitoUserPool 62 | 63 | # Cognito user pool user group 64 | cognitoCustomerGroup: 65 | Type: "AWS::Cognito::UserPoolGroup" 66 | Properties: 67 | Description: "Customers belong to this group" 68 | GroupName: "customer" 69 | Precedence: 1 70 | RoleArn: !GetAtt cognitoCustomerIAMRole.Arn 71 | UserPoolId: !Ref cognitoUserPool 72 | 73 | # Congnito admin IAM role 74 | cognitoCustomerIAMRole: 75 | Type: "AWS::IAM::Role" 76 | Properties: 77 | RoleName: "youtube-bookstore-customer-role" 78 | Description: "IAM role for customers" 79 | AssumeRolePolicyDocument: 80 | Version: "2012-10-17" 81 | Statement: 82 | - Effect: "Allow" 83 | Principal: 84 | Federated: 85 | - "cognito-identity.amazonaws.com" 86 | Action: 87 | - "sts:AssumeRoleWithWebIdentity" 88 | Policies: 89 | - PolicyName: "youtube-bookstore-customer-group-policy" 90 | PolicyDocument: 91 | Version: "2012-10-17" 92 | Statement: 93 | - Effect: "Allow" 94 | Action: 95 | - "dynamodb:*" 96 | Resource: 97 | - !GetAtt orderTable.Arn 98 | - Effect: "Allow" 99 | Action: 100 | - "dynamodb:GetItem" 101 | - "dynamodb:BatchGetItem" 102 | - "dynamodb:Query" 103 | Resource: 104 | - !GetAtt booksTable.Arn 105 | 106 | # Cognito user pool admin group 107 | cognitoAdminGroup: 108 | Type: "AWS::Cognito::UserPoolGroup" 109 | Properties: 110 | Description: "Admin users belong to this group" 111 | GroupName: "admin" 112 | Precedence: 0 113 | RoleArn: !GetAtt cognitoAdminIAMRole.Arn 114 | UserPoolId: !Ref cognitoUserPool 115 | 116 | # Congnito admin IAM role 117 | cognitoAdminIAMRole: 118 | Type: "AWS::IAM::Role" 119 | Properties: 120 | RoleName: "youtube-bookstore-admin-role" 121 | Description: "IAM role for admin users" 122 | AssumeRolePolicyDocument: 123 | Version: "2012-10-17" 124 | Statement: 125 | - Effect: "Allow" 126 | Principal: 127 | Federated: 128 | - "cognito-identity.amazonaws.com" 129 | Action: 130 | - "sts:AssumeRoleWithWebIdentity" 131 | Policies: 132 | - PolicyName: "youtube-bookstore-admin-group-policy" 133 | PolicyDocument: 134 | Version: "2012-10-17" 135 | Statement: 136 | - Effect: "Allow" 137 | Action: 138 | - "dynamodb:*" 139 | Resource: 140 | - !GetAtt booksTable.Arn 141 | - !GetAtt orderTable.Arn 142 | 143 | # Congnito admin IAM role 144 | cognitoUnauthIAMRole: 145 | Type: "AWS::IAM::Role" 146 | Properties: 147 | RoleName: "youtube-bookstore-unauth-role" 148 | Description: "IAM role for guest users" 149 | AssumeRolePolicyDocument: 150 | Version: "2012-10-17" 151 | Statement: 152 | - Effect: "Allow" 153 | Principal: 154 | Federated: 155 | - "cognito-identity.amazonaws.com" 156 | Action: 157 | - "sts:AssumeRoleWithWebIdentity" 158 | Policies: 159 | - PolicyName: "youtube-bookstore-unauth-user-policy" 160 | PolicyDocument: 161 | Version: "2012-10-17" 162 | Statement: 163 | - Effect: "Allow" 164 | Action: 165 | - "appsync:GraphQL" 166 | Resource: 167 | - "arn:aws:appsync:us-west-1:885121665536:apis/4est5xj75fgfhkwrqfujp35rgq/types/Query/fields/getBookById" 168 | 169 | cognitoIdentityPoolRoleAttachment: 170 | Type: AWS::Cognito::IdentityPoolRoleAttachment 171 | Properties: 172 | IdentityPoolId: !Ref cognitoIdentityPool 173 | Roles: 174 | unauthenticated: !GetAtt cognitoUnauthIAMRole.Arn 175 | 176 | cognitoIdentityPool: 177 | Type: AWS::Cognito::IdentityPool 178 | Properties: 179 | AllowUnauthenticatedIdentities: true 180 | CognitoIdentityProviders: 181 | - ClientId: !Ref cognitoUserPoolClient 182 | ProviderName: !GetAtt cognitoUserPool.ProviderName 183 | IdentityPoolName: YoutubeBookStoreIdentityPool -------------------------------------------------------------------------------- /backend/schema.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: Query, 3 | mutation: Mutation 4 | } 5 | 6 | type Query { 7 | getBookById(bookId: ID!): Book! @aws_iam 8 | listBooks(limit: Int!, nextToken: String): BooksPage! 9 | myOrders(limit: Int!, nextToken: String): orderItemsPage! 10 | } 11 | 12 | type orderItemsPage { 13 | orderItems: [OrderItem] 14 | nextToken: String 15 | } 16 | 17 | type OrderItem { 18 | userId: ID! 19 | orderId: ID! 20 | book: Book! 21 | quantity: Int! 22 | } 23 | 24 | type BooksPage { 25 | books: [Book] 26 | nextToken: String 27 | } 28 | 29 | type Book @aws_iam @aws_cognito_user_pools { 30 | bookId: ID! 31 | title: String! 32 | description: String 33 | imageUrl: AWSURL 34 | author: String! 35 | price: Float! 36 | createdAt: AWSDateTime 37 | updatedAt: AWSDateTime 38 | } 39 | 40 | type Mutation { 41 | createBook(newBook: BookInput): Book! @aws_auth(cognito_groups: ["admin"]) 42 | createOrder(newOrder: OrderInput): Boolean! 43 | } 44 | 45 | input OrderInput { 46 | items: [orderItemInput] 47 | } 48 | 49 | input orderItemInput { 50 | bookId: ID! 51 | quantity: Int! 52 | } 53 | 54 | input BookInput { 55 | title: String! 56 | description: String 57 | imageUrl: AWSURL 58 | author: String! 59 | price: Float! 60 | } -------------------------------------------------------------------------------- /backend/serverless.yml: -------------------------------------------------------------------------------- 1 | service: backend 2 | 3 | provider: 4 | name: aws 5 | runtime: nodejs12.x 6 | region: us-west-1 7 | stage: dev 8 | 9 | plugins: 10 | - serverless-appsync-plugin 11 | 12 | custom: 13 | appSync: 14 | name: youtubeAppSyncApi 15 | authenticationType: AMAZON_COGNITO_USER_POOLS 16 | additionalAuthenticationProviders: 17 | - authenticationType: AWS_IAM 18 | userPoolConfig: 19 | awsRegion: us-west-1 20 | defaultAction: ALLOW 21 | userPoolId: !Ref cognitoUserPool 22 | mappingTemplatesLocation: mapping-templates 23 | mappingTemplates: 24 | - type: Query 25 | field: getBookById 26 | dataSource: booksTable 27 | - type: Query 28 | field: listBooks 29 | dataSource: booksTable 30 | - type: Mutation 31 | field: createBook 32 | dataSource: booksTable 33 | dataSources: 34 | - type: AMAZON_DYNAMODB 35 | name: booksTable 36 | config: 37 | tableName: !Ref booksTable 38 | 39 | resources: 40 | Resources: 41 | ${file(resources.yml)} 42 | -------------------------------------------------------------------------------- /frontend/book-store/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /frontend/book-store/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `yarn start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `yarn test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `yarn build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `yarn eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `yarn build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /frontend/book-store/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "book-store", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@aws-amplify/ui-react": "^1.2.6", 7 | "@testing-library/jest-dom": "^5.11.4", 8 | "@testing-library/react": "^11.1.0", 9 | "@testing-library/user-event": "^12.1.10", 10 | "aws-amplify": "^4.2.0", 11 | "react": "^17.0.2", 12 | "react-dom": "^17.0.2", 13 | "react-scripts": "4.0.3", 14 | "web-vitals": "^1.0.1" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test", 20 | "eject": "react-scripts eject" 21 | }, 22 | "eslintConfig": { 23 | "extends": [ 24 | "react-app", 25 | "react-app/jest" 26 | ] 27 | }, 28 | "browserslist": { 29 | "production": [ 30 | ">0.2%", 31 | "not dead", 32 | "not op_mini all" 33 | ], 34 | "development": [ 35 | "last 1 chrome version", 36 | "last 1 firefox version", 37 | "last 1 safari version" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /frontend/book-store/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjzone/amplify-serverless-appsync-course/5e6dcc6b75053807af7097fe5841fc13c5c60c38/frontend/book-store/public/favicon.ico -------------------------------------------------------------------------------- /frontend/book-store/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /frontend/book-store/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjzone/amplify-serverless-appsync-course/5e6dcc6b75053807af7097fe5841fc13c5c60c38/frontend/book-store/public/logo192.png -------------------------------------------------------------------------------- /frontend/book-store/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mjzone/amplify-serverless-appsync-course/5e6dcc6b75053807af7097fe5841fc13c5c60c38/frontend/book-store/public/logo512.png -------------------------------------------------------------------------------- /frontend/book-store/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /frontend/book-store/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /frontend/book-store/src/App.css: -------------------------------------------------------------------------------- 1 | .book-section { 2 | margin: 10px; 3 | } -------------------------------------------------------------------------------- /frontend/book-store/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { API, graphqlOperation } from 'aws-amplify'; 3 | import { withAuthenticator, AmplifySignOut } from '@aws-amplify/ui-react'; 4 | import { getBookById } from "./graphql/queries/book"; 5 | import './App.css'; 6 | 7 | function App() { 8 | 9 | const [book, setBook] = useState(null); 10 | 11 | const getBook = async () => { 12 | // make a call to appsync api 13 | // const book = await API.graphql(graphqlOperation(getBookById, { id: "97d97d2d-87b6-4e81-97da-8a63a1f8ae9f" })); 14 | 15 | const book = await API.graphql({ 16 | query: getBookById, 17 | variables: { id: "97d97d2d-87b6-4e81-97da-8a63a1f8ae9f" }, 18 | authMode: 'AWS_IAM' 19 | }); 20 | 21 | setBook(book.data.getBookById); 22 | } 23 | 24 | const viewBook = () => { 25 | if (book) { 26 | return (
27 |

{book.title}

28 |

{book.description}

29 |

{book.author}

30 |

{book.price}

31 |
) 32 | } 33 | } 34 | 35 | return ( 36 |
37 | {/* */} 38 |
39 | 40 |
41 | {viewBook()} 42 |
43 |
44 | ); 45 | } 46 | 47 | export default App; 48 | -------------------------------------------------------------------------------- /frontend/book-store/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /frontend/book-store/src/graphql/queries/book.js: -------------------------------------------------------------------------------- 1 | export const getBookById = ` 2 | query getBookById($id: ID!) { 3 | getBookById(bookId: $id) { 4 | author 5 | bookId 6 | price 7 | description 8 | title 9 | } 10 | } 11 | ` -------------------------------------------------------------------------------- /frontend/book-store/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /frontend/book-store/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | 6 | import Amplify from 'aws-amplify'; 7 | 8 | Amplify.configure({ 9 | Auth: { 10 | region: 'us-west-1', 11 | userPoolId: 'us-west-1_Iis5WeHjr', 12 | identityPoolId: 'us-west-1:0f20c5f8-269c-48f8-86d4-2d1d05910a49', 13 | userPoolWebClientId: '185lnnpppjmo5uvaa3it8u3me3', 14 | mandatorySignIn: false 15 | } 16 | }); 17 | 18 | const myAppConfig = { 19 | 'aws_appsync_graphqlEndpoint': 'https://lca3cmhgnbejfdwtjqiqgwxjxq.appsync-api.us-west-1.amazonaws.com/graphql', 20 | 'aws_appsync_region': 'us-west-1', 21 | 'aws_appsync_authenticationType': 'AMAZON_COGNITO_USER_POOLS' 22 | } 23 | 24 | Amplify.configure(myAppConfig); 25 | 26 | ReactDOM.render( 27 | 28 | 29 | , 30 | document.getElementById('root') 31 | ); 32 | 33 | -------------------------------------------------------------------------------- /frontend/book-store/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/book-store/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /frontend/book-store/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /new-schema.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: Query, 3 | mutation: Mutation 4 | } 5 | 6 | type Query { 7 | getBookById(bookId: ID!): Book! 8 | listBooks(limit: Int!, nextToken: String): BooksPage! 9 | myOrders(limit: Int!, nextToken: String): orderPage! 10 | } 11 | 12 | type orderPage { 13 | orders: [Order] 14 | nextToken: String 15 | } 16 | 17 | type Order { 18 | orderId: ID! 19 | userId: ID! 20 | orderItems: [OrderItem] 21 | beforeTax: Float 22 | afterTax: Float 23 | discount: Float 24 | shippingAddress: String 25 | billingAddress: String 26 | } 27 | 28 | type OrderItem { 29 | orderItemId: ID! 30 | book: Book! 31 | quantity: Int! 32 | } 33 | 34 | type BooksPage { 35 | books: [Book] 36 | nextToken: String 37 | } 38 | 39 | type Book { 40 | bookId: ID! 41 | title: String! 42 | description: String 43 | imageUrl: AWSURL 44 | author: String! 45 | price: Float! 46 | createdAt: AWSDateTime 47 | updatedAt: AWSDateTime 48 | } 49 | 50 | type Mutation { 51 | createBook(newBook: BookInput): Book! @aws_auth(cognito_groups: ["admin"]) 52 | createOrder(newOrder: OrderInput): Boolean! 53 | } 54 | 55 | input OrderInput { 56 | cart: [cartItem] 57 | shippingAddress: String! 58 | } 59 | 60 | type cartItem { 61 | bookId: ID! 62 | quantity: Int! 63 | } 64 | 65 | input BookInput { 66 | title: String! 67 | description: String 68 | imageUrl: AWSURL 69 | author: String! 70 | price: Float! 71 | } --------------------------------------------------------------------------------