dlbGatekeeper/README.md

1.0 KiB

DLB Gatekeeper

A Node.js application for controlling a gate via Raspberry Pi GPIO.

Features

  • REST API for gate control
  • Event logging
  • Configurable settings
  • GPIO control for relay
  • Simple web interface

Installation

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Copy .env.example to .env and configure your settings:
cp .env.example .env
  1. Build the TypeScript code:
npm run build
  1. Start the server:
npm start

API Endpoints

  • POST /api/trigger - Trigger the gate
  • GET /api/events - Get recent gate events
  • GET /api/settings - Get current settings
  • POST /api/settings - Update settings

Hardware Setup

  • Connect relay control to GPIO pin (default: 18)
  • Ensure proper power supply for the relay
  • Ground connections as needed

Development

Run in development mode with auto-reload:

npm run dev

Security

  • JWT authentication (to be implemented)
  • Rate limiting enabled
  • CORS protection
  • Helmet security headers