Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

VITE_API_PATHS_PRODUCT=https://d2xksn4h3reedh.cloudfront.net/dev
VITE_API_PATHS_ORDER=https://d2xksn4h3reedh.cloudfront.net/dev
VITE_API_PATHS_IMPORT=https://d2xksn4h3reedh.cloudfront.net/dev
VITE_API_PATHS_BFF=https://d2xksn4h3reedh.cloudfront.net/dev
VITE_API_PATHS_CARD=https://d2xksn4h3reedh.cloudfront.net/dev
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.env
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@


### Task 2.1 (Manual Deployment)
- [x] In the AWS Console create and configure an S3 bucket where you will host your app.
- bucket name: `rs-app-test-1`
- region: `us-east-1`
- [x] Build and manually upload the MyShop.
- [x] Create a CloudFront distribution for your app.
- [x] Make some minor but visible changes in the app.
- Commented `import.meta.env.DEV` to render product list in production.
### Task 2.2 (Automated Deployment)
- [x] Add and configure S3 bucket creation and website deployment using AWS CDK.
- [x] Add necessary npm script(s) to build and deploy your app from your machine in an automated way.
- `yarn build` - Build application.
- `yarn deploy:s3` - separately upload **dist** folder to **S3**.
- [x] Destroy the created AWS infrastructure (S3 bucket and CloudFront distribution) from the previous part and steps.
Make sure nothing is left.
- [x] Add and configure CloudFront Distribution and Invalidation using AWS CDK. Add necessary npm script(s) to build,
upload to your S3 bucket, and invalidate CloudFront cache from your machine in an automated way.
- `yarn deploy:cf` - separately **CloudFront** invalidation.
- `yarn deploy` Build application. Completely upload **dist** folder to **S3**. **CloudFront** invalidation.
### Task 2.3:
- Store the links to CloudFront URL and S3-website in README.md file.
- [x] URL S3-website. - http://rs-app-test-1.s3-website-us-east-1.amazonaws.com/
- [x] URL CloudFront - https://d2xksn4h3reedh.cloudfront.net/
- [x] Commit all your work to separate branch (e.g. task-2 from the latest main) in your own repository.

# React-shop-cloudfront

This is frontend starter project for nodejs-aws mentoring program. It uses the following technologies:
Expand Down
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "my-store-app",
"name": "games-store-app",
"version": "1.0.0",
"private": true,
"scripts": {
Expand All @@ -10,7 +10,11 @@
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
"lint": "eslint --ignore-path .gitignore --fix src",
"prettier": "prettier src --write"
"prettier": "prettier src --write",
"deploy:s3": "aws s3 sync ./dist s3://rs-app-test-1 --delete",
"deploy:cf": "aws cloudfront create-invalidation --distribution-id E3R7RHS9YHI5PW --paths '/*'",
"deploy": "yarn build && yarn deploy:s3 && yarn deploy:cf",
"create-cloudfront": "node createCloudFront.js"
},
"dependencies": {
"@emotion/react": "^11.9.3",
Expand Down Expand Up @@ -43,14 +47,16 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"jsdom": "^20.0.0",
"msw": "^0.43.1",
"msw": "^2.7.0",
"prettier": "2.7.1",
"typescript": "^4.7.4",
"vite": "^2.9.13",
"vitest": "^0.17.1"
},
"msw": {
"workerDirectory": "public"
"workerDirectory": [
"public"
]
},
"engines": {
"node": ">=14.0.0"
Expand Down
Loading