/splendid-blog

Using ReactJS and Express for NodeJS to create a dynamic blog website from which April Mathison can express her thoughts and creativity!

Primary LanguageJavaScript

Splendid-Blog

A dynamic blog built with ReactJS and ExpressJS for Node.

Prerequisites

Getting Started

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

Server Commands

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

References

From Scratch Setup

  1. Create AWS user with the following permissions attached:

    • AWSLambdaFullAccess
    • AmazonS3FullAccess
    • AmazonDynamoDBFullAccess
    • AWSCloudTrailFullAccess
    • AmazonAPIGatewayAdministrator
    • AWSCloudFormationFullAccess
  2. Add the AWS profile splendid-blog with the access keys for the above user to your ~/.aws/credentials file (used by CLI)

  3. Create the AWS role splendid-blog-lambda (to be used by lambda) with the following permissions attached:

    • AWSLambdaFullAccess
    • AmazonS3FullAccess
    • AmazonDynamoDBFullAccess
    • AmazonAPIGatewayAdministrator
  4. Create the S3 and DynamoDB infrastructure resources by running:

    $ npm run create:infrastructure
  5. Create the lambda instance with the Server and Client (client/build directory) deployed:

    $ npm run create:lambda-instance