A complete, production-ready GPS tracking system with real-time device monitoring, admin controls, and cross-platform support.
- Real-time Device Tracking - Live location updates every 30 seconds
- Device Management - Send messages, lock screens, execute commands
- Cross-Platform Support - Desktop (Windows/macOS/Linux), Mobile (iOS/Android), GPS Hardware
- Online/Offline Capability - Works with GSM networks for offline tracking
- Admin Dashboard - Modern React-based web interface
- Production Ready - Scalable backend with MongoDB, secure authentication
- Easy Deployment - One-click deployment to Railway + Vercel
Your devices are displayed with real-time status, location, and battery information.
Click any device to send messages, lock screens, or execute remote commands.
βββ server/ # Backend API (Node.js + TypeScript)
βββ client/ # Web Dashboard (React + TypeScript)
βββ device-agents/ # Device monitoring agents
β βββ desktop/ # Python agent for computers
β βββ mobile/ # React Native app
βββ docs/ # Documentation and guides
βββ arduino/ # Hardware tracker firmware
- Node.js 16+
- Python 3.8+
- MongoDB (or use MongoDB Atlas)
git clone https://github.com/ryanstewart047/trackingsystem.git
cd trackingsystem
npm install
cd client && npm install# Terminal 1: Backend + Frontend
npm run dev
# Terminal 2: Desktop Agent
cd device-agents/desktop
pip install -r requirements.txt
python device_agent.py- Dashboard: http://localhost:3000
- Backend API: http://localhost:5001
- Database Setup - Create free MongoDB Atlas cluster
- Backend Deploy - Deploy to Railway.app
- Frontend Deploy - Deploy to Vercel.com
- Configure Agents - Update device agent URLs
Detailed Instructions: See DEPLOYMENT_INSTRUCTIONS.md
- Frontend:
https://your-project.vercel.app - Backend:
https://your-project.railway.app - API Health:
https://your-project.railway.app/api/health
- Windows - Python agent with system integration
- macOS - Native notifications and screen lock
- Linux - Full admin command support
- iOS - React Native app with location services
- Android - Background tracking and notifications
- Vehicle Trackers - SIM800L/SIM7600 modules
- Asset Trackers - Arduino + GPS + GSM
- Custom IoT - Raspberry Pi based solutions
Backend (.env.production):
NODE_ENV=production
PORT=5000
MONGODB_URI=mongodb+srv://...
JWT_SECRET=your-secret-key
CORS_ORIGIN=https://your-frontend.vercel.appFrontend (Vercel environment):
REACT_APP_API_URL=https://your-backend.railway.app{
"server_url": "https://your-backend.railway.app",
"device_id": "unique-device-id",
"device_name": "Device Display Name",
"device_type": "desktop|mobile|gps_tracker",
"update_interval": 30
}- β JWT Authentication
- β HTTPS Encryption
- β CORS Protection
- β Rate Limiting
- β Input Validation
- β Secure Device Authentication
| Service | Development | Production |
|---|---|---|
| MongoDB Atlas | Free (512MB) | Free (512MB) |
| Railway Backend | Free ($5 credit) | ~$5/month |
| Vercel Frontend | Free | Free |
| Total | $0/month | ~$5/month |
GET /api/device-monitor/devices- List all devicesPOST /api/device-monitor/devices/register- Register devicePOST /api/device-monitor/location- Update location
POST /api/device-monitor/devices/:id/message- Send messagePOST /api/device-monitor/devices/:id/lock- Lock screenPOST /api/device-monitor/devices/:id/command- Execute command
GET /api/health- Health checkGET /api/status- System status
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: DEPLOYMENT_INSTRUCTIONS.md
- Device Setup: DEVICE_SETUP_GUIDE.md
- Issues: Create GitHub issue
- Discussions: GitHub Discussions tab
- Real-time WebSocket notifications
- Mobile push notifications
- Geofencing alerts
- Historical location analytics
- Multi-tenant support
- Advanced reporting dashboard
Built with β€οΈ for device monitoring and tracking
Built with Node.js, React, Arduino, and real-time communication.
- Real-time GPS tracking with GSM/GPRS connectivity
- Offline data storage on SD card when no network available
- Automatic data synchronization when connection is restored
- Battery monitoring with low battery alerts
- Signal strength monitoring
- Configurable reporting intervals
- Real-time location updates via WebSockets
- Interactive maps with device positioning
- Location history and route visualization
- Geofencing with entry/exit alerts
- Device management and configuration
- Battery and signal monitoring
- Emergency alerts and notifications
- Cross-platform React Native application
- Push notifications for alerts
- Offline map caching
- Device control and monitoring
- RESTful API for all operations
- WebSocket support for real-time updates
- MQTT integration for IoT communication
- MongoDB for data storage
- JWT authentication
- Rate limiting and security
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β GPS Device ββββββ GSM Network ββββββ Backend API β
β (Arduino) β β β β (Node.js) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βββββββββββ΄ββββββββββ
β β
βββββββββββββββββββ βββββββββββββββββββ
β Web Dashboard β β Mobile App β
β (React) β β (React Native) β
βββββββββββββββββββ βββββββββββββββββββ
- GPS Device β Collects location data
- GSM Module β Transmits data via cellular network
- Backend API β Processes and stores data
- WebSocket β Real-time updates to clients
- Web/Mobile β Display tracking information
| Component | Model | Purpose |
|---|---|---|
| Microcontroller | Arduino Uno/Nano or ESP32 | Main processing unit |
| GPS Module | NEO-6M or NEO-8M | Location tracking |
| GSM Module | SIM800L or SIM7600 | Cellular connectivity |
| SD Card Module | Standard SD reader | Offline data storage |
| Battery | 18650 Li-ion + charging circuit | Power supply |
| Enclosure | Waterproof case | Protection |
GPS Module (NEO-6M):
VCC β 3.3V
GND β GND
TX β Pin 4 (Arduino RX)
RX β Pin 3 (Arduino TX)
GSM Module (SIM800L):
VCC β 5V (or 3.7V for SIM800L)
GND β GND
TX β Pin 7 (Arduino RX)
RX β Pin 8 (Arduino TX)
SD Card Module:
VCC β 5V
GND β GND
MISO β Pin 12
MOSI β Pin 11
SCK β Pin 13
CS β Pin 10
- Node.js 16+ and npm
- MongoDB 4.4+
- Arduino IDE (for device firmware)
- Git
# Clone the repository
git clone <repository-url>
cd gps-tracking-system
# Install backend dependencies
npm install
# Create environment file
cp .env.example .env
# Edit .env with your configuration
# Start MongoDB (if running locally)
mongod
# Start the backend server
npm run server:dev# Server Configuration
PORT=5000
NODE_ENV=development
# Database
MONGODB_URI=mongodb://localhost:27017/gps-tracking
# JWT Authentication
JWT_SECRET=your-super-secure-jwt-secret
JWT_EXPIRE=7d
# Client URLs
CLIENT_URL=http://localhost:3000
MOBILE_URL=http://localhost:19006
# MQTT (Optional)
MQTT_ENABLED=false
MQTT_BROKER_URL=mqtt://localhost:1883
MQTT_USERNAME=
MQTT_PASSWORD=
# GSM Configuration (for reference)
APN=internet
SERVER_URL=your-server.com# Navigate to client directory
cd client
# Install dependencies
npm install
# Start development server
npm start# Install React Native CLI
npm install -g @react-native-community/cli
# Navigate to mobile directory
cd mobile
# Install dependencies
npm install
# For iOS
cd ios && pod install && cd ..
npx react-native run-ios
# For Android
npx react-native run-android- Open
arduino/gps_tracker.inoin Arduino IDE - Install required libraries:
- SoftwareSerial (built-in)
- ArduinoJson
- SD (built-in)
- Configure device settings in the code:
#define DEVICE_ID "GPS_001" // Unique device identifier #define APN "internet" // Your carrier's APN #define SERVER_URL "your-server.com"
- Upload to Arduino
# Build the project
npm run build
# Install PM2 globally
npm install -g pm2
# Start with PM2
pm2 start dist/server/index.js --name "gps-tracker-api"
# Setup auto-restart on reboot
pm2 startup
pm2 save# Build and run with Docker Compose
docker-compose up -dThe system can be deployed on:
- AWS: EC2 + RDS + S3
- Google Cloud: Compute Engine + Cloud SQL
- Azure: App Service + CosmosDB
- DigitalOcean: Droplets + Managed Database
POST /api/auth/login
POST /api/auth/register
POST /api/auth/refreshGET /api/devices // List all devices
POST /api/devices // Add new device
GET /api/devices/:id // Get device details
PUT /api/devices/:id // Update device
DELETE /api/devices/:id // Remove deviceGET /api/locations/:deviceId // Get location history
GET /api/locations/:deviceId/current // Get current location
GET /api/locations/:deviceId/route // Get route for date range
POST /api/device-data // Device data endpoint (for GPS devices)// Client to Server
authenticate
subscribe_device
unsubscribe_device
request_current_location
// Server to Client
location_update
device_status
battery_alert
geofence_alert
emergency_alert- Reporting Interval: 30-3600 seconds
- Battery Threshold: 5-50%
- Geofencing: Enable/disable
- Offline Storage: Enable/disable
- Data Retention: Default 30 days
- Rate Limiting: 100 requests/minute
- WebSocket Timeout: 30 seconds
- MQTT Keep-alive: 60 seconds
- JWT Authentication with refresh tokens
- API Rate Limiting to prevent abuse
- Data Encryption in transit (HTTPS/WSS)
- Device Authentication via unique IDs
- Input Validation and sanitization
- CORS Protection for web clients
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test suite
npm test -- --grep "LocationService"cd client
npm test- Device online/offline status
- Battery levels and trends
- Signal strength monitoring
- Location accuracy statistics
- Data transmission success rates
- System performance metrics
- Structured logging with timestamps
- Error tracking and alerting
- Performance monitoring
- Device communication logs
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
GPS not getting fix:
- Ensure GPS antenna has clear sky view
- Check GPS module connections
- Verify GPS module power supply (3.3V)
GSM connection failed:
- Verify SIM card is activated and has data plan
- Check APN settings for your carrier
- Ensure good cellular signal strength
Device not reporting:
- Check power supply and battery level
- Verify server URL and endpoint
- Check device logs via serial monitor
WebSocket connection issues:
- Verify CORS settings
- Check firewall and port configuration
- Ensure proper authentication
- Multi-tenant support
- Advanced geofencing shapes
- Machine learning for route optimization
- Integration with fleet management systems
- Advanced analytics dashboard
- Voice alerts and commands
- Integration with emergency services
- Weather data integration
- Predictive maintenance alerts
- Advanced reporting and exports
Made with β€οΈ for the IoT and tracking community