The project is a web application which is a shop based on AWS. The two parts are:
- Frontend(UI) in React + TypeScript + Vite
- Backend in AWS + CDK + TypeScript
⚠️ The application will still be improved
- CI\CD
- Tests
- Cognito
- API gateway
- Step Functions
- Lambda
- Event Bridge
- DynamoDB
- RDS
- Amplify
- The user establishes connection by websocket
- ConnectionId(websocket connection identifier) and executionName(placer order execution identifier) are saved in database "Connection Table"
- The user sends request place order by REST API with orderId(order already created) and executionName.
- AWS Step function workflow is started:
- (order case) get order
- (warehouse case) check, reserve products in warehouse
- (payment case) check user has enough money to fulfil order and charge them
- (shipment/warehouse revert case) if payment success - prepare shipment. Else if payment error - revert products to the warehouse
- (finalization case) update order status in order, handle errors when any occur
- Send result message about success or error to the event bridge
- Finding connectionId in database "Connection Table" by the executionName and send result message to the user by the websocket
- create user account
- create and manage products
- place order
- get fulfilment orders
- managing user bank account - deposit, withdraw money
1.Go to the backend directory
cd backend
2.Install dependencies
npm install
3.Deploy all stacks along with generating cdk-outputs.json file in the UI location, with information about provisioned infrastructure, which are imported for integration with backend app (without asking about grant access).
npm run deploy-all
4.Go to the UI directory
cd ./../ui/
5.Install dependencies
npm install
6.Build the UI
npm run build
7.Go to the backend directory
cd ./../backend
8.Deploy the UI
npm run deploy-ui
9.Find URL by:
- from terminal under the key FinderUrl
- in the file backend/cdk-outputs.json under the key FinderUrl
Paste it in the browser
1.Go to the login page and click "Create account". You can create user for two roles:
- User (placing order)
- Admin (can do that what can do user + managing products)
⚠️ Don't forget to verify your email!!
Remember to choose "y" to continue process of removing resources
npm run destroy-all