Frontend Changes:
- Enhanced mobile responsiveness:
* Reduced top spacing on mobile screens
* Made the gate control button larger and full-width on mobile
* Improved text sizing and padding for better readability
- Improved visual design:
* Enhanced macOS-style glass effect with deeper shadows
* Added subtle gradient background with brand colors
* Made backgrounds more translucent with white overlays
* Added consistent border styling with white/50 opacity
* Enhanced hover states with smoother transitions
* Added shadow to the status indicator dot
* Made the settings modal more translucent
* Improved button styling consistency
Backend Changes:
- Updated static files path to use relative path ("../public")
- Removed HTTPS/SSL:
* Changed API endpoint in frontend from HTTPS to HTTP
* Removed redirect.py as it's no longer needed for HTTPS redirection
* Simplified deployment by removing SSL-related configurations
Deployment Improvements:
- Fixed deployment script issues:
* Preserved proper backend directory structure
* Added proper directory handling for tar files
* Fixed tar file naming consistency
* Removed chmod for non-existent redirect.py
* Added cd command to ensure correct working directory
* Updated file paths to use absolute paths where needed
Testing:
- Verified mobile UI improvements
- Confirmed HTTP endpoints are working
- Tested gate control functionality
- Validated settings modal operation
|
||
|---|---|---|
| backend | ||
| frontend | ||
| .gitignore | ||
| README.md | ||
| deploy.sh | ||
README.md
DLB Gate Keeper
A Raspberry Pi-based gate control system with a web interface.
Architecture
- Backend: Python FastAPI server with direct GPIO control
- Frontend: React/TypeScript web interface
- Database: SQLite for event logging and settings
- Service: Systemd service for automatic startup and monitoring
Development Setup
Backend (Python)
- Install Python dependencies:
cd backend
pip install -r requirements.txt
- Run the development server:
uvicorn main:app --reload --host 0.0.0.0 --port 3000
Frontend (React)
- Install Node.js dependencies:
cd frontend
npm install
- Start the development server:
npm run dev
Deployment
- Deploy to Raspberry Pi:
./deploy.sh
This will:
- Build the frontend
- Package the Python backend
- Copy files to the Raspberry Pi
- Install Python dependencies
- Set up and start the systemd service
GPIO Setup
The application uses GPIO pin 17 (BCM numbering) by default. You can change this by setting the RELAY_PIN environment variable in the systemd service file.
Make sure the gatekeeper user has access to GPIO:
sudo usermod -a -G gpio gatekeeper
API Endpoints
POST /api/trigger/{direction}- Trigger gate (direction: "open" or "close")GET /api/events- Get recent gate eventsGET /api/settings- Get current settingsPOST /api/settings- Update settings
License
MIT