Setup guide
About 20 minutes, no coding, and free for a small fleet. You need a Google account (for Firebase, which stores the live locations) and an email address (for Netlify, which puts the app online).
Part 1 · Create the Firebase database
Firebase menus move around from time to time. If you can't find a menu item, type its name into the search box at the top of the Firebase console.
- Create a project. Go to console.firebase.google.com, sign in with Google, and click Create a project. Name it, for example
fleet-tracker. Google Analytics isn't needed, so you can turn it off. - Create the Realtime Database. In the left menu open Realtime Database (under Databases & Storage or Build) and click Create Database.
- Location: Singapore (asia-southeast1), the closest one to the Philippines.
- Security: choose Start in locked mode, then Enable.
- Paste the security rules. On the Realtime Database page open the Rules tab. Delete everything in the box, paste the whole contents of the file
database.rules.jsonfrom this folder (open it with Notepad or TextEdit), and click Publish.These rules make sure only your dispatchers can see the map, and only phones with your fleet code can send locations. - Turn on sign-in. Open Authentication → Get started → Sign-in method tab.
- Click Email/Password, switch on the first toggle, and click Save. This is for dispatchers.
- Click Add new provider → Anonymous, switch it on, and click Save. This lets drivers connect without a password.
- Get your app settings. Click the gear icon → Project settings → General. Under Your apps, click the web icon </>, enter any nickname, and click Register app. You don't need Firebase Hosting. Firebase then shows a block of code like this:
const firebaseConfig = { apiKey: "AIzaSyB…", authDomain: "fleet-tracker-1a2b3.firebaseapp.com", databaseURL: "https://fleet-tracker-1a2b3-default-rtdb.asia-southeast1.firebasedatabase.app", projectId: "fleet-tracker-1a2b3", storageBucket: "fleet-tracker-1a2b3.firebasestorage.app", messagingSenderId: "1234567890", appId: "1:1234567890:web:abc123" };Keep this page open for the next step. You can always find it again under Project settings → General → Your apps.
Part 2 · Put your settings in the app
- Edit
config.js. Openconfig.jsfrom this folder in Notepad (Windows) or TextEdit (Mac). Replace eachPASTE_…value with the matching value from step 5, keeping the quotes. Save the file.Check thedatabaseURLline. If Firebase's code block didn't include it, copy the address shown at the top of the Realtime Database Data tab (it ends infirebasedatabase.app).You can also change
appNameto your company's name. It appears at the top of every page.These values aren't secret passwords. Every website that uses Firebase includes them. The security rules from step 3 are what protect your data.
Part 3 · Put it online
- Upload to Netlify. Go to app.netlify.com/drop and drag the whole
fleet-trackerfolder onto the page. In a few seconds you get a web address likehttps://random-name-123.netlify.app.Claim it right away. Sign up for a free Netlify account and claim the site, or Netlify deletes it within an hour. After that you can change the name under the project's configuration, for example toyourcompany-trucks.netlify.app. - Allow your web address in Firebase. In Firebase open Authentication → Settings → Authorized domains → Add domain, and enter your Netlify address without
https://, for exampleyourcompany-trucks.netlify.app.
Part 4 · First run
- Become the owner. Do this immediately after step 8. Open
https://your-address.netlify.app/dispatch.html, choose First time? Create account, and enter your email and a password. The first account ever created becomes the owner. - Set the fleet code. The Settings panel opens by itself. Type a code or tap Make one for me, then Save code.
- Invite drivers. Under Driver link, tap Copy and send the link to your drivers by Viber, Messenger or SMS. Each driver opens it on their phone, enters the plate number and their name, taps Start tracking, and allows location access. The truck appears on your map within seconds.
- Add other dispatchers (optional). Under Settings → Dispatchers, add their email. They open
dispatch.html, choose Create account, and use that same email.
Daily use
For drivers
- Use Chrome on Android or Safari on iPhone. Add the page to the home screen (the driver page explains how) so it opens like an app.
- Tap Start tracking at the start of the shift and Tracking ON → stop at the end.
- Keep the tracker on screen. Mount the phone on the dashboard and keep it charging. The page keeps the screen awake by itself. If the driver locks the phone or opens Waze or Viber, tracking pauses and the map shows Paused until they come back.
- It uses very little mobile data, only a few megabytes a day.
What the colours mean on the map
Route history
Click a truck, then Route today. Pick another date to see an earlier day. History older than 60 days is deleted automatically (change keepHistoryDays in config.js).
Changing settings later
Edit config.js, then in Netlify open your project → Deploys and drag the folder onto the upload box again. Drivers get the update the next time they open the page.
JAX Fleet Tracker app (Android)
Drivers with Android phones can use the JAX Fleet Tracker app instead of the web page. It keeps tracking with the screen locked or while they use Waze or Viber. Trucks using the app show on the same map.
- Put
JAX-Fleet-Tracker.apkin this folder and upload the folder to Netlify again. - Send drivers the app download link (Settings → JAX Fleet Tracker app) and the driver link.
- In the app, the driver pastes the driver link, enters the plate number and name, and taps START TRACKING. Then they work through the app's Set up this phone list.
Limits of the free setup
| What | Free limit (Firebase Spark plan) | What it means for you |
|---|---|---|
| Phones and screens connected at once | 100 | Drivers tracking plus dispatcher screens open. Fine for up to about 90 trucks. |
| Data sent to dispatcher screens | 10 GB per month | Enough for about 50 trucks updating every 10 seconds, all day, with a couple of dispatcher screens. For more, set sendEverySeconds to 20 or 30. |
| Stored history | 1 GB | Many months of routes for a small fleet. |
If a free limit is reached, Firebase stops the database until the next month. To grow past these limits, upgrade the Firebase project to the pay-as-you-go Blaze plan.
Privacy
Tell drivers in writing what is tracked (location and speed, only while they tap Start) and why, and keep their acknowledgment. This follows the spirit of the Data Privacy Act of 2012 (RA 10173). Ask your lawyer for the exact wording.
If something goes wrong
| You see | Fix |
|---|---|
| The map still shows demo trucks | config.js still has PASTE_… values, or you didn't upload the folder again after editing it. |
| Driver: “The dispatcher system refused this phone” | Wrong or old fleet code. The driver stops tracking, taps Change, and enters the current code. Or send them the driver link again. |
| Driver: “Anonymous sign-in is turned off” | Redo step 4 (the Anonymous part). |
| Driver: “Location permission is blocked” | Follow “Location not working?” on the driver page, then reload. |
| Dispatcher: “No access yet” | The owner adds that email under Settings → Dispatchers. |
| Errors mentioning “permission denied” right after setup | The rules weren't published. Redo step 3. |
| Sign-in fails with a domain error | Redo step 8 with the exact Netlify address. |
| Truck often shows Paused | The driver keeps switching to other apps. Remind them to keep the tracker on screen. |