59 lines
1.0 KiB
Markdown
59 lines
1.0 KiB
Markdown
# 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:
|
|
```bash
|
|
npm install
|
|
```
|
|
3. Copy `.env.example` to `.env` and configure your settings:
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
4. Build the TypeScript code:
|
|
```bash
|
|
npm run build
|
|
```
|
|
5. Start the server:
|
|
```bash
|
|
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:
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
## Security
|
|
|
|
- JWT authentication (to be implemented)
|
|
- Rate limiting enabled
|
|
- CORS protection
|
|
- Helmet security headers
|