A dynamic blog built with ReactJS and ExpressJS for Node.
- Node (preferably
v9.5
+) - AWS CLI
- AWS account access with DynamoDB and S3 configured (see From Scratch Setup Instructions)
Install Server:
$ npm install
Install Client:
$ npm run install:client
Run Server and Client in dev mode:
$ npm start
Client will be exposed on localhost:3000
, Server on localhost:4000
and localhost:3000/api/
Run all tests (unit and acceptance) on Server and Client:
$ npm test
Deploy to lambda(must be already created):
$ npm run deploy
Start (will serve client from client build folder):
$ npm run start:server
Build Client:
$ npm run build:client
For more Client commands see client/README.md
Run unit tests:
$ npm run test:server:unit
Run acceptance tests (uses postman CLI newman
):
$ npm run test:server:api
Run all tests:
$ npm run test:server
- Configuring AWS Javascript SDK
- ClaudiJS (lambda deployment tool)
- DyanmoDB Javascript SDK Docs
- S3 Javascript SDK
- Newman (Postman CLI)
-
Create AWS user with the following permissions attached:
AWSLambdaFullAccess
AmazonS3FullAccess
AmazonDynamoDBFullAccess
AWSCloudTrailFullAccess
AmazonAPIGatewayAdministrator
AWSCloudFormationFullAccess
-
Add the AWS profile
splendid-blog
with the access keys for the above user to your~/.aws/credentials
file (used by CLI) -
Create the AWS role
splendid-blog-lambda
(to be used by lambda) with the following permissions attached:AWSLambdaFullAccess
AmazonS3FullAccess
AmazonDynamoDBFullAccess
AmazonAPIGatewayAdministrator
-
Create the S3 and DynamoDB infrastructure resources by running:
$ npm run create:infrastructure
-
Create the lambda instance with the Server and Client (
client/build
directory) deployed:$ npm run create:lambda-instance