A decentralized national registry for verifiable device ownership, stolen phone tracking, and IMEI-bound digital certificates of ownership.
🔗 Live Demo • Built by Usama Ado Shehu — Vexel Innovations
- Overview
- Architecture
- User Roles
- Database Schema
- Key Workflows
- Getting Started
- Environment Variables
- API Reference
- Security
- Roadmap
- Contributing
- License
PTS gives every mobile device a verifiable digital identity. Vendors register devices at point of sale, ownership transfers are logged on an immutable chain of custody, and anyone — a buyer, a pawn shop, a police officer — can verify an IMEI in seconds to see if it's clean or stolen.
| Layer | Technology |
|---|---|
| Backend API | Node.js + Express |
| Database | PostgreSQL + Prisma ORM (Neon serverless) |
| Mobile Agent | React + TypeScript + Capacitor (Android/iOS) |
| Auth | JWT + bcrypt + OTP email verification |
| Storage | Cloudinary (images/documents) |
| AI | Groq SDK (AI command center) |
pts-project/
├── backend/ # Express API server
│ ├── api/index.js # Entry point & route loader
│ ├── src_backend/
│ │ ├── controllers/ # Business logic
│ │ ├── middleware/ # Auth, error handling
│ │ ├── routes/ # API route definitions
│ │ ├── services/ # Reusable service layer
│ │ └── utils/ # Logger, response helpers
│ └── prisma/
│ └── schema.prisma # Database models
└── pts-sentinel-app/ # Mobile tracking agent
└── src/
├── screens/ # Setup & Dashboard UI
├── components/ # Radar, BeaconFeed
└── services/ # beaconService, notificationInterceptService
| Role | Capabilities |
|---|---|
| CONSUMER | View certificates for owned devices, flag device as stolen |
| VENDOR | Register devices at point of sale, issue certificates, initiate transfers |
| POLICE | Investigate flagged devices, review transaction histories, manage incident reports |
| ADMIN | Full system access, user management, analytics |
| TELECOM | Sync blacklisted IMEIs with network-level blocking |
| INSURANCE | Access risk scores and incident reports for insured devices |
| Model | Purpose |
|---|---|
| User | All operators — email, role, vendorTier, facial/business verification data |
| Device | Core tracked asset — imei (unique 15-digit), status (CLEAN/STOLEN/LOST/INVESTIGATING), riskScore |
| Certificate | Proof of ownership — qrHash (unique, for physical scanning), isActive |
| OwnershipTransfer | Chain of custody — sellerId, buyerId, escrowStatus |
| IncidentReport | Theft/loss reports — type (LOST/STOLEN/SNATCHED/FRAUD), policeReportNo, status |
| TransactionHistory | Immutable audit log — SHA-256 sealed entries for every action |
| DeveloperApiKey | Third-party API access with quota and billing tracking |
| ObservationReport | Guardian Mesh sightings via BT/WiFi from sentinel agents |
Anyone can look up a 15-digit IMEI. The system returns a Public Trust Index score. Devices marked STOLEN display a clear warning.
- A Vendor registers a new device (IMEI + photos + receipt).
- Vendor initiates an ownership transfer to the buyer's email.
- PTS issues a
Certificatebinding that buyer to the device IMEI. - Transfer is permanently logged in
TransactionHistorywith a SHA-256 seal.
- Owner flags device via dashboard or USSD (
*123#). IncidentReportcreated; device status set toSTOLEN.- Law enforcement notified; device added to telecom blacklist feed.
- PTS Sentinel mobile agent continuously broadcasts GPS location to registry.
- Node.js ≥ 18
- PostgreSQL database (or a Neon serverless instance)
cd backend
npm install
cp .env.example .env # Fill in your secrets
npx prisma generate
npx prisma migrate dev
npm run dev # Starts on port 5000cd pts-sentinel-app
npm install
cp .env.example .env # Set VITE_PTS_API_URL
npm run dev # Web preview
# For Android:
npm run build
npx cap sync android
npx cap open androidThe API will be available at http://localhost:5000.
Copy backend/.env.example to backend/.env and fill in all values.
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
Neon/PostgreSQL connection string | ✅ |
DIRECT_URL |
Direct DB URL (for Prisma migrations) | ✅ |
JWT_SECRET |
Long random string for signing tokens | ✅ |
EMAIL_USER |
SMTP email for OTP delivery | ✅ |
EMAIL_PASS |
SMTP app password | ✅ |
CLOUDINARY_* |
Cloud storage for images/documents | Recommended |
GROQ_API_KEY |
AI Command Center features | Optional |
PAYSTACK_SECRET_KEY |
NGN payment processing | Optional |
TELEGRAM_BOT_TOKEN |
Telegram alert bot | Optional |
WHATSAPP_* |
WhatsApp Business API alerts | Optional |
For the mobile app, create pts-sentinel-app/.env:
VITE_PTS_API_URL=https://your-backend-url.com/api/v1
Base URL: /api/v1
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register/start |
Start registration, sends OTP |
| POST | /auth/register/verify |
Verify OTP, create account |
| POST | /auth/login |
Login, returns JWT |
| POST | /auth/reset-password |
Request password reset OTP |
| POST | /auth/verify-reset-otp |
Confirm OTP, apply new password |
| Method | Endpoint | Description |
|---|---|---|
| POST | /devices |
Register a new device (Vendor) |
| GET | /devices/:imei |
Get device details |
| PATCH | /devices/:imei/status |
Update device status |
| Method | Endpoint | Description |
|---|---|---|
| GET | /public/verify/:imei |
Public IMEI trust check |
| Method | Endpoint | Description |
|---|---|---|
| POST | /guardian/beacon |
Submit GPS location beacon |
Full API documentation available via /health endpoint which lists all loaded routes.
- Passwords hashed with bcrypt (10 rounds).
- All protected routes require a valid JWT (
Authorization: Bearer <token>). - Role-based access control via the
authorize(...roles)middleware. - OTP-verified registration and password reset flow.
- Devices cannot be deleted — all changes flow through auditable Transfer or Reporting workflows.
TransactionHistoryentries are SHA-256 sealed after creation (isSealed: true).- Rate limiting recommended for production (add
express-rate-limitto auth routes).
⚠️ Before deploying to production, see the Security Hardening section below.
- Set a strong, unique
JWT_SECRET(min 32 chars, generated randomly) - Remove the admin credential auto-creation from the
/healthendpoint - Add
helmetmiddleware:npm install helmet→app.use(helmet()) - Add rate limiting to
/api/v1/auth/*routes - Restrict CORS to your actual frontend origin(s)
- Set
NODE_ENV=productionin your hosting environment - Enable HTTPS (handled by Vercel/Render/Railway automatically)
- Run
npm auditand resolve any high/critical findings
See ROADMAP.md for the full plan, including:
- Device DNA Registry — hardware serial binding for forensic identity
- Guardian Mesh Network — crowd-sourced BT/WiFi sighting reports
- Anti-Theft Kill-Switch API — remote brick/recovery via telecom integration
- Blockchain Chain of Custody — immutable on-chain ownership proofs
- Escrow Payments — Paystack-backed escrow for second-hand device purchases
Contributions are welcome! Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md before opening a PR.
Found a vulnerability? See SECURITY.md for responsible disclosure steps.
MIT License — © Usama Ado Shehu / Vexel Innovations
Made with ❤️ in Nigeria by Usama Ado Shehu — Vexel Innovations