Your ticket printer app is now ready to deploy!
β
Frontend - Ready for Netlify (in frontend/ folder)
β
Backend API - Ready for Raspberry Pi (in backend/ folder)
β
Configuration - netlify.toml and .gitignore ready
β
Documentation - Complete guides created
# Create GitHub repo (on github.com first), then:
git add .
git commit -m "Ready for Netlify deployment"
git remote add origin https://github.com/YOUR_USERNAME/ticket-printer-app.git
git branch -M main
git push -u origin main- Go to https://netlify.com β Sign up/Login
- Click "Add new site" β "Import from Git"
- Select your repository
- Settings:
- Build command:
echo "No build required" - Publish directory:
frontend
- Build command:
- Click "Deploy site"
- Copy your site URL (e.g.,
amazing-ticket-app.netlify.app)
# SSH into your Pi
ssh [email protected]
# Clone the repo
git clone https://github.com/YOUR_USERNAME/ticket-printer-app.git
cd ticket-printer-app/backend
# Install dependencies
pip3 install -r requirements.txt
# Configure printer (if needed)
sudo lsusb # Get printer vendor/product IDs
nano api.py # Update IDs if different
# Start the API
python3 api.py# On Raspberry Pi
# Download ngrok
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm.tgz
tar -xvzf ngrok-v3-stable-linux-arm.tgz
sudo mv ngrok /usr/local/bin/
# Start tunnel
ngrok http 5000
# COPY the HTTPS URL (e.g., https://abc123.ngrok.io)Option A: Edit the code
# Open frontend/index.html on your computer
# Line 196 - replace:
const productionApiUrl = 'https://YOUR-NGROK-URL.ngrok.io';
# Push the change
git add frontend/index.html
git commit -m "Update API URL"
git pushNetlify will auto-deploy!
Option B: Use Netlify environment variable
- Netlify dashboard β Site settings β Environment variables
- Add:
REACT_APP_API_URL=https://your-ngrok-url.ngrok.io - Deploy settings β Trigger deploy
- Visit your Netlify site
- Fill out the form
- Submit a ticket
- Check your Raspberry Pi - it should print!
ticket-printer-app/
βββ frontend/ β Deploy THIS to Netlify
β βββ index.html
βββ backend/ β Run THIS on Raspberry Pi
β βββ api.py
β βββ requirements.txt
βββ app.py β Original (can be ignored)
βββ netlify.toml β Netlify configuration
βββ README_NETLIFY.md β Quick start guide
βββ GITHUB_DEPLOYMENT.md β Detailed deployment
βββ .gitignore β Git configuration
- Quick guide:
README_NETLIFY.md - Full deployment:
GITHUB_DEPLOYMENT.md - Raspberry Pi setup:
DEPLOYMENT.md
After basic deploy is working:
- Keep ngrok running with systemd (see GITHUB_DEPLOYMENT.md)
- Add API authentication for security
- Set up Cloudflare tunnel for persistence
- Monitor with logging
User's Browser
β
Netlify (Frontend)
β
ngrok/Cloudflare Tunnel
β
Raspberry Pi API
β
Thermal Printer
That's it! You should be printing in about 10 minutes. π