Installation Guide
This guide provides step-by-step instructions for installing and running WTicket locally.
Step 1: Clone the Repository
Clone the WTicket repository from GitHub:
git clone https://github.com/wisrovi/wticket.git
cd wticket
Step 2: Create JSONBin.io Bins
JSONBin.io provides the data persistence layer for WTicket. Follow these steps:
Visit JSONBin.io and create a free account
Navigate to the dashboard and create three new bins:
Users Bin: Stores user account data
Tickets Bin: Stores all ticket information
Counter Bin: Manages ticket ID sequencing
Copy the Bin IDs from each bin’s URL
Navigate to your profile and generate an API Key
Step 3: Configure the Application
Edit the configuration section in js/app.js:
// JSONBin.io Configuration
const JSONBIN_BASE_URL = 'https://api.jsonbin.io/v3';
const JSONBIN_API_KEY = 'your-master-key-here';
const BIN_IDS = {
users: 'your-users-bin-id',
tickets: 'your-tickets-bin-id',
counter: 'your-counter-bin-id'
};
Step 4: Local Development Server
Start a local HTTP server to test the application:
Using Python 3:
python3 -m http.server 8000
Using Node.js:
npx serve .
Using PHP:
php -S localhost:8000
Access the application at http://localhost:8000
Step 5: Verify Installation
After starting the server:
Open
http://localhost:8000in your browserVerify the public dashboard displays statistics
Navigate to the login page
Test user registration with a new account
Create a sample ticket to verify data persistence
Troubleshooting
Issue: CORS Errors
Ensure your JSONBin bins are configured with proper CORS headers to allow requests from your domain.
Issue: Service Worker Not Caching
Clear browser cache and unregister existing service workers before testing.
Issue: Data Not Persisting
Verify your JSONBin API key has write permissions enabled.