This repository hosts a cloud-native inventory platform built on AWS. Core services include:
- DynamoDB – product and inventory storage
- Lambda – Point-of-Sale (POS) and reporting logic
- SQS – reporting queues
The stack is provisioned with Terraform and deployed through helper scripts found in scripts/.
A small utility (scripts/generate_data.py) can be used to simulate inventory changes across stores.
python3 scripts/generate_data.pyThe script logs in, discovers all stores and products, then issues random inventory updates. Sample output:
Base URL: http://<WEB_IP>:3000/
Email: you@example.com
Total calls: 10
...
OK lakeside-grocers:0123456789022 2→0
OK hillside-organics:0123456789016 2→1
...
You’ll need an Inventory Management account before running the generator (see “Inventory Management” below).
After deploy.sh finishes, Terraform outputs the public IP addresses. The default ports are:
- Product Catalog API – 8000
- Product Catalog Web & Inventory Manager – 3000
Example Terraform outputs:
output "api_public_ip" { value = module.product_app_api.public_ip }
output "web_public_ip" { value = module.product_app_frontend.public_ip }
output "inv_public_ip" { value = module.inventory_management_service.public_ip }Provision the full stack (Product Catalog + Inventory Manager):
AWS_KEY_LOCATION=/path/to/key.pem ./scripts/deploy.shCreate a user account for the Inventory Manager:
./scripts/create_inv_user.shThe POS API is deployed with the same deploy.sh script (see above). A test client is provided:
./scripts/test_pos_api.shThe script will:
- Fetch the API ID and key
- Query current inventory counts
- Apply positive/negative deltas
- Retrieve current prices
Verbose logs are printed for each step.
Re-deploy or rebuild at any time:
# Full build on EC2 (default)
AWS_KEY_LOCATION=/path/to/key.pem ./scripts/deploy.sh
# Reconfigure without rebuilding binaries
SKIP_BUILD=true AWS_KEY_LOCATION=/path/to/key.pem ./scripts/deploy.sh
# Local ARM cross-compile, then deploy
LOCAL_BUILD=true AWS_KEY_LOCATION=/path/to/key.pem ./scripts/deploy.shThe script auto-approves Terraform. If you want to review changes, run terraform plan first.
Populate sample data:
python3 scripts/upload_data.pyRequirements:
- Python 3
- boto3
- botocore