EquipTrack — Sistema de Estoque para Eventos
A complete inventory and rental management system for event companies. Manages audio systems, cameras, lighting rigs, video boards, and event furniture across concurrent events — with full branding customization so any company can deploy it as their own tool.
Core Modules
| Module | Description |
|---|---|
| Events | Create, search, and manage events. Each event tracks its equipment assignments. |
| Rental | Check equipment in and out per event. Prevents overbooking across simultaneous events. |
| Maintenance | Register damage, breakdowns, and repairs on equipment and cables. Tracks maintenance history. |
| Database (Banco) | Full browse view of registered equipment, cables, and other items. |
| Register | Add new equipment by name, barcode, and category. Separate forms for equipment, cables, and generic items. |
| History | Full audit log of all rental movements and event operations. |
| Users (Admin) | Admin-only panel for managing login accounts and permissions. |
Architecture
Browser (Client)
└─ public/
├─ login/index.html ← Login + guest mode toggle
├─ index.html ← Main SPA (all modules as sections)
├─ css/ ← Modular styles: app.css, theme.css, login.css, event.css
├─ js/ ← app.js, login.js, event.js, storage.js
└─ assets/images/ ← Logo, favicon (WebP)
Cloudflare Worker (Edge)
└─ src/worker.mjs
├─ Page routing ← Redirects authenticated users away from login
├─ /api/login POST ← bcrypt session authentication
├─ /api/logout POST ← Session invalidation
├─ /api/auth/status GET ← Auth check (guest detection)
├─ /api/events ← CRUD for events
├─ /api/equipments ← CRUD for equipment
├─ /api/cables ← CRUD for cables
├─ /api/others ← CRUD for generic items
├─ /api/rentals ← Rental movements per event
├─ /api/maintenance ← Damage and repair records
├─ /api/history ← Full movement log
└─ /api/users ← Admin-only user management
Cloudflare D1 (SQLite)
└─ migrations/0001_initial.sql
├─ users
├─ events
├─ equipments
├─ cables
├─ other_items
├─ rentals
├─ maintenance
└─ history
Guest Mode
Users can enter as Convidado (Guest) without credentials. In guest mode, all data is persisted entirely in localStorage via the DataStorage class in js/storage.js, which transparently switches between the API and browser-local storage depending on authentication state. Guest data is scoped per browser session and requires no server interaction.
Theme Customization
All color values are driven by CSS custom properties (--primary, --primary-2, --primary-3, etc.) defined in css/theme.css. Users can pick a custom accent color via an in-app color picker, which writes to localStorage and applies immediately via document.documentElement.style.setProperty(). Custom logo images and favicons can also be set and are persisted to localStorage as base64 strings.
Inline SVG Icons
The original system used emoji characters as menu icons. These were replaced with custom inline SVGs whose stroke color inherits currentColor, allowing them to automatically adapt to the active theme color set via the CSS --primary variable. This makes the entire icon set theme-aware with zero JavaScript overhead.
Sidebar Toggle
A collapsible sidebar was added via a toggle button (#sidebarToggle). When collapsed, the sidebar slides out of view and the main content area expands — useful on smaller screens and for focused work sessions.
Automatic Versioning & Cache Busting (GitHub Actions)
Two GitHub Actions workflows automate the deployment pipeline:
- deploy-pages.yml — On push to
main, checks out the repo, injects the short Git commit SHA into all__BUILD_VERSION__placeholders in HTML files (used in?v=__BUILD_VERSION__CSS/JS links), then deployspublic/to GitHub Pages. - sync-docs.yml — Whenever
public/changes, automatically copies it todocs/, injects the same build version token, commits, and pushes — keeping thedocs/folder in sync for alternative GitHub Pages hosting.
Cloudflare D1 Deployment
# Install dependencies
npm install
# Login to Cloudflare
npx wrangler login
# Create D1 database
npx wrangler d1 create sistema-estoque-24h
# Apply schema migrations
npx wrangler d1 migrations apply sistema-estoque-24h --remote
# Export local SQLite data to D1-compatible SQL
npm run export:d1
npx wrangler d1 execute sistema-estoque-24h --remote --file d1-export.sql
# Deploy worker
npm run deploy
Local Development
npm install
npm run dev # Express server on localhost
# or
npm run dev:worker # Wrangler local emulation