1. วัตถุประสงค์โครงการProject Objectiveプロジェクト目的
โครงการนี้เป็น Proof of Concept (POC) สำหรับระบบตู้ขายสินค้าอัตโนมัติ (Vending Machine) ที่เชื่อมต่อกับ AWS Cloud Services เพื่อ:
- บันทึกธุรกรรมการซื้อสินค้าแบบ Real-time ลง Amazon DynamoDB
- สร้าง Data Pipeline อัตโนมัติ: DynamoDB → S3 → Glue Catalog → Athena → QuickSight
- แสดง Dashboard วิเคราะห์ยอดขายแบบ Embedded ภายใน Web Application
- รองรับการขยายตัวสำหรับตู้ขายสินค้าจำนวนมาก (100+ ตู้)
- ประเมินค่าใช้จ่าย AWS สำหรับ Production deployment
ขอบเขตของ POC
- สินค้า 7 รายการ: โคล่า 4 ชนิด, ขนม 2 ชนิด, ถั่ว 1 ชนิด
- Web Application (Express.js + EJS + TypeScript) สำหรับจำลองการสั่งซื้อ
- QuickSight Dashboard แบบ Embedded สำหรับดูยอดขาย
- Property-Based Testing เพื่อพิสูจน์ความถูกต้องของระบบ
This project is a Proof of Concept (POC) for a Vending Machine system integrated with AWS Cloud Services to:
- Record purchase transactions in real-time to Amazon DynamoDB
- Build an automated Data Pipeline: DynamoDB → S3 → Glue Catalog → Athena → QuickSight
- Display an embedded analytics Dashboard within the Web Application
- Support scalability for large numbers of vending machines (100+)
- Estimate AWS costs for Production deployment
POC Scope
- 7 products: 4 cola variants, 2 snacks, 1 nuts
- Web Application (Express.js + EJS + TypeScript) for simulating purchases
- Embedded QuickSight Dashboard for sales analytics
- Property-Based Testing to verify system correctness
本プロジェクトは、AWS Cloud Servicesと連携した自動販売機(Vending Machine)システムのProof of Concept(POC)です。目的:
- 購入トランザクションをリアルタイムでAmazon DynamoDBに記録
- 自動データパイプラインの構築:DynamoDB → S3 → Glue Catalog → Athena → QuickSight
- Webアプリケーション内に埋め込み型分析ダッシュボードを表示
- 大量の自動販売機(100台以上)へのスケーラビリティ対応
- 本番デプロイメントのAWSコスト見積もり
POCの範囲
- 商品7種類:コーラ4種、スナック2種、ナッツ1種
- Webアプリケーション(Express.js + EJS + TypeScript)で購入をシミュレーション
- 売上分析用の埋め込みQuickSightダッシュボード
- システムの正確性を検証するProperty-Based Testing
2. สถาปัตยกรรมระบบและ AWS ServicesSystem Architecture & AWS ServicesシステムアーキテクチャとAWSサービス
AWS Services ที่ใช้
| Service | หน้าที่ | รายละเอียด |
|---|---|---|
| DynamoDB | Transaction Store | On-Demand mode, Partition Key: machine_id, Sort Key: timestamp |
| S3 | Data Lake | เก็บ JSON export จาก DynamoDB + Athena query results |
| Glue | Data Catalog | Database + Table definition สำหรับ Athena |
| Athena | SQL Analytics | Serverless SQL query engine, scan data จาก S3 |
| QuickSight | Dashboard | Enterprise edition, Embedded mode, DataSource → DataSet → Dashboard |
| IAM | Access Control | IAM User + Policy สำหรับ vending machine access |
| STS | Identity | GetCallerIdentity สำหรับแสดง account info |
| CloudFormation | IaC | Deploy ทุก resource ด้วย template เดียว |
AWS Services Used
| Service | Role | Details |
|---|---|---|
| DynamoDB | Transaction Store | On-Demand mode, Partition Key: machine_id, Sort Key: timestamp |
| S3 | Data Lake | Stores JSON exports from DynamoDB + Athena query results |
| Glue | Data Catalog | Database + Table definition for Athena |
| Athena | SQL Analytics | Serverless SQL query engine, scans data from S3 |
| QuickSight | Dashboard | Enterprise edition, Embedded mode, DataSource → DataSet → Dashboard |
| IAM | Access Control | IAM User + Policy for vending machine access |
| STS | Identity | GetCallerIdentity for displaying account info |
| CloudFormation | IaC | Deploy all resources with a single template |
使用AWSサービス
| サービス | 役割 | 詳細 |
|---|---|---|
| DynamoDB | トランザクション保存 | On-Demandモード、Partition Key: machine_id、Sort Key: timestamp |
| S3 | データレイク | DynamoDBからのJSONエクスポート + Athenaクエリ結果を保存 |
| Glue | データカタログ | Athena用のDatabase + Table定義 |
| Athena | SQL分析 | サーバーレスSQLクエリエンジン、S3からデータをスキャン |
| QuickSight | ダッシュボード | Enterprise版、埋め込みモード、DataSource → DataSet → Dashboard |
| IAM | アクセス制御 | 自動販売機アクセス用のIAM User + Policy |
| STS | ID確認 | アカウント情報表示用のGetCallerIdentity |
| CloudFormation | IaC | 単一テンプレートで全リソースをデプロイ |
3. ประมาณการค่าใช้จ่ายCost Estimationコスト見積もり
| Service | รายการ | ปริมาณ | USD/เดือน | THB/เดือน | หมายเหตุ |
|---|---|---|---|---|---|
| DynamoDB | Write Request Units (WRU) | 3,000,000 WRU | $2.38 | ฿83.44 | $0.7946/ล้าน WRU |
| Read Request Units (RRU) | 3,000,000 RRU | $0.48 | ฿16.69 | $0.1589/ล้าน RRU | |
| Storage (หลัง 12 เดือน) | ~18 GB | $5.13 | ฿179.55 | 36M items × 0.5KB; 25GB แรกฟรี | |
| รวม DynamoDB | $7.99 | ฿279.68 | |||
| S3 | Storage | ~18 GB | $0.45 | ฿15.75 | JSON export |
| PUT/GET/LIST | ~10,000 req | $0.05 | ฿1.75 | Sync + Athena results | |
| รวม S3 | $0.50 | ฿17.50 | |||
| Glue | Data Catalog | 2 objects | $0.00 | ฿0.00 | ฟรี (1M objects แรก) |
| Athena | SQL Queries | ~10 GB scanned | $0.50 | ฿17.50 | $5/TB scanned |
| รวม Athena | $0.50 | ฿17.50 | |||
| QuickSight | Author License | 1 user | $24.00 | ฿840.00 | สร้าง/จัดการ Dashboard |
| Reader Sessions (5 users) | 5 readers | $25.00 | ฿875.00 | $0.30/session สูงสุด $5/reader | |
| SPICE Storage | 1 GB | $0.00 | ฿0.00 | ฟรี 1GB/author | |
| รวม QuickSight | $49.00 | ฿1,715.00 | |||
| IAM | Users & Policies | N/A | $0.00 | ฿0.00 | ฟรีเสมอ |
| 💰 รวมทั้งหมด (ต่อเดือน) | $57.99 | ฿2,029.68 | |||
| Service | Item | Quantity | USD/mo | THB/mo | Notes |
|---|---|---|---|---|---|
| DynamoDB | Write Request Units (WRU) | 3,000,000 WRU | $2.38 | ฿83.44 | $0.7946/million WRU |
| Read Request Units (RRU) | 3,000,000 RRU | $0.48 | ฿16.69 | $0.1589/million RRU | |
| Storage (after 12 months) | ~18 GB | $5.13 | ฿179.55 | 36M items × 0.5KB; first 25GB free | |
| DynamoDB Subtotal | $7.99 | ฿279.68 | |||
| S3 | Storage | ~18 GB | $0.45 | ฿15.75 | JSON export |
| PUT/GET/LIST | ~10,000 req | $0.05 | ฿1.75 | Sync + Athena results | |
| S3 Subtotal | $0.50 | ฿17.50 | |||
| Glue | Data Catalog | 2 objects | $0.00 | ฿0.00 | Free (first 1M objects) |
| Athena | SQL Queries | ~10 GB scanned | $0.50 | ฿17.50 | $5/TB scanned |
| Athena Subtotal | $0.50 | ฿17.50 | |||
| QuickSight | Author License | 1 user | $24.00 | ฿840.00 | Create/manage Dashboard |
| Reader Sessions (5 users) | 5 readers | $25.00 | ฿875.00 | $0.30/session max $5/reader | |
| SPICE Storage | 1 GB | $0.00 | ฿0.00 | Free 1GB/author | |
| QuickSight Subtotal | $49.00 | ฿1,715.00 | |||
| IAM | Users & Policies | N/A | $0.00 | ฿0.00 | Always free |
| 💰 Total (per month) | $57.99 | ฿2,029.68 | |||
| サービス | 項目 | 数量 | USD/月 | THB/月 | 備考 |
|---|---|---|---|---|---|
| DynamoDB | Write Request Units (WRU) | 3,000,000 WRU | $2.38 | ฿83.44 | $0.7946/百万WRU |
| Read Request Units (RRU) | 3,000,000 RRU | $0.48 | ฿16.69 | $0.1589/百万RRU | |
| ストレージ(12ヶ月後) | ~18 GB | $5.13 | ฿179.55 | 36M items × 0.5KB; 最初の25GB無料 | |
| DynamoDB 小計 | $7.99 | ฿279.68 | |||
| S3 | ストレージ | ~18 GB | $0.45 | ฿15.75 | JSONエクスポート |
| PUT/GET/LIST | ~10,000 req | $0.05 | ฿1.75 | 同期 + Athena結果 | |
| S3 小計 | $0.50 | ฿17.50 | |||
| Glue | データカタログ | 2 objects | $0.00 | ฿0.00 | 無料(最初の1Mオブジェクト) |
| Athena | SQLクエリ | ~10 GB scanned | $0.50 | ฿17.50 | $5/TBスキャン |
| Athena 小計 | $0.50 | ฿17.50 | |||
| QuickSight | 著者ライセンス | 1 user | $24.00 | ฿840.00 | ダッシュボード作成/管理 |
| リーダーセッション(5ユーザー) | 5 readers | $25.00 | ฿875.00 | $0.30/セッション 最大$5/リーダー | |
| SPICEストレージ | 1 GB | $0.00 | ฿0.00 | 著者1人あたり1GB無料 | |
| QuickSight 小計 | $49.00 | ฿1,715.00 | |||
| IAM | ユーザー & ポリシー | N/A | $0.00 | ฿0.00 | 常に無料 |
| 💰 合計(月額) | $57.99 | ฿2,029.68 | |||
3.1 กราฟวิเคราะห์ค่าใช้จ่ายCost Analysis Chartsコスト分析チャート
📈 ค่าใช้จ่ายรวมต่อเดือน vs จำนวนธุรกรรม (0 - 10 ล้าน)📈 Total Monthly Cost vs Transactions (0 - 10M)📈 月額総コスト vs 取引数(0〜1,000万)
🍩 สัดส่วนค่าใช้จ่าย (3M txn/mo)🍩 Cost Breakdown (3M txn/mo)🍩 コスト内訳(300万取引/月)
📊 Fixed vs Variable Cost📊 Fixed vs Variable Cost📊 固定費 vs 変動費
📉 ต้นทุนต่อธุรกรรม (Economy of Scale)📉 Cost per Transaction (Economy of Scale)📉 取引あたりコスト(規模の経済)
⚡ AWS vs On-Premise (ต่อเดือน)⚡ AWS vs On-Premise (per month)⚡ AWS vs オンプレミス(月額)
📅 ประมาณการค่าใช้จ่าย 12 เดือน (100 ตู้, เพิ่ม 10 ตู้/เดือน)📅 12-Month Cost Projection (100 machines, +10/month growth)📅 12ヶ月コスト予測(100台、月+10台増加)
4. ผลการทดสอบและคู่มือการใช้งานTest Results & Usage Guideテスト結果と使用ガイド
4.1 ผลการทดสอบ — 11/11 ผ่านทั้งหมด ✅
ระบบผ่านการทดสอบทั้งหมด 11 test cases: 5 Property-Based Tests (PBT) + 6 Unit Tests
| # | Test Name | ประเภท | ตรวจสอบ | ผลลัพธ์ |
|---|---|---|---|---|
| 1 | test_product_data_completeness | PBT ×100 | ข้อมูลสินค้าครบถ้วนทุกฟิลด์ | PASS |
| 2 | test_cola_price_in_valid_range | PBT ×100 | ราคาโคล่าอยู่ในช่วง 10-20 บาท | PASS |
| 3 | test_format_price_thb_contains_baht_symbol | PBT ×100 | แสดงราคาเป็นสกุลเงินบาท (฿) | PASS |
| 4 | test_transaction_record_roundtrip | PBT ×100 | เขียน/อ่าน DynamoDB ข้อมูลตรงกัน | PASS |
| 5 | test_transaction_record_completeness | PBT ×100 | ธุรกรรมครบถ้วน UUID/timestamp ถูกต้อง | PASS |
| 6 | test_product_catalog_has_7_items | Unit | Catalog มี 7 สินค้า | PASS |
| 7 | test_product_catalog_category_breakdown | Unit | 4 cola, 2 snack, 1 nuts | PASS |
| 8 | test_write_transaction_to_dynamodb | Unit | PutItem + GetItem สำเร็จ | PASS |
| 9 | test_write_transaction_dynamodb_failure | Unit | จัดการ DynamoDB error ได้ | PASS |
| 10 | test_transaction_id_is_valid_uuid | Unit | transaction_id เป็น UUID v4 | PASS |
| 11 | test_timestamp_is_iso8601 | Unit | timestamp เป็น ISO 8601 | PASS |
4.2 คู่มือการใช้งาน App
- หน้าสั่งซื้อสินค้า — เลือกสินค้าจาก 7 รายการ กดปุ่ม "สั่งซื้อ" ระบบจะบันทึกธุรกรรมลง DynamoDB ทันที
- หน้า Dashboard — แสดง QuickSight Dashboard แบบ Embedded พร้อมกราฟยอดขายรายวัน, ตามหมวดหมู่, ตามสินค้า
- หน้า Report — รายงานโครงการฉบับนี้
ข้อมูล AWS Identity (Account ID, User) จะแสดงที่ header ของทุกหน้า
4.1 Test Results — 11/11 All Passed ✅
The system passed all 11 test cases: 5 Property-Based Tests (PBT) + 6 Unit Tests
| # | Test Name | Type | Validates | Result |
|---|---|---|---|---|
| 1 | test_product_data_completeness | PBT ×100 | All product fields are non-empty | PASS |
| 2 | test_cola_price_in_valid_range | PBT ×100 | Cola price between 10-20 THB | PASS |
| 3 | test_format_price_thb_contains_baht_symbol | PBT ×100 | Price formatted with ฿ symbol | PASS |
| 4 | test_transaction_record_roundtrip | PBT ×100 | DynamoDB write/read data matches | PASS |
| 5 | test_transaction_record_completeness | PBT ×100 | Transaction complete, UUID/timestamp valid | PASS |
| 6 | test_product_catalog_has_7_items | Unit | Catalog has 7 products | PASS |
| 7 | test_product_catalog_category_breakdown | Unit | 4 cola, 2 snack, 1 nuts | PASS |
| 8 | test_write_transaction_to_dynamodb | Unit | PutItem + GetItem succeeds | PASS |
| 9 | test_write_transaction_dynamodb_failure | Unit | Handles DynamoDB errors | PASS |
| 10 | test_transaction_id_is_valid_uuid | Unit | transaction_id is UUID v4 | PASS |
| 11 | test_timestamp_is_iso8601 | Unit | timestamp is ISO 8601 | PASS |
4.2 App Usage Guide
- Order Page — Select from 7 products, click "Order" to record a transaction to DynamoDB instantly
- Dashboard Page — Displays an embedded QuickSight Dashboard with daily sales, category breakdown, and product charts
- Report Page — This project report
AWS Identity (Account ID, User) is displayed in the header of every page.
4.1 テスト結果 — 11/11 全て合格 ✅
システムは全11テストケースに合格:5つのProperty-Based Tests(PBT)+ 6つのUnit Tests
| # | テスト名 | 種類 | 検証内容 | 結果 |
|---|---|---|---|---|
| 1 | test_product_data_completeness | PBT ×100 | 全商品フィールドが空でないこと | PASS |
| 2 | test_cola_price_in_valid_range | PBT ×100 | コーラ価格が10〜20バーツの範囲内 | PASS |
| 3 | test_format_price_thb_contains_baht_symbol | PBT ×100 | 価格に฿記号が含まれること | PASS |
| 4 | test_transaction_record_roundtrip | PBT ×100 | DynamoDB書き込み/読み取りデータの一致 | PASS |
| 5 | test_transaction_record_completeness | PBT ×100 | トランザクション完全性、UUID/タイムスタンプ有効 | PASS |
| 6 | test_product_catalog_has_7_items | Unit | カタログに7商品あること | PASS |
| 7 | test_product_catalog_category_breakdown | Unit | コーラ4、スナック2、ナッツ1 | PASS |
| 8 | test_write_transaction_to_dynamodb | Unit | PutItem + GetItem成功 | PASS |
| 9 | test_write_transaction_dynamodb_failure | Unit | DynamoDBエラー処理 | PASS |
| 10 | test_transaction_id_is_valid_uuid | Unit | transaction_idがUUID v4であること | PASS |
| 11 | test_timestamp_is_iso8601 | Unit | タイムスタンプがISO 8601であること | PASS |
4.2 アプリ使用ガイド
- 注文ページ — 7商品から選択し、「注文」をクリックするとDynamoDBにトランザクションが即座に記録されます
- ダッシュボードページ — 日次売上、カテゴリ別、商品別チャートを含む埋め込みQuickSightダッシュボードを表示
- レポートページ — 本プロジェクトレポート
AWS Identity(アカウントID、ユーザー)は全ページのヘッダーに表示されます。
5. คู่มือการ DeployImplementation Guideデプロイガイド
5.1 Prerequisites
- Node.js 18+ และ npm
- Python 3.10+ (สำหรับ tests)
- AWS Account พร้อม IAM credentials
- AWS CLI (สำหรับ deploy CloudFormation)
5.2 Deploy Infrastructure (CloudFormation)
# Deploy stack พร้อม QuickSight
aws cloudformation deploy \
--template-file infra/template.yaml \
--stack-name vending-machine-dev \
--parameter-overrides \
Environment=dev \
QuickSightUserArn=arn:aws:quicksight:us-east-1:ACCOUNT_ID:user/default/YOUR_USER \
--capabilities CAPABILITY_NAMED_IAM \
--region ap-southeast-1
# Sync ข้อมูลจาก DynamoDB ไป S3
bash infra/sync-dynamodb-to-s3.sh dev
5.3 ตั้งค่า Web Application
# ติดตั้ง dependencies
cd web-app
npm install
# ตั้งค่า .env (copy จาก .env.example)
cp .env.example .env
# แก้ไข AWS credentials และ QuickSight settings
# รัน development server
npx tsx watch src/server.ts
# หรือ build แล้วรัน production
npm run build
npm start
5.4 รัน Tests
# ติดตั้ง Python dependencies
pip install pytest hypothesis boto3 moto
# รัน tests ทั้งหมด
pytest tests/ -v
# หรือใช้ script
bash run-tests.sh
5.5 ตั้งค่า QuickSight Embedding
- สมัคร QuickSight Enterprise ใน AWS Console
- หา User ARN:
aws quicksight list-users --aws-account-id ACCOUNT_ID --namespace default --region us-east-1 - ตั้งค่าใน
.env: QUICKSIGHT_USER_ARN, QUICKSIGHT_DASHBOARD_ID, QUICKSIGHT_REGION - ตั้งค่า Allowed Domains ใน QuickSight Console (เช่น http://localhost:3000)
- Restart app
5.1 Prerequisites
- Node.js 18+ and npm
- Python 3.10+ (for tests)
- AWS Account with IAM credentials
- AWS CLI (for CloudFormation deployment)
5.2 Deploy Infrastructure (CloudFormation)
# Deploy stack with QuickSight
aws cloudformation deploy \
--template-file infra/template.yaml \
--stack-name vending-machine-dev \
--parameter-overrides \
Environment=dev \
QuickSightUserArn=arn:aws:quicksight:us-east-1:ACCOUNT_ID:user/default/YOUR_USER \
--capabilities CAPABILITY_NAMED_IAM \
--region ap-southeast-1
# Sync data from DynamoDB to S3
bash infra/sync-dynamodb-to-s3.sh dev
5.3 Configure Web Application
# Install dependencies
cd web-app
npm install
# Configure .env (copy from .env.example)
cp .env.example .env
# Edit AWS credentials and QuickSight settings
# Run development server
npx tsx watch src/server.ts
# Or build and run production
npm run build
npm start
5.4 Run Tests
# Install Python dependencies
pip install pytest hypothesis boto3 moto
# Run all tests
pytest tests/ -v
# Or use the script
bash run-tests.sh
5.5 Configure QuickSight Embedding
- Subscribe to QuickSight Enterprise in AWS Console
- Find User ARN:
aws quicksight list-users --aws-account-id ACCOUNT_ID --namespace default --region us-east-1 - Configure in
.env: QUICKSIGHT_USER_ARN, QUICKSIGHT_DASHBOARD_ID, QUICKSIGHT_REGION - Set Allowed Domains in QuickSight Console (e.g., http://localhost:3000)
- Restart app
5.1 前提条件
- Node.js 18+ および npm
- Python 3.10+(テスト用)
- IAM認証情報付きAWSアカウント
- AWS CLI(CloudFormationデプロイ用)
5.2 インフラデプロイ(CloudFormation)
# QuickSight付きスタックをデプロイ
aws cloudformation deploy \
--template-file infra/template.yaml \
--stack-name vending-machine-dev \
--parameter-overrides \
Environment=dev \
QuickSightUserArn=arn:aws:quicksight:us-east-1:ACCOUNT_ID:user/default/YOUR_USER \
--capabilities CAPABILITY_NAMED_IAM \
--region ap-southeast-1
# DynamoDBからS3へデータ同期
bash infra/sync-dynamodb-to-s3.sh dev
5.3 Webアプリケーション設定
# 依存関係インストール
cd web-app
npm install
# .env設定(.env.exampleからコピー)
cp .env.example .env
# AWS認証情報とQuickSight設定を編集
# 開発サーバー起動
npx tsx watch src/server.ts
# またはビルドして本番実行
npm run build
npm start
5.4 テスト実行
# Python依存関係インストール
pip install pytest hypothesis boto3 moto
# 全テスト実行
pytest tests/ -v
# またはスクリプト使用
bash run-tests.sh
5.5 QuickSight埋め込み設定
- AWS ConsoleでQuickSight Enterpriseに登録
- User ARNを取得:
aws quicksight list-users --aws-account-id ACCOUNT_ID --namespace default --region us-east-1 .envで設定: QUICKSIGHT_USER_ARN、QUICKSIGHT_DASHBOARD_ID、QUICKSIGHT_REGION- QuickSight ConsoleでAllowed Domainsを設定(例: http://localhost:3000)
- アプリを再起動
6. ลิขสิทธิ์และข้อเสนอแนะด้านความปลอดภัยCopyright & Security Recommendations著作権とセキュリティ推奨事項
6.1 ลิขสิทธิ์
© 2026 Dakok — สงวนลิขสิทธิ์ทั้งหมด
โครงการนี้เป็น Proof of Concept ที่พัฒนาโดย Dakok สำหรับลูกค้า ห้ามนำไปใช้ในเชิงพาณิชย์โดยไม่ได้รับอนุญาต
6.2 ข้อเสนอแนะด้านความปลอดภัยสำหรับ Production
- 🔐 ห้ามเก็บ AWS Credentials ใน .env หรือ source code — ใช้ IAM Roles, Instance Profiles, หรือ AWS Secrets Manager แทน
- 🔐 เปิดใช้ HTTPS — ใช้ SSL/TLS certificate (ACM + ALB หรือ CloudFront) สำหรับ production
- 🔐 เพิ่ม Authentication — ใช้ Amazon Cognito หรือ OAuth 2.0 สำหรับ user login
- 🔐 เปิด DynamoDB Encryption — เปิด encryption at rest (AWS managed key หรือ CMK)
- 🔐 เปิด S3 Bucket Encryption — ใช้ SSE-S3 หรือ SSE-KMS
- 🔐 ปิด S3 Public Access — ตรวจสอบว่า Block Public Access เปิดอยู่
- 🔐 ใช้ VPC Endpoints — สำหรับ DynamoDB และ S3 เพื่อไม่ให้ traffic ออก internet
- 🔐 เปิด CloudTrail — บันทึก API calls ทั้งหมดสำหรับ audit
- 🔐 ใช้ Least Privilege IAM — จำกัด permissions ให้น้อยที่สุดที่จำเป็น
- 🔐 เปิด WAF — ป้องกัน web attacks (SQL injection, XSS) ด้วย AWS WAF
- 🔐 Rate Limiting — จำกัดจำนวน requests ต่อ IP เพื่อป้องกัน DDoS
- 🔐 Input Validation — ตรวจสอบ input ทุกตัวที่ server-side
- 🔐 Logging & Monitoring — ใช้ CloudWatch Logs + Alarms สำหรับ monitoring
- 🔐 Backup Strategy — เปิด DynamoDB Point-in-Time Recovery (PITR) และ S3 Versioning
- 🔐 Environment Separation — แยก dev/staging/prod ด้วย AWS Organizations + separate accounts
6.3 Tech Stack
| Layer | Technology | Version |
|---|---|---|
| Runtime | Node.js + TypeScript | 18+ / 5.7+ |
| Web Framework | Express.js + EJS | 4.21 / 3.1 |
| AWS SDK | AWS SDK v3 | 3.700+ |
| Testing | pytest + Hypothesis (PBT) | Python 3.12 |
| Mock | moto (AWS mock) | Latest |
| IaC | AWS CloudFormation | 2010-09-09 |
| Dashboard | Amazon QuickSight | Enterprise |
6.1 Copyright
© 2026 Dakok — All rights reserved
This project is a Proof of Concept developed by Dakok for a client. Commercial use without permission is prohibited.
6.2 Security Recommendations for Production
- 🔐 Never store AWS Credentials in .env or source code — Use IAM Roles, Instance Profiles, or AWS Secrets Manager instead
- 🔐 Enable HTTPS — Use SSL/TLS certificates (ACM + ALB or CloudFront) for production
- 🔐 Add Authentication — Use Amazon Cognito or OAuth 2.0 for user login
- 🔐 Enable DynamoDB Encryption — Enable encryption at rest (AWS managed key or CMK)
- 🔐 Enable S3 Bucket Encryption — Use SSE-S3 or SSE-KMS
- 🔐 Block S3 Public Access — Verify Block Public Access is enabled
- 🔐 Use VPC Endpoints — For DynamoDB and S3 to keep traffic off the internet
- 🔐 Enable CloudTrail — Log all API calls for auditing
- 🔐 Apply Least Privilege IAM — Restrict permissions to the minimum required
- 🔐 Enable WAF — Protect against web attacks (SQL injection, XSS) with AWS WAF
- 🔐 Rate Limiting — Limit requests per IP to prevent DDoS
- 🔐 Input Validation — Validate all inputs server-side
- 🔐 Logging & Monitoring — Use CloudWatch Logs + Alarms for monitoring
- 🔐 Backup Strategy — Enable DynamoDB Point-in-Time Recovery (PITR) and S3 Versioning
- 🔐 Environment Separation — Separate dev/staging/prod with AWS Organizations + separate accounts
6.3 Tech Stack
| Layer | Technology | Version |
|---|---|---|
| Runtime | Node.js + TypeScript | 18+ / 5.7+ |
| Web Framework | Express.js + EJS | 4.21 / 3.1 |
| AWS SDK | AWS SDK v3 | 3.700+ |
| Testing | pytest + Hypothesis (PBT) | Python 3.12 |
| Mock | moto (AWS mock) | Latest |
| IaC | AWS CloudFormation | 2010-09-09 |
| Dashboard | Amazon QuickSight | Enterprise |
6.1 著作権
© 2026 Dakok — 全著作権所有
本プロジェクトはDakokがクライアント向けに開発したProof of Conceptです。許可なく商用利用することは禁止されています。
6.2 本番環境向けセキュリティ推奨事項
- 🔐 AWS認証情報を.envやソースコードに保存しない — IAM Roles、Instance Profiles、またはAWS Secrets Managerを使用
- 🔐 HTTPSを有効化 — 本番環境ではSSL/TLS証明書(ACM + ALBまたはCloudFront)を使用
- 🔐 認証を追加 — Amazon CognitoまたはOAuth 2.0でユーザーログインを実装
- 🔐 DynamoDB暗号化を有効化 — 保存時の暗号化(AWSマネージドキーまたはCMK)を有効化
- 🔐 S3バケット暗号化を有効化 — SSE-S3またはSSE-KMSを使用
- 🔐 S3パブリックアクセスをブロック — Block Public Accessが有効であることを確認
- 🔐 VPCエンドポイントを使用 — DynamoDBとS3のトラフィックをインターネット経由にしない
- 🔐 CloudTrailを有効化 — 監査用に全APIコールを記録
- 🔐 最小権限IAMを適用 — 必要最小限の権限に制限
- 🔐 WAFを有効化 — AWS WAFでWebアタック(SQLインジェクション、XSS)を防御
- 🔐 レート制限 — DDoS防止のためIPあたりのリクエスト数を制限
- 🔐 入力検証 — サーバーサイドで全入力を検証
- 🔐 ログ & モニタリング — CloudWatch Logs + Alarmsでモニタリング
- 🔐 バックアップ戦略 — DynamoDB Point-in-Time Recovery(PITR)とS3 Versioningを有効化
- 🔐 環境分離 — AWS Organizations + 別アカウントでdev/staging/prodを分離
6.3 技術スタック
| レイヤー | 技術 | バージョン |
|---|---|---|
| ランタイム | Node.js + TypeScript | 18+ / 5.7+ |
| Webフレームワーク | Express.js + EJS | 4.21 / 3.1 |
| AWS SDK | AWS SDK v3 | 3.700+ |
| テスト | pytest + Hypothesis (PBT) | Python 3.12 |
| モック | moto (AWS mock) | Latest |
| IaC | AWS CloudFormation | 2010-09-09 |
| ダッシュボード | Amazon QuickSight | Enterprise |