mirror of
https://github.com/chobble-mirror/esp32-web-form-trigger.git
synced 2025-08-20 15:49:52 +00:00
No description
.github | ||
app | ||
bin | ||
config | ||
db | ||
esp32-micropython | ||
lib | ||
log | ||
public | ||
spec | ||
storage | ||
test | ||
tmp | ||
vendor | ||
.dockerignore | ||
.env.example | ||
.envrc | ||
.gitignore | ||
.rubocop.yml | ||
.ruby-version | ||
config.ru | ||
docker-compose.yml | ||
Dockerfile | ||
flake.lock | ||
flake.nix | ||
Gemfile | ||
Gemfile.lock | ||
LICENSE | ||
Rakefile | ||
README.md | ||
rollback.sh | ||
update_and_monitor.sh | ||
users.md |
ESP32-WEB-FORM-TRIGGER
Rails app for form collection → ESP32 pin activation.
Core Components
Models
Device
: 12-char ID, name, locationForm
: Customizable fields, styling, target emailSubmission
: User data, trigger status, delivery metadata
API
GET /api/v1/credits/check
- Query available triggersPOST /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