root 6d11a9c1cc feat: board info logging, anomaly detection, re-flash & firmware update tokens
- Flash.jsx: replace esp-web-tools with direct esptool-js integration
  → reads MAC address + chip type before flash via Web Serial API
  → step-by-step UI (connect → board info → download → flash → done)
  → retry button on failure with remaining-attempt counter
  → firmware update token request after successful flash

- Schema: FlashToken (maxAttempts/attemptCount/isLocked/isUpdateToken),
  FlashLog (startedAt/completedAt/durationMs/chipId/flashSize),
  FlashAnomaly model (RATE_LIMIT_IP/HIGH_VOLUME_IP/MAC_REUSE/TOKEN_LOCK/SUSPICIOUS_DURATION),
  ProjectFile.firmwareVersion

- flash.js: new POST /start (board info + IP log + anomaly detection),
  updated POST /consume (timing, lock on exhaustion), GET returns firmwareFiles

- orders.js: POST /request-reflash (free firmware update token for paid orders),
  updated to flashTokens[] relation

- admin.js: GET /flash/metrics, GET/PUT /flash/anomalies, POST /flash/tokens/:id/unlock

- Admin/FlashMetrics.jsx: dashboard with today stats, recent logs table,
  top-IP chart, anomaly management with resolve button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 05:48:29 +09:00

ESP32 DIY 플랫폼

ESP32 프로젝트 공유·판매 마켓플레이스. webflash(:3100)와 연동되는 별도 서비스입니다.

포트

서비스 포트
웹 프론트엔드 3200
백엔드 API 3201
MinIO 관리 콘솔 9001

빠른 시작

1. 환경 변수 설정

cp .env.example .env
# .env 파일을 편집하여 비밀번호, JWT_SECRET 등 설정

2. 실행

docker compose up -d --build

3. DB 마이그레이션 확인

docker compose logs platform-backend
# "Platform Backend → http://localhost:3201" 메시지 확인

4. 관리자 계정 생성

docker compose exec platform-backend node src/scripts/createAdmin.js admin@example.com yourpassword 관리자

5. 브라우저 접속

http://localhost:3200

구조

platform/
├── backend/
│   ├── prisma/schema.prisma    DB 스키마
│   └── src/
│       ├── index.js            Express 서버
│       ├── config/             DB / Redis / MinIO
│       ├── middleware/         Auth / Audit
│       ├── routes/             auth / projects / products / admin
│       ├── services/           storage (MinIO + sharp)
│       └── scripts/            createAdmin.js
├── frontend/
│   └── src/
│       ├── pages/              React 페이지
│       │   ├── Auth/           로그인, 회원가입
│       │   ├── Dashboard/      판매자 대시보드
│       │   └── Admin/          관리자 패널
│       ├── hooks/useAuth.js    인증 컨텍스트
│       └── api/client.js       Axios 인스턴스
├── docker-compose.yml
└── .env.example

1단계 구현 완료 기능

  • 회원가입 / 로그인 / 로그아웃 (JWT)
  • 프로젝트 생성 / 수정 / 삭제
  • 파일 업로드 (이미지 WebP 자동 변환, MinIO 저장)
  • 관리자 검토 요청 흐름
  • 관리자 승인/반려 (가격·수수료 설정)
  • 상품 자동 생성 (승인 시)
  • 사용자 관리 (역할 변경, 계정 비활성화)
  • 감사 로그 (모든 주요 행동 기록)

2단계 예정

  • 토스페이먼츠 결제 연동
  • 환불 처리
  • FlashToken 발급 및 webflash 연동
  • 플래시 완료 로그

3단계 예정

  • 리뷰 작성 (이미지/영상 업로드)
  • ffmpeg 영상 압축
  • 별점 집계
Description
No description provided
Readme 116 KiB
Languages
JavaScript 95.5%
CSS 3.9%
Dockerfile 0.3%
HTML 0.3%