1
0
Fork 0
mirror of https://github.com/chobble-mirror/esp32-web-form-trigger.git synced 2025-08-20 15:49:52 +00:00
No description
Find a file
2025-06-04 14:10:56 +01:00
.github First commit 2025-05-12 16:43:56 +01:00
app Make header image clickable 2025-06-04 14:10:56 +01:00
bin Fix asset permissions 2025-05-23 05:23:51 +00:00
config Precompile assets 2025-05-23 05:18:29 +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 Apply Standard Ruby autofixes 2025-05-23 08:26:50 +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 Add CSS classes to public forms 2025-06-04 12:58:43 +01: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