推しアイデア
・エネルギーを使わずに商品を選べる ・新しい商品との出会い ・気分を商品と結びつけること
・エネルギーを使わずに商品を選べる ・新しい商品との出会い ・気分を商品と結びつけること
・優柔不断な人ばかりだった →素早い意思決定! ・気分を数値化したかった!
・気分と商品のベクトルからMH法を使い、最適化。 ・AIでAWSのベッドロックでレコメンド理由を生成。
コンビニの棚の前で3分間立ち尽くして「まあいっか」で買う体験、誰しも一度はあるはず。 「これだわ」を先に届けたい気持ちで作りました。

S3 CloudFront Lambda API Gateway DynamoDB Amazon Bedrock AWS CDK
↓ワンタイムパスワードを生成するpythonコード
import React, { useState } from "react"; function AdminLoginPage({ onLoginSuccess, onBack }) { // ← ここで onBack を受け取る const [password, setPassword] = useState(""); const [error, setError] = useState(""); const handleLogin = (e) => { e.preventDefault(); if (password === "admin123") { onLoginSuccess(); } else { setError("パスワードが違います"); setPassword(""); } }; return ( <div style={{ display: "flex", justifyContent: "center", alignItems: "center", height: "100vh", backgroundColor: "#f0f2f5", fontFamily: "sans-serif", }} > <div style={{ padding: "40px", background: "white", borderRadius: "12px", boxShadow: "0 4px 12px rgba(0,0,0,0.1)", width: "320px", textAlign: "center", }} > <h2 style={{ marginBottom: "20px" }}>管理者ログイン</h2> <form onSubmit={handleLogin}> <input type="password" placeholder="パスワードを入力" value={password} onChange={(e) => setPassword(e.target.value)} style={{ width: "100%", padding: "12px", marginBottom: "10px", boxSizing: "border-box", border: "1px solid #ccc", borderRadius: "6px", }} /> {error && ( <p style={{ color: "red", fontSize: "14px", marginBottom: "10px" }}> {error} </p> )} <button type="submit" style={{ width: "100%", padding: "12px", backgroundColor: "#007bff", color: "white", border: "none", borderRadius: "6px", cursor: "pointer", fontWeight: "bold", }} > ログイン </button> </form> {/* 【修正】onClick で確実に onBack を呼ぶようにしました */} <button type="button" onClick={() => { console.log("戻るボタンが押されました"); // 動作確認用 onBack(); }} style={{ marginTop: "20px", background: "none", border: "none", color: "#666", cursor: "pointer", textDecoration: "underline", }} > キャンセルして戻る </button> </div> </div> ); } export default AdminLoginPage;
import datetime import math def calculate_chaos_pass(): # 1. 強制的に日本時間 (UTC+9) を取得する # 実行環境がUTCでも、これで確実に日本時間になります jst = datetime.timezone(datetime.timedelta(hours=9)) now = datetime.datetime.now(jst) # 2. 月・日・時(24h)・分を数値化 (例: 10時45分 -> 1045) time_str = now.strftime("%m%d%H%M") time_num = int(time_str) # 3. 初期値 x0 (React側と完全に一致させる定数) x = 0.123456 + (time_num / 100000000.0) x = x % 1.0 # 4. カオスパラメータ a=4.0 a = 4.0 for _ in range(50): x = a * x * (1.0 - x) # 5. 6桁抽出 chaos_code = str(math.floor((x * 1000000) % 1000000)).zfill(6) # デバッグ用に計算の元データも出力 return chaos_code, now.strftime("%Y/%m/%d %H:%M"), time_num if __name__ == "__main__": code, full_time, t_num = calculate_chaos_pass() print("=" * 40) print(f" [確定] 日本時間 : {full_time}") print(f" [計算用数値] : {t_num}") print(f" [カオスコード] : {code}") print("=" * 40) print(str(6000)) print(str(6000).zfill(6))