This repository contains an Ecommerce application built using AWS Cloud Development Kit (CDK) and Python. The application leverages various AWS services to provide functionalities like managing product inventory, processing orders, and handling user interactions.
- AWS Cloud Development Kit (CDK)
- Python
The Ecommerce application uses the following AWS services:
- AWS Lambda: For serverless functions to handle backend logic and business processes.
- Amazon DynamoDB: For storing product inventory, order data, and user information.
- Amazon API Gateway: To expose RESTful APIs for users to interact with the application.
- Amazon SQS: For handling asynchronous processing of orders and events.
- Amazon EventBridge (formerly CloudWatch Events): To manage events and triggers for order processing and other application functionalities.
To get started with the project, follow the steps below:
- Clone the repository to your local machine:
git clone https://github.com/mubtasimfuad/aws-cdk-python-ecomm.git
- Install the required dependencies:
Create a virtual environment manually on macOS and Linux:
$ python3 -m venv .venv
After the initialization process completes and the virtual environment is created, you can use the following step to activate your virtual environment.
$ source .venv/bin/activate
For Windows platforms, you would activate the virtual environment like this:
% .venv\Scripts\activate.bat
Once the virtual environment is activated, you can install the required dependencies.
$ pip install -r requirements.txt
-
Configure AWS CLI with your AWS account credentials and default region.
-
Deploy the AWS CDK stacks:
cd cdk
cdk deploy
This will deploy the necessary AWS resources and services required for the Ecommerce application.
The project is structured as follows:
├── app.py
├── cdk
│ ├── backend
│ │ ├── api
│ │ │ ├── infrastructure.py
│ │ ├── cdk_stack.py
│ │ ├── database
│ │ │ ├── infrastructure.py
│ │ ├── eventbus
│ │ │ ├── infrastructure.py
│ │ ├── lambdas
│ │ │ ├── infrastructure.py
│ │ │ └── runtime
│ │ │ ├── basket_microservice.py
│ │ │ ├── client.py
│ │ │ ├── order_microservice.py
│ │ │ └── product_microservice.py
│ │ └── sqs
│ │ ├── infrastructure.py
│ ├── __init__.py
├── cdk.json
├── README.md
├── requirements-dev.txt
├── requirements.txt
├── source.bat
cdk.json
: Configuration file for AWS CDK.cdk
: Main package containing the application code.backend
: Contains modules for backend services like API, database, lambdas, and queues.
The Ecommerce application provides the following functionality:
- Product Inventory Management: Manage the inventory of products available for purchase.
- Order Processing: Process and fulfill customer orders.
- User Interactions: Allow users to browse products and place orders.
Contributions to the project are welcome! Feel free to raise issues or submit pull requests for improvements, bug fixes, or additional features.
This project is licensed under the MIT License - see the LICENSE file for details.
You can now begin exploring the source code contained in the cdk
directory. There is also a very trivial test included that can be run like this:
cdk ls
list all stacks in the appcdk synth
emits the synthesized CloudFormation templatecdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk docs
open CDK documentation