machine-learning-portfolio

Digital Value Chain πŸš€

Project Overview

A full-stack serverless e-commerce platform demonstrating enterprise-level architecture, modern development practices, and intelligent cost optimization through scalable cloud solutions. This project showcases real-world problem-solving capabilities through a complete serverless application built collaboratively with ChatGPT and Claude AI assistants.

πŸ’° Cost-Optimized Production Architecture

πŸ—οΈ Intelligent Resource Management

This project demonstrates enterprise-grade cost optimization through strategic infrastructure lifecycle management:

This approach showcases both advanced full-stack development capabilities and cloud financial engineering expertise.

πŸ’Έ Cost Breakdown & Optimization

🏒 Real-World Business Application

This architecture pattern is ideally suited for enterprise digital marketplaces where organizations need to:

Digital Product Catalog Management

Key Business Benefits:

Example Implementation: A global healthcare company could use this pattern to create a partner portal where:

The serverless architecture ensures the platform remains responsive whether serving 100 or 100,000 concurrent users, making it perfect for enterprise environments with unpredictable usage patterns.

πŸ—οΈ Architecture Highlights


πŸ“‹ Deployment Evidence & Validation

πŸ” Production Deployment Documentation

Complete evidence of successful full-stack deployment with comprehensive screenshots and logs:

Frontend Deployment:

Backend & Infrastructure:

Production URLs (Deployment Evidence):

All screenshots generated during live production deployment and validation phases.


🎯 Key Features

Frontend Capabilities

Backend Capabilities

DevOps & Infrastructure


πŸ›οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React Frontend│────│  API Gateway    │────│  Lambda Functionsβ”‚
β”‚  (Screenshots)  β”‚    β”‚   (Validated)   β”‚    β”‚   (Validated)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚                        β”‚
                                β”‚                        β”‚
                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                       β”‚    DynamoDB     β”‚    β”‚   Stripe API    β”‚
                       β”‚   (Production)  β”‚    β”‚  (Framework)    β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚ Cost-Optimized  β”‚
                    β”‚   Management    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

digital-value-chain/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app.py                 # Original FastAPI version
β”‚   β”œβ”€β”€ lambda_handler.py      # Lambda-compatible handler
β”‚   └── requirements.txt       # Python dependencies
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx           # Main React component
β”‚   β”‚   └── main.jsx          # Application entry point
β”‚   β”œβ”€β”€ index.html            # HTML template
β”‚   β”œβ”€β”€ package.json          # Node.js dependencies
β”‚   └── vite.config.js        # Vite configuration
β”œβ”€β”€ infra/
β”‚   └── template.yaml         # SAM CloudFormation template
β”œβ”€β”€ scripts/
β”‚   └── seed_offers.py        # Database seeding utility
β”œβ”€β”€ screenshots/              # **DEPLOYMENT EVIDENCE**
β”‚   β”œβ”€β”€ dashboard-empty.png   # Empty dashboard state
β”‚   β”œβ”€β”€ dashboard-populated.png # Dashboard with offers
β”‚   β”œβ”€β”€ api-health.png        # API endpoint response
β”‚   β”œβ”€β”€ cloudformation.png    # AWS stack deployment
β”‚   β”œβ”€β”€ vite-server.png       # Development server
β”‚   └── fastapi-backend.png   # Backend server logs
└── README.md                 # This documentation

πŸ”Œ API Endpoints (Production Validated)

Method Endpoint Description Status
GET / Health check endpoint βœ… Validated
GET /offers List all available offers βœ… Validated
POST /offers Create new offer βœ… Validated
POST /checkout Initialize Stripe checkout session πŸ”§ Framework Ready
POST /stripe/webhook Handle Stripe payment webhooks πŸ”§ Framework Ready

Example API Usage (Reactivation Ready)

# Production endpoints (reactivation required for live testing)
# List offers
curl https://f59moopdx0.execute-api.us-east-1.amazonaws.com/offers

# Create new offer
curl -X POST https://f59moopdx0.execute-api.us-east-1.amazonaws.com/offers \
  -H "Content-Type: application/json" \
  -d '{"sku": "premium-001", "name": "Premium Plan", "price": 99.99}'

πŸ› οΈ Installation & Setup

Prerequisites

Quick Start (Cost-Optimized Development)

  1. Clone the repository
    git clone https://github.com/yourusername/digital-value-chain.git
    cd digital-value-chain
    
  2. Deploy Backend Infrastructure
    cd infra
    sam build
    sam deploy --guided
    
  3. Setup Frontend
    cd ../frontend
    npm install
    npm run dev -- --host
    
  4. Seed Database (Optional)
    cd ../scripts
    python3 seed_offers.py
    

Cost Management Note: EC2 instances can be stopped after development/testing to avoid continuous charges. All infrastructure can be reactivated instantly using the provided SAM templates.


🚨 Major Technical Challenges & Solutions

This project demonstrates real-world problem-solving through complex technical challenges:

1. Port Conflicts

Challenge: Backend port 8000 already in use during development

# Solution: Process identification and cleanup
lsof -i :8000
pkill -f "process_name"

2. AWS Credentials Configuration

Challenge: Multiple credential conflicts between AWS CLI and IAM roles

# Solution: Proper IAM role attachment and credential cleanup
aws configure list
aws sts get-caller-identity

3. Python Runtime Compatibility

Challenge: SAM template specified python3.11 but EC2 had python3.9

# Solution: Updated template.yaml
Runtime: python3.9  # Changed from python3.11

4. Lambda Handler Format Issues

Challenge: FastAPI code incompatible with Lambda execution

# Solution: Created separate lambda_handler.py
def lambda_handler(event, context):
    # Proper AWS Lambda event handling
    return {
        "statusCode": 200,
        "headers": {"Access-Control-Allow-Origin": "*"},
        "body": json.dumps(response_data)
    }

5. DynamoDB Data Type Conflicts

Challenge: Python float types not supported by DynamoDB

# Solution: Data type conversion function
from decimal import Decimal

def convert_float_to_decimal(obj):
    if isinstance(obj, float):
        return Decimal(str(obj))
    return obj

6. CORS Configuration

Challenge: Frontend blocked by CORS policy

# Solution: Comprehensive CORS in SAM template
Globals:
  HttpApi:
    CorsConfiguration:
      AllowOrigins: ["*"]
      AllowMethods: ["GET", "POST", "PUT", "DELETE"]
      AllowHeaders: ["Content-Type", "Authorization"]

7. CloudFormation Stack Conflicts

Challenge: Failed deployments due to resource conflicts

# Solution: Stack cleanup and proper naming
aws cloudformation delete-stack --stack-name digital-chain-stack
aws cloudformation wait stack-delete-complete --stack-name digital-chain-stack

πŸŽ“ Learning Outcomes & Technical Skills Demonstrated

Core Technologies

DevOps & Cloud

Problem-Solving Skills


πŸ”„ Application Flow & Features

Complete User Journey (Screenshots Documented)

  1. Dashboard Loading: React app fetches offers from DynamoDB via API Gateway
  2. Empty State Handling: Professional interface with clear call-to-action
  3. Sample Data Creation: One-click button to populate the database
  4. Real-time Updates: Frontend automatically refreshes to show new data
  5. API Integration: All operations go through serverless Lambda functions

Demonstrated Capabilities

Frontend Features:

Backend Features:

Infrastructure Features:

Screenshot Purpose Status
dashboard-empty.png Empty dashboard state with clear call-to-action βœ… Documented
dashboard-populated.png Dashboard with 8 sample offers from DynamoDB βœ… Documented
api-health.png API Gateway endpoint returning health check βœ… Documented
cloudformation.png AWS SAM CloudFormation stack deployment βœ… Documented
vite-server.png React development server with network access βœ… Documented
fastapi-backend.png Backend server running with request logging βœ… Documented

πŸ† Project Highlights

This project demonstrates several key technical competencies:

Full-Stack Development

Cloud Architecture & Cost Engineering

Problem-Solving & Debugging

Modern Development Practices

This project showcases the future of software development where human creativity combines with AI efficiency to solve complex technical challenges rapidly and effectively.

Production Readiness & Sustainability


πŸš€ Future Enhancements

Technical Roadmap

Cost Engineering Enhancements

Business Enhancements


Built with modern technologies β€’ AI-assisted development β€’ Enterprise-ready architecture β€’ Cost-optimized for sustainability