A blazing-fast, full-stack India Post tracking portal & zero-config NPM CLI built with React + Vite + Express + Node.js.
Live REST API ยท AES-256 Encrypted Payloads ยท Admin-Authenticated Portal ยท Rate-Limited Search
Made with โค๏ธ by Sarang
๐ Portfolio / GitHub ยท ๐ธ Instagram @5araang ยท ๐ฆ NPM Package
This project consists of two core open-source components:
track-postNPM Package & CLI: A zero-config CLI tool and Node.js library (npx track-post <id>). Zero API keys required. Auto-token generation & 6-day TTL caching.- Web Portal SPA: A production-grade India Post tracking web application with live REST API, event timelines, and admin portal.
- ๐ Admin authentication via environment credentials (no database required)
- ๐ Developer API key system with AES-256 encrypted or plain JSON response modes
- ๐ฆ Live tracking of any 13-character India Post consignment ID (Speed Post, Parcel, etc.)
- ๐ Visual event timeline showing every checkpoint in a parcel's journey
- ๐ Raw JSON inspector for developers integrating the API
- ๐ Persistent search history stored locally in the browser
- ๐ฆ Rate limiting โ configurable, defaults to 5 requests/minute
You can run tracking directly from your terminal or install it as a library in any Node.js / TypeScript project:
# Live tracking npx track-post <tracking-id> # Demo mode (sample parcel data) npx track-post EH123456789IN --demo
npm install track-post
const { track, init } = require('track-post'); /** * Track an India Post consignment ID * @param {string} consignmentId - 13-character ID or raw number */ async function getTrackingDetails(consignmentId) { try { const data = await track(consignmentId); return { success: true, data }; } catch (error) { return { success: false, error: error.message }; } } module.exports = { getTrackingDetails, init };
import { track, init, TrackResult } from 'track-post'; export interface TrackingResponse { success: boolean; data?: TrackResult; error?: string; } export async function getTrackingDetails(consignmentId: string): Promise<TrackingResponse> { try { const data: TrackResult = await track(consignmentId); return { success: true, data }; } catch (error: any) { return { success: false, error: error?.message || 'Tracking failed' }; } }
| Feature | Description |
|---|---|
| ๐ด Flat 3-Color Design | Minimalist Black ยท White ยท Red (#dc2626) theme |
| ๐ Env-Based Auth | Admin portal login via .env email/password โ no DB needed |
| ๐ API Key Management | AES-256 encrypted payload support or plain JSON mode |
| ๐ก REST API Endpoint | GET /v1/api/track/:code โ publicly accessible tracking endpoint |
| ๐ Event Timeline | Visual checkpoint timeline with timestamps and locations |
| ๐พ Search History | Browser-local history with quick re-track support |
| ๐ฆ Rate Limiter | 5 req/min limit with live badge indicator in the navbar |
| ๐ API Docs Page | Built-in developer API documentation page at /docs |
| ๐๏ธ Sidebar Drawer | Slide-out control panel for session info, API keys, and history |
| โก Vite + React 18 | Ultra-fast HMR dev server with an optimized production build |
User enters 13-character Consignment ID
โ
โผ
React Frontend (Vite + TypeScript)
โ
โผ
Express API Server (api/ folder)
โ
โโโ 1. Fetches action token from India Post Next.js Server Action
โ
โโโ 2. Calls the India Post tracking endpoint with token + consignment ID
โ
โโโ 3. Parses and normalizes event data into a clean structure
โ
โโโ 4. Returns JSON response (plain or AES-256 encrypted)
โ
โผ
Frontend renders results:
โโโ Summary Cards (status, weight, origin, destination)
โโโ Visual Activity Timeline (checkpoint-by-checkpoint)
โโโ Raw JSON Inspector (for developers)
Browser visits any protected route
โ
โผ Not authenticated?
โโโโบ Redirect to /login
โ
โผ Enter email + password (from .env)
AuthService.login()
โ
โผ Session saved in localStorage
Routes unlocked:
โโโ / โ Consignment Tracker
โโโ /docs โ API Documentation
Developer API keys are generated client-side using crypto-js.
| Request Header | Response Format |
|---|---|
| No API key | AES-256 encrypted ciphertext payload |
Valid X-API-Key header |
Structured plain JSON response |
indiapost-tracker-master/
โโโ npm/ # Standalone track-post NPM Package & CLI
โ โโโ bin/
โ โ โโโ cli.js # npx track-post CLI binary
โ โโโ src/
โ โ โโโ index.js # Public track() & init() exports
โ โ โโโ extractor.js # Auto Next.js action hash scraper
โ โ โโโ config.js # ~/.track-post/config.json 6-day TTL cache
โ โ โโโ tracker.js # Core RSC requester & normalizer
โ โโโ types/
โ โ โโโ index.d.ts # TypeScript definitions
โ โโโ package.json # "name": "track-post"
โ โโโ README.md
โโโ indiapost-vite/ # Full-stack React + Vite Web Portal
โ โโโ api/ # Express API server handlers
โ โโโ src/
โ โ โโโ components/ # React UI components
โ โ โโโ services/ # API & Auth services
โ โ โโโ types/ # TypeScript types
โ โโโ .env.example # Environment template
โ โโโ vercel.json # Vercel deployment routes
โ โโโ extract-hashes.js # Next.js hash extractor
โโโ README.md # Master GitHub documentation
โโโ package.json # Root workspace manifest
git clone https://github.com/5araang/indian-post-track-order-.git
cd indian-post-track-order-/indiapost-vitenpm install
Copy the example file:
cp .env.example .env
Then open .env and fill in your values:
# โโ India Post Developer API Credentials โโโโโโโโโโโโโโโโโโโโโโโโโโ VITE_INDIAPOST_API_KEY=your_api_key_here VITE_INDIAPOST_API_SECRET=your_api_secret_here # โโ Next.js Server Action Hashes (auto-extracted โ see Step 4) โโโโ VITE_NEXTJS_TOKEN_ACTION= VITE_NEXTJS_TRACK_ACTION= # โโ Rate Limiting (default: 5 searches per 60 seconds) โโโโโโโโโโโโ VITE_RATE_LIMIT_MAX_SEARCHES=5 VITE_RATE_LIMIT_WINDOW_MS=60000 # โโ Admin Portal Login Credentials โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ VITE_ADMIN_EMAIL=[email protected] VITE_ADMIN_PASSWORD=your_secure_password
โ ๏ธ Required! This populatesVITE_NEXTJS_TOKEN_ACTIONandVITE_NEXTJS_TRACK_ACTIONautomatically.
npm run extract-hashes
npm run dev
Open http://localhost:5173 in your browser and log in with your .env admin credentials.
This project is pre-configured for zero-config Vercel deployment.
- Push the repo to GitHub under your account
- Go to vercel.com โ New Project โ Import your GitHub repo
- Add all
.envvariables in Vercel Dashboard โ Settings โ Environment Variables - Click Deploy โ
The vercel.json handles all API routing automatically:
GET /v1/api/track/:code โ /api/track?code=:code
GET /api/v1/track/:code โ /api/track?code=:code
GET /track/:code โ /api/track?code=:code
GET /v1/api/track/:code
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
string |
โ | 13-character India Post consignment ID (e.g. <tracking-id>) |
curl https://your-deployment.vercel.app/v1/api/track/<tracking-id>
{
"id": "YourTrackId",
"status": "status",
"origin": "mumbai",
"destination": "new-delhi",
"weight": "458 g",
"tariff": "42",
"delivered": true,
"events": [
{
"date": "2024-01-01T12:30:45Z",
"office": "mumbai",
"description": "descriptionofscan",
"status": "DELIVERED"
}
]
}| Feature | Implementation |
|---|---|
| Authentication | Session-based via .env credentials. No external auth service. |
| API Keys | Generated with crypto-js, stored only in localStorage |
| Encryption | AES-256 encrypted response mode for API consumers |
| Rate Limiting | Configurable per-window request cap to prevent abuse |
| No Database | All state is .env or localStorage driven โ zero DB attack surface |
| Layer | Technology |
|---|---|
| Frontend Framework | React 18 + TypeScript |
| Build Tool | Vite 5 |
| Styling | Tailwind CSS |
| Icons | Lucide React |
| API Server | Express.js |
| Encryption | CryptoJS (AES-256) |
| CLI & NPM Package | Node.js Native HTTPS / FS (Zero Third-Party Deps) |
| Deployment | Vercel (Serverless Functions) |
This project is open source under the MIT License.
Fork it, modify it, deploy it. Attribution is appreciated but not required. ๐
Full-Stack Developer ยท Open Source Builder ยท India ๐ฎ๐ณ
I build fast, functional, and beautifully designed web tools.
This tracker was born from a real frustration with India Post's clunky official interface.
| ๐ Portfolio / GitHub | github.com/5araang |
| ๐ธ Instagram | @5araang |
| ๐ป GitHub Profile | @5araang |
| ๐ฆ NPM Package | track-post |
| ๐ This Repository | indian-post-track-order- |
"Ship fast. Break nothing. Track everything."
โ Sarang