1
0
Fork 0
mirror of https://github.com/chobble-mirror/esp32-web-form-trigger.git synced 2026-03-04 16:32:16 +00:00
No description
  • Ruby 63.9%
  • HTML 19%
  • CSS 5.7%
  • Python 5.5%
  • Shell 3.1%
  • Other 2.8%
Find a file
stefan burke 10bf647891
Revert spec changes to restore token validity test expectations (#49)
The spec changes from 80c6acf assumed the controller no longer filters
by token_validity_seconds, but that behavior was restored in 2f46798.
Revert both spec files to match the original controller logic so tests
pass again.

https://claude.ai/code/session_01AcXBjgNudWKLAxozzxT4wu

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-25 00:20:07 +00:00
.github First commit 2025-05-12 16:43:56 +01:00
app Revert credits_controller.rb to restore token validity checks (#48) 2026-02-24 23:51:06 +00:00
bin Fix asset permissions 2025-05-23 05:23:51 +00:00
config Add webhook endpoint for external quiz triggers (e.g. Jotform) (#43) 2026-02-21 18:54:31 +00:00
db Apply Standard Ruby autofixes 2025-05-23 08:14:54 +00:00
esp32-micropython Update example config 2025-05-22 22:34:49 +00:00
lib Apply Standard Ruby autofixes 2025-05-22 22:33:45 +00:00
log First commit 2025-05-12 16:43:56 +01:00
public First commit 2025-05-12 16:43:56 +01:00
spec Revert spec changes to restore token validity test expectations (#49) 2026-02-25 00:20:07 +00:00
storage First commit 2025-05-12 16:43:56 +01:00
test First commit 2025-05-12 16:43:56 +01:00
tmp First commit 2025-05-12 16:43:56 +01:00
vendor First commit 2025-05-12 16:43:56 +01:00
.dockerignore First commit 2025-05-12 16:43:56 +01:00
.env.example Add solid queue stuff 2025-05-12 21:25:13 +01:00
.envrc First commit 2025-05-12 16:43:56 +01:00
.gitignore Remove token validity checks from credit claiming logic (#47) 2026-02-24 23:47:52 +00:00
.rubocop.yml First commit 2025-05-12 16:43:56 +01:00
.ruby-version First commit 2025-05-12 16:43:56 +01:00
config.ru First commit 2025-05-12 16:43:56 +01:00
docker-compose.yml Add solid queue stuff 2025-05-12 21:25:13 +01:00
Dockerfile Fix asset permissions 2025-05-23 05:23:51 +00:00
flake.lock First commit 2025-05-12 16:43:56 +01:00
flake.nix Add Git pull to flake.nix 2025-05-21 12:08:27 +01:00
Gemfile Add codes system 2025-05-22 19:17:08 +01:00
Gemfile.lock Add codes system 2025-05-22 19:17:08 +01:00
LICENSE Initial commit 2025-05-12 13:49:49 +00:00
Rakefile First commit 2025-05-12 16:43:56 +01:00
README.md Even simpler README 2025-05-21 19:37:20 +01:00
rollback.sh Add update and rollback scripts 2025-05-23 06:28:16 +00:00
update_and_monitor.sh Add update and rollback scripts 2025-05-23 06:28:16 +00:00
users.md Remove letter_opener 2025-05-12 21:59:54 +01:00

ESP32-WEB-FORM-TRIGGER

Rails app for form collection → ESP32 pin activation.

Core Components

Models

  • Device: 12-char ID, name, location
  • Form: Customizable fields, styling, target email
  • Submission: User data, trigger status, delivery metadata

API

  • GET /api/v1/credits/check - Query available triggers
  • POST /api/v1/credits/claim - Execute pin trigger

URL Schema

Form endpoint: /form/:form_id/:device_id

Technical Specifications

Requirements

  • Ruby 3.4+
  • Rails 8.0+
  • Dependencies: Redcarpet, ActiveStorage, SolidQueue

Installation

git clone <repo>
bundle install
rails db:migrate
rails server

Email Configuration

Set vars in .env:

SMTP_SERVER=smtp.example.com
SMTP_PORT=587
SMTP_DOMAIN=example.com
SMTP_USERNAME=user@example.com
SMTP_PASSWORD=password
SMTP_AUTH=plain
SMTP_STARTTLS=true
DEFAULT_EMAIL_FROM=noreply@example.com

Queue Management

bin/jobs start       # Start worker
bin/jobs stats       # Monitor stats
JOB_CONCURRENCY=n    # Set worker threads (default: 1)

Docker Deployment

docker build -t esp32-form-app .
docker run -p 3000:3000 -e RAILS_MASTER_KEY=key -e SMTP_SERVER=smtp.example.com esp32-form-app

# Alternative
docker-compose up -d