API Docs
Master Operations, User Onboarding & Live Simulation

Almodesk Mobile Tracker
End-to-End Enterprise Workflow Blueprint

Detailed step-by-step documentation explaining how users are provisioned, how credentials flow, how permissions and background GPS services handshake, and how every role operates daily. Includes interactive phone simulations for Super Admin, Dealerships, Schools, Fleets, Drivers, Teachers, Field Agents, and Parents.

Model A
Dealership Route
Bulk Wallet / Resellers
Model B
Direct Route
Direct School / Enterprise
Roles Covered
8 Distinct Roles
Custom Dashboards
Engine
24x7 GPS Pings
Foreground Sticky Service
Section 1 • Hierarchy Architecture

Multi-Tier Routing: Model A vs Model B

A

Model A: Dealership (Partner / Reseller Ecosystem)

Super Admin operates as wholesale technology provider. Regional Dealerships purchase bulk licenses (e.g., 2,000 points) and provision end-client Admins (Schools, Companies, Families).

👑
Super Admin (Master System Owner)
Creates Dealerships • Allocates Global Points • Master System Audit
Master Level
🤝
Dealership (Partner / Reseller)
Holds Wallet (e.g. 1000 Pts) • Provisions Schools/Companies • Manages Renewals
Wholesale Partner
🏢
Admin (School / Company / Family)
Controls Fleet Routes, Classrooms, Shifts • Appoints Sub-Admins • Adds Users
Organization Head
🛡️
Sub-Admin (Operations Coordinator)
Daily Radar Monitoring • Attendance Checks • Cannot Modify Billing/Points
Operational Manager
👥
End Users (Driver, Teacher, Staff, Student, Agent, Parent)
Daily App Operations: Live Bus Trip, Class Attendance, GPS Pings, Parent Map
Mobile End-Users
MODEL A: எளிய தமிழ் செயல்முறை

Super Admin என்பவர் மெயின் ஓனர். அவர் Dealership (பார்ட்னர்)-களுக்கு 1000 அல்லது 2000 Points (லைசென்ஸ்) ஒதுக்குவார். டீலர்ஷிப் தனக்கு கீழே இருக்கும் பள்ளிகளுக்கு (School Admin) 50 பாயிண்ட்ஸ் பிரித்துக் கொடுப்பார். பள்ளி அட்மின் தங்களுக்கு கீழ் டிரைவர்கள், ஆசிரியர்கள், மாணவர்கள் மற்றும் பெற்றோர்களை சேர்த்து ஆப்-ஐ இயக்குவார்.

Section 2 • Organization Type Hierarchy Education • Company • Family Super Admin ➔ Last End-User

User Type Architecture: Education, Company & Family Models

Almodesk ecosystem-ல் உள்ள பயனாளர்கள் அமைப்பின் வகைக்கேற்ப (Organization Type) Education (பள்ளி/கல்லூரி), Company (கார்ப்பரேட்/லாஜிஸ்டிக்ஸ்), மற்றும் Family (குடும்ப பாதுகாப்பு) என 3 தனித்துவமான கட்டமைப்புகளாகப் பிரிக்கப்பட்டுள்ளனர். ஒவ்வொரு பிரிவிலும் Super Admin முதல் கீழ்மட்ட End-User வரை யார் யார் உள்ளார்கள், எப்படி App-ல் Entry ஆகிறார்கள் மற்றும் செயல்படுகிறார்கள் என்பதை கீழே விரிவாகக் காணலாம்!

Ecosystems 3 Types
Hierarchy End-to-End
Routes Model A / B
Select Organization Type:
🏫

Ecosystem 1: Education Model (School & College Transport) Org Type: Education

பள்ளி/கல்லூரி பேருந்து நேரலை ஜிபிஎஸ், வருகைப் பதிவு (Roll Call), பஸ்-வகுப்பறை ஒப்பீடு & பெற்றோர் நேரலை வரைபடக் கட்டமைப்பு.

8 Hierarchical Roles
📍 Complete Education Authority Chain (Super Admin ➔ Last User):
👑 Super Admin ➔ 🤝 Dealership (Reseller) ➔ 🏫 School Admin ➔ 🛡️ Sub-Admin (Dispatcher) ➔ 🚌 Bus Driver + 📚 Class Teacher ➔ 👨‍👩‍👧 Parent + 🎒 Student
🏢

Ecosystem 2: Company Model (Corporate & Logistics Fleet) Org Type: Company

களப்பணியாளர்கள் செல்ஃபி பஞ்ச்-இன், இருப்பிட வரைபடம் (Geofence), பயண தூர கணக்கீடு (Km Mileage) & டெலிவரி டிராக்கிங்.

7 Hierarchical Roles
📍 Complete Company Authority Chain (Super Admin ➔ Last User):
👑 Super Admin ➔ 🤝 Dealership (B2B Partner) ➔ 🏢 Company Admin (MD/HR) ➔ 🛡️ Sub-Admin (Branch Manager) ➔ 💼 Field Sales Agent + 🚚 Delivery Driver + 👔 Office Staff
👨‍👩‍👧

Ecosystem 3: Family Model (Personal Safety & Geofenced Hub) Org Type: Family

குடும்ப உறுப்பினர்கள், குழந்தைகள் பள்ளி செல்லும் வழி, முதியோர் அவசர உதவி (SOS) மற்றும் குடும்ப வாகன ஜிபிஎஸ் பகிர்வு.

7 Hierarchical Roles
📍 Complete Family Authority Chain (Super Admin ➔ Last User):
👑 Super Admin ➔ 🤝 Dealership (Retail Partner) ➔ 👨‍👩‍👧 Family Admin (Head) ➔ 🛡️ Sub-Admin (Co-Parent) ➔ 🧒 Child / Kid + 👴 Elderly Dependent + 🚗 Family Vehicle
🏫

School Admin Entity Inspector

Education Ecosystem
Role: admin • Org Type: Education
App Screen: EducationAdminDashboardScreen
Section 3 • User Entry Lifecycle

How Every User Enters the App (எப்படி Entry ஆகுது)

From Super Admin's initial quota issuance down to the end-user's background location handshake:

1

Step 1: Super Admin Provisions Dealership or Direct Admin

Super Admin Screen

Super Admin opens DealershipAddScreen in the app/portal. Enters: Entity Name (e.g., "Apex Telematics"), Points Quota (e.g., 1000), Expiry Date (e.g., 365 Days), and Brand Color (e.g., #000F66).

POST /superadmin/companies { "company_name": "Apex Telematics", "points": 1000, "expiry_date": "2027-10-31", "org_type": "Education" }
2

Step 2: Dealership / Super Admin Provisions Client Admin

Client Admin Creation

Dealership logs in, selects "Add Client", enters school details (*St. Thomas School*), allocates 50 Points from their dealer wallet, and sets password. Client Admin receives SMS: "Your Almodesk Portal is ready. User: admin@stthomas.edu | Pass: St#2026".

3

Step 3: Admin Provisions Sub-Admins & End Users

App: Communities Screen

Client Admin logs in, navigates to Communities (Users):

Drivers (1 Driver = 1 Bus Policy): Enters Driver Name, Mobile, and binds strictly to Bus #04.
Teachers: Enters Staff ID, Mobile, and assigns Class/Section (e.g. Grade 5-A).
Students & Parents: Enters Student Roll No, Bus Stop, and Parent's mobile (creates Parent login).
Field Staff & Agents: Enters Employee ID, Department, Geofence zones, and Shift hours.
4

Step 4: End User Login & Dynamic Role Routing

Flutter root_screen.dart

User logs in via LoginScreen. The app calls POST /auth/login. In root_screen.dart, the app inspects role and launches the exact view:

  • role == 'driver' ➔ Opens DriverBusTripScreen
  • role == 'parent' ➔ Opens ParentLiveTrackingScreen
  • role == 'teacher' ➔ Opens TeacherClassroomScreen
  • role == 'admin' ➔ Opens EducationAdminDashboardScreen
  • role == 'user' ➔ Opens AttendanceBasedDashboardScreen
5

Step 5: Background Location Permissions Handshake

Android / iOS OS Handshake

1. Location: "Allow all the time" (Background Access).
2. Sticky Foreground Service: Status bar sticky notification: "Almodesk Tracker Service is active".
3. Battery Optimization Bypass: "Unrestricted" so GPS continues when the screen is locked.

Section 4 • Onboarding Communication

SMS & WhatsApp Invitation Templates

Exact message formats sent to users when their accounts are provisioned:

Bus Driver Welcome Slip SMS / WhatsApp
Hello Murugan,
You have been assigned as driver for Bus #04 (Route North-A) at St. Thomas School.

📱 Download App: https://almodesk.com/app
👤 Mobile: 9876543210
🔑 Password: Bus#4402

*Please tap 'Allow all the time' for GPS permissions.*
Student Parent Welcome Slip SMS / WhatsApp
Dear Parent Mr. Sundaram,
Live tracking for Aarav (Grade 5-A, Bus #04) is now active!

📱 Install App: https://almodesk.com/parent
👤 Login Mobile: 9840123456
🔑 Password: Parent@2026

You can now track bus live on Google Maps and get Stop ETA alerts!
Class Teacher Portal Invitation SMS / Email
Dear Mrs. Geetha,
Your classroom attendance portal for Grade 5-Section A is active.

🌐 Portal: https://almodesk.com/workflow
👤 Email: geetha@stthomas.edu
🔑 Default Password: Teach#2026

Conduct daily roll call and review bus arrival discrepancies.
Field Employee Onboarding Corporate SMS
Hello Vignesh (EMP-1048),
Your duty shift tracker is ready.

📱 App: https://almodesk.com/app
👤 Mobile: 9789012345
🔑 Temporary Password: Shift#2026

Take morning selfie inside office geofence to clock in attendance.
Section 5 • Input Forms Reference

Exact Screen Fields & Form Matrix

Detailed fields, validations, and endpoints from the Flutter codebase:

1. DealershipAddScreen (dealership_add_screen.dart) POST /superadmin/companies
FieldTypeDefault / ValidationPurpose
company_nameTextRequiredName of the dealership entity
user_pointsNumberDefault: 50 (or 1000)Total bulk quota licenses granted to partner
expiry_dateDateDefault: Today + 365 daysPartner subscription validity period
org_typeDropdownEducation / Company / FamilySets organization operational model
brand_colorHex ColorDefault: #000F66White-label UI accent branding
logoImage/Base64Max 600x600 Quality 85Custom Partner/School Logo
2. EducationUserAddScreen (Driver / Teacher / Student) POST /education/drivers/save & /teachers/save
FieldTypeApplicable RolePurpose
name & mobile_numberTextAll RolesPrimary identification & login credential
assigned_bus_idDropdownDriver (1 Driver = 1 Bus)Binds driver strictly to GPS hardware / bus
assigned_class_idDropdownTeacherAssigns class section (e.g. Grade 5-A) for roll call
parent_mobile_numberNumberStudentCreates guardian login profile automatically
bus_stop_idDropdownStudentFixes morning pickup & evening drop coordinates
Section 6 • Operational Timeline

Daily Hour-by-Hour Execution Routine

How drivers, teachers, parents, and admins coordinate smoothly from sunrise to evening:

Bus Driver's Daily Routine:
06:30 AM Arrives at depot. Opens app. Bus #04 auto-loads. Taps "Start Morning Trip".
07:00 - 07:45 AM Arrives at stops. Taps student names to mark "Boarded". GPS pings transmit continuously.
08:00 AM Arrives at school. Verifies empty bus. Taps "Complete Morning Trip".
03:30 - 04:30 PM Repeats procedure for "Evening Drop Trip", marking students as they deboard.
Class Teacher's Daily Routine:
08:30 AM Opens Classroom Sheet. Grade 5-A roster loaded with morning bus arrival flags.
08:35 AM Conducts roll call. Marks Present, Absent, or Late.
08:40 AM Cross-checks Discrepancy flags (Students who boarded bus but missing in class). Submits sheet.
Parent's Daily Routine:
07:15 AM Opens app. Watches live bus move on Google Maps with ETA (e.g. 8 mins remaining).
07:25 AM Child boards bus. Receives instant confirmed notification: "Aarav boarded Bus #04".
03:45 PM Tracks evening bus return journey. Meets child on time without waiting in the sun.
Section 7 • Operations Manual

Role Operational Guides (எப்படி Use பண்ணனும்)

Daily operational routines, screen walkthroughs, buttons, and pro-tips for every single role:

👑

1. Super Admin (Master System Owner)

Master Organization & Quota Governance
Master Level

Primary Responsibility: Top-tier governance. Super Admin monitors global connected vehicle counts, creates regional Dealerships, sets initial quota wallets, and extends expiring subscription packages.

Key Screens: dealershipListScreen, dealershipAddScreen, updatePointsExpiryScreen.

🔊 தமிழ் சுருக்கம்: Super Admin Drawer மெனுவில் Dealerships-க்கு சென்று புதிய பார்ட்னர்களை சேர்ப்பார் மற்றும் பாயிண்ட்ஸ் ஒதுக்கீடு செய்வார்.
🤝

2. Dealership (Partner / Reseller)

B2B Partner & Client License Wallet
Model A Reseller

Primary Responsibility: Distributing licenses to local schools, colleges, and commercial fleets under their allocated bulk wallet. Monitors renewal expiry dates and handles local client billing.

Workflow: Dealer checks balance (e.g. 1,450 / 2,000 pts) ➔ Onboards School with 50 points ➔ Delivers credentials ➔ Collects yearly renewal fee.

🔊 தமிழ் சுருக்கம்: டீலர்ஷிப் தனக்கு இருக்கும் மொத்த பாயிண்ட்ஸ்-ல் இருந்து பள்ளிகளுக்கு 50 அல்லது 100 பாயிண்ட்ஸ் வழங்கி புதிய School Admin-ஐ உருவாக்குவார்.
🏢

3. Admin (School / Company / Family)

Institutional Command & Fleet Radar
Organization Head

Daily Routine (School Admin):
• 06:45 AM: Opens EducationAdminDashboardScreen. Monitors active buses.
• 07:30 AM: Checks live speed flags (>50 km/h warnings).
• 09:00 AM: Audits Attendance Discrepancies (Students who boarded bus but missing in class).
• 04:30 PM: Evening drop fleet tracking until all trips conclude.

🔊 தமிழ் சுருக்கம்: பள்ளி அட்மின் காலையில் Live Fleet Radar-ல் அனைத்து பஸ்களும் இயக்கத்தில் உள்ளதா எனப் பார்ப்பார். மாணவர் பஸ்ஸில் ஏறிவிட்டு வகுப்பறைக்கு வரவில்லை என்றால் Discrepancy Alert மூலம் உடனே கண்டுபிடிப்பார்.
🚌

4. Driver (Bus Trip & Fleet Operations)

Bus Route Execution & Student Safety
Logistics Driver

Step-by-Step Procedure:
1. Login: Assigned bus (Bus #04) is loaded automatically (1 Driver = 1 Bus Policy).
2. Start Morning Trip: Taps "START MORNING TRIP" (POST /education/trip/start). Background GPS pinging begins broadcasting live coordinates to /education/trip/location-ping.
3. Boarding Checklist: At each bus stop, driver taps "Mark Board" (turns green: "✓ BOARDED"). Parents receive instant push notifications.
4. SOS Panic Button: In case of accident or breakdown, driver presses "🚨 TRIGGER SOS".
5. Complete Trip: Driver taps "Complete Trip" (POST /education/trip/end).

🔊 தமிழ் சுருக்கம்: டிரைவர் காலை பஸ் எடுக்கும் போது "START MORNING TRIP" கொடுப்பார். மாணவர்கள் ஏறும் போது "BOARDED" என குறிப்பார். பள்ளிக்கு சென்றதும் "COMPLETE TRIP" கொடுப்பார்.
📚

5. Teacher (Classroom & Roll Call)

Academic Attendance Verification
Academic Staff

1. 08:30 AM: Opens TeacherClassroomScreen. Assigned class (e.g. Grade 5-A) loads automatically.
2. Roll Call: Marks students Present, Absent, or Late.
3. Discrepancy Alert: If a student boarded the bus but was absent in the classroom, a bright red alert triggers: 🚨 ATTENDANCE DISCREPANCY DETECTED.
4. Submit: Taps "Submit Attendance" (POST /education/classroom/mark).

🔊 தமிழ் சுருக்கம்: ஆசிரியர் வகுப்பறையில் வருகை பதிவு எடுப்பார். பஸ்ஸில் ஏறிவிட்டு வகுப்பறைக்கு வராத மாணவர்களை சிஸ்டம் உடனே சிவப்பு நிறத்தில் எச்சரிக்கும்.
💼

6. Staff & Field Agent (Punch-in & GPS Breadcrumbs)

Field Workforce Travel & Shift Tracking
Corporate Staff

1. Geo-Punch In: Snaps selfie with location verified inside office geofence ➔ Taps "PUNCH IN".
2. Field Travel: Background GPS service logs travel route and client visits.
3. Punch Out: Taps "PUNCH OUT" at end of day. Displays hours worked and total km covered.

👨‍👩‍👧

7. Parent (Live Guardian App)

Realtime Bus Radar & Child Arrival Safety
Parent / Guardian

1. Live Google Map: Opens ParentLiveTrackingScreen. Watches bus movement along polyline routes.
2. Smart ETA: Shows exact minutes remaining (e.g. "ETA: 7 Mins (1.8 km)").
3. Boarding Badge: Shows confirmed boarding time ("● Boarded Bus #04 at 07:42 AM").
4. Call Driver: One-tap button to call driver directly.

🔊 தமிழ் சுருக்கம்: பெற்றோர் ஆப்-ல் பஸ் எங்கு வருகிறது என்பதை Google Map-ல் நேரடியாக பார்க்கலாம். உங்கள் ஸ்டாப்பிற்கு வர எத்தனை நிமிடங்கள் ஆகும் (ETA) என்பதை ஆப் காட்டும்.
Section 8 • Native Engine

Background Location Engine & Phone Settings

How Flutter Background Service maintains uninterrupted GPS tracking in standby:

Samsung (OneUI)

Settings ➔ Apps ➔ Almodesk Tracker ➔ Battery ➔ Select "Unrestricted". Turn off "Put unused apps to sleep".

Xiaomi / Redmi (MIUI)

App Info ➔ Autostart ➔ Enable. Battery Saver ➔ Select "No restrictions".

Vivo / Oppo / Realme

Settings ➔ Battery ➔ High Background Power Consumption ➔ Allow Almodesk Tracker.

Apple iOS

Settings ➔ Almodesk Tracker ➔ Location ➔ Select "Always" and enable "Precise Location".

Section 9 • Robust Operations

Edge Cases & Offline Fallback Architecture

How the application gracefully handles transient network loss and operational anomalies:

1. Network Disconnection / Tunnel Drops:

If cellular connection drops during a trip, coordinates are queued into local SQLite database. When 4G/5G restores, the app syncs the backlog in chronological batches to /education/trip/location-ping.

2. Driver Forgets to Complete Trip:

If a trip remains active after 4 hours without movement, the server flags the trip and prompts the School Admin with an auto-close modal to prevent battery drain on the driver's phone.

3. Quota Expiry Alert:

When an organization runs low on points or reaches within 14 days of subscription expiry, a warning badge appears on the Admin dashboard prompting immediate license recharge.

4. Emergency SOS Alarm Escalation:

When SOS is triggered, a loud continuous audible siren rings on the Admin dashboard with flashing red pin markers until resolved with an operator note.

Section 10 • API Reference

Backend API Endpoints Reference

Method & Route Module Description Roles
POST /auth/login Auth Authenticates credentials, returns JWT & user role All
POST /superadmin/companies SuperAdmin Creates Dealership or Direct Company with point quotas Super Admin
POST /education/trip/start Education Starts school bus trip and initiates live GPS ping loop Driver
POST /education/trip/toggle-boarding Education Toggles student boarded status on bus checklist Driver
GET /education/parent/live-tracking Education Returns real-time bus coordinates, polyline, and stop ETA Parent
POST /education/sos/trigger Education Broadcasts panic alert with GPS coordinates to Admin desk Driver, Parent