Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements for local dev setup #5

Closed
wants to merge 13 commits into from
12 changes: 7 additions & 5 deletions docs/packages/feedback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ This Lambda function stores and retrieves page feedback using DynamoDB.

## Prerequisites

Create an AWS profile in ~/.aws/credentials called "claudia" with credentials corresponding to an IAM user with AWSLambdaFullAccess and IAMFullAccess policies.
Create an AWS profile in ~/.aws/credentials called "claudia" with credentials corresponding to an IAM user with AmazonAPIGatewayAdministrator, AWSLambdaFullAccess and IAMFullAccess policies.
mbrookes marked this conversation as resolved.
Show resolved Hide resolved
You can do that with `aws configure --profile claudia`.
mbrookes marked this conversation as resolved.
Show resolved Hide resolved

Create a table in DynamoDB, with a `string` partition key called `id`, and a sort key called `page`. You can do that from the DynamoDB web console, or using the AWS CLI command line. Here is an example command that will create the `feedback-dev` table with the minimal provisioned throughput:

Expand Down Expand Up @@ -39,13 +40,14 @@ The project includes an IAM access policy that will grant the lambda function ac

> ⚠️ When setting up for the first time, you will need to delete the included `claudia.json` file that is specific to the MUI installation. It is only included here for ease of access.

To set this up, first [set up the credentials](https://github.com/claudiajs/claudia/blob/master/getting_started.md#configuring-access-credentials), then:
To set this up, first [set up the credentials](https://claudiajs.com/tutorials/installing.html#configuring-access-credentials), then:

1. run `yarn install` to install the dependencies
2. run `yarn setup` to create the lambda project under the default name on AWS.
1. run `yarn install` (from the root workspace) to install the dependencies
1. Navigate into the directory of this readme e.g. `cd docs/packages/feedback`
eps1lon marked this conversation as resolved.
Show resolved Hide resolved
1. run `yarn setup` to create the lambda project under the default name on AWS.
eps1lon marked this conversation as resolved.
Show resolved Hide resolved
This will also ask you for a table name for development and production.
If you used the above AWS command, they will be `feedback-dev` and `feedback-dev` respectively.
3. Test the API with using the [example requests below](#testing)
1. Test the API with using the [example requests below](#testing)
eps1lon marked this conversation as resolved.
Show resolved Hide resolved

For subsequent updates, use the `npm run deploy` command.

Expand Down
11 changes: 4 additions & 7 deletions docs/packages/feedback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
"name": "feedback",
"version": "1.0.0",
"description": "Store and retrieve page ratings and comments",
"main": "index",
"main": "./index.js",
"license": "MIT",
"author": "Material-UI Team",
"private": true,
"files": [
"*.js"
],
eps1lon marked this conversation as resolved.
Show resolved Hide resolved
"scripts": {
"claudia": "claudia --profile claudia",
"curl": "curl -H \"Content-Type: application/json\" -X POST --data @example.json https://hgvi836wi8.execute-api.us-east-1.amazonaws.com/dev/rating",
Expand All @@ -19,10 +16,10 @@
},
"dependencies": {
"aws-sdk": "^2.766.0",
"claudia-api-builder": "^4",
"uuid": "3.3.2"
"claudia-api-builder": "^4.1.2",
mbrookes marked this conversation as resolved.
Show resolved Hide resolved
"uuid": "^3.3.2"
eps1lon marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"claudia": "^5"
"claudia": "^5.12.0"
eps1lon marked this conversation as resolved.
Show resolved Hide resolved
}
}
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5036,12 +5036,12 @@ [email protected], classnames@^2.2.5, classnames@^2.2.6:
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==

claudia-api-builder@^4:
claudia-api-builder@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/claudia-api-builder/-/claudia-api-builder-4.1.2.tgz#a44479ee44d41936c0bf68c2fe9c8d30f3f31daf"
integrity sha512-xXS9ew32KRJSMQGHMTEsvSkd1FTs9GK3JjiBIuxk9EJz2hubryrWiTzsJQvcVcfBYE0fb7bO+ZhH2/fqqG7Acg==

claudia@^5:
claudia@^5.12.0:
version "5.12.0"
resolved "https://registry.yarnpkg.com/claudia/-/claudia-5.12.0.tgz#774e05d00d29cb6064d19da1c0d4a4713f2836e0"
integrity sha512-ukgOGUNeIaU23xQB5r41AqGPAcq8bBd5LGz4Q880aRgGSW6VGHVMD/srsZcWM6mP4XKSmaofHzmJfoIXSmlJFg==
Expand Down