Skip to content

bahsim/nodejs-aws-shop-react

 
 

Repository files navigation

Getting Started

This project is a React-based e-commerce application deployed using AWS services. It leverages AWS CDK for infrastructure management and provides a set of scripts to facilitate development, testing, and deployment.

To get started with this project, follow these steps:

AWS Configuration

Prerequisites

Before deploying this application, you need to configure your AWS credentials. Make sure you have:

  • AWS CLI installed (npm install -g aws-cdk)
  • An AWS account
  • Access Key ID and Secret Access Key with appropriate permissions

Configure AWS Credentials

  1. Run AWS configure command:
aws configure
AWS Access Key ID [None]: YOUR_ACCESS_KEY [[1]](https://docs.aws.amazon.com/prescriptive-guidance/latest/modernization-net-applications-security/iam-development.html)
AWS Secret Access Key [None]: YOUR_SECRET_KEY [[2]](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/deployment-beanstalk-specify-credentials.html)
Default region name [None]: us-east-1
Default output format [None]: json

# Verify configuration
aws configure list

# Configure named profiles (optional)
aws configure --profile dev
aws configure --profile prod

# Use specific profile
aws configure list --profile dev

CDK Bootstrap

Before deploying CDK applications for the first time in an AWS environment (account/region), you need to bootstrap the environment:

cdk bootstrap

Deploying with AWS CDK

  • Deploy the project using AWS CDK:

    npm run cdk:deploy
  • Destroy the deployed resources using AWS CDK:

    npm run cdk:destroy

Prerequisites

Make sure you have the following installed on your machine:

  • Node.js (version 14.0.0 or higher)
  • npm (version 6 or higher)
  • AWS CLI (configured with appropriate credentials)
  • AWS CDK (version 2.178.2 or higher)

Environment Setup

Before you begin, ensure your environment is set up correctly:

  1. Configure AWS CLI:

    aws configure

    Follow the prompts to set up your AWS credentials.

  2. Install AWS CDK globally:

    npm install -g aws-cdk
  3. Bootstrap your AWS environment:

    cdk bootstrap

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/nodejs-aws-shop-react.git
  2. Navigate to the project directory:
    cd nodejs-aws-shop-react
  3. Install the dependencies:
    npm install --legacy-peer-deps

Running the Project

To run the project, you can use the following scripts:

  • Start the project in development mode:

    npm run start
  • Build the project:

    npm run build
  • Preview the production build:

    npm run preview
  • Run tests:

    npm run test
  • Run tests with UI:

    npm run test:ui
  • Run tests with coverage:

    npm run test:coverage
  • Lint the code:

    npm run lint
  • Format code with Prettier:

    npm run prettier
  • Deploy the application using AWS CDK:

    npm run cdk:deploy
  • Destroy the deployed AWS resources:

    npm run cdk:destroy

Now you are ready to start developing with the React-shop-cloudfront project!

About

React Frontend for NodeJS in AWS course

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 85.0%
  • JavaScript 14.5%
  • HTML 0.5%