๐จ Contributors: All PRs must target the
devbranch, notmain.
See CONTRIBUTING.md for details.
Navin is a blockchain-powered logistics platform that improves supply chain visibility for enterprises through tokenized shipments, immutable milestone tracking, and automated settlements. By creating a zero-trust interface between logistics providers and their clients, Navin ensures both parties access identical real-time data โ removing information asymmetry and enabling seamless, dispute-free operations.
This repository is the React frontend of the Navin platform โ built with TypeScript and Vite โ giving logistics companies and their customers a single, real-time interface to track shipments, verify on-chain milestones, and monitor automated payment settlements powered by Stellar Soroban.
โญ If this project interests you, please star the repository! It helps the project grow, attracts contributors, and supports open-source development. Star Navin Frontend โญ
The Vercel deployment (frontend/vercel.json) sets security headers on every response. Because the app keeps the auth token in localStorage and signs Stellar transactions, these headers are a defense-in-depth layer against XSS and clickjacking.
| Header | Value | Purpose |
|---|---|---|
Content-Security-Policy |
see below | Restricts which origins can load scripts, styles, fonts, images, and connections |
X-Frame-Options |
DENY |
Prevents clickjacking of wallet-signing flows (legacy fallback for frame-ancestors) |
Referrer-Policy |
strict-origin-when-cross-origin |
Keeps password-reset tokens (in query strings) out of cross-origin Referer headers |
X-Content-Type-Options |
nosniff |
Blocks MIME-type sniffing |
Permissions-Policy |
camera=(), microphone=(), geolocation=() |
Disables browser features the app does not use |
The policy allows only the origins the app actually talks to:
'self'โ the app bundle and its own assets- API origin โ the Navin backend (
VITE_API_URL) - Soroban RPC โ Stellar RPC endpoint used for contract calls
- Sentry ingest โ
https://*.ingest.sentry.iofor error reporting - Google Fonts โ
https://fonts.googleapis.com(styles) andhttps://fonts.gstatic.com(font files) - OpenStreetMap tiles โ
https://*.tile.openstreetmap.orgfor Leaflet maps
default-src 'self';
base-uri 'self';
object-src 'none';
frame-ancestors 'none';
form-action 'self';
script-src 'self';
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com data:;
img-src 'self' data: blob: https://*.tile.openstreetmap.org;
connect-src 'self' https://*.ingest.sentry.io;
Note: The API and Soroban RPC origins are environment-specific. Add them to
connect-srcinfrontend/vercel.jsonfor each deployment (e.g.https://api.navin.example https://soroban-testnet.stellar.org). If you need to roll out a change safely, switch the header name toContent-Security-Policy-Report-Onlyfirst, confirm there are no violations in the browser console, then rename it back toContent-Security-Policy.
| Layer | Technology | Why |
|---|---|---|
| UI Framework | React 19 | Component-based UI โ the industry standard |
| Language | TypeScript | Type safety for complex Soroban SDK interactions and multi-dashboard data flows |
| Styling | Tailwind CSS | Utility-first CSS for consistent, maintainable styling with design tokens |
| Build Tool | Vite | Lightning-fast dev server and production bundler |
| Package Manager | pnpm | Fast, disk-efficient package manager with strict dependency management |
| Testing | Vitest + Testing Library | Fast unit and component testing |
| Routing | React Router v7 | Client-side navigation |
| HTTP Client | Axios | API communication with the Navin backend |
| Blockchain | Stellar Soroban | Smart contract interaction for payments and milestones |
Tech Stack Rationale: See Technology Choices for detailed explanation of TypeScript, Tailwind CSS, and pnpm.
| Feature | Description |
|---|---|
| Real-time Shipment Dashboards | Companies and customers see live shipment status โ no information gap between both parties |
| On-chain Milestone Visualization | Immutable milestone records (picked up, in transit, delivered) surfaced clearly in the UI |
| Automated Settlement Tracking | Payment status updated automatically when verified delivery events occur on-chain |
| Company Dashboard | Logistics companies manage shipments, users, and track performance analytics |
| Customer Dashboard | Customers track their active shipments and delivery history in one place |
| Shipment Detail View | Full breakdown of a single shipment โ milestones, IoT sensor data, payment status, and delivery proof |
| Notification System | Real-time alerts for shipment updates, delays, and payment events |
| Responsive Interface | Works across desktop, tablet, and mobile |
For deployment and configuration guidance:
- Environment Setup Guide - Configure environment variables for all deployment platforms
- Legacy CSS Migration Guide - Migrate components from CSS to Tailwind
- Technology Choices - Why TypeScript, Tailwind CSS, and pnpm
frontend/
โโโ src/
โ โโโ components/ # Reusable UI components (Navbar, Modal, StatusBadge, etc.)
โ โโโ pages/ # Page-level components (LandingPage, Dashboard, ShipmentDetail, etc.)
โ โโโ services/ # Axios API service layer (shipmentService.ts, authService.ts, etc.)
โ โโโ context/ # React context providers (ToastContext, AuthContext)
โ โโโ hooks/ # Custom React hooks
โ โโโ types/ # Shared TypeScript interfaces and types
โ โโโ utils/ # Utility/helper functions
โ โโโ test/ # Test setup and smoke tests
โโโ public/
โ โโโ images/ # Static assets (logos, icons, illustrations)
โโโ tsconfig.json # TypeScript config
โโโ vite.config.ts # Vite + Vitest config
โโโ package.json
# Fork the repository and clone your fork
git clone https://github.com/yourusername/navin-frontend.git
cd navin-frontend/frontend
# Set up your environment variables
cp .env.example .env
# Install dependencies with pnpm
pnpm install
# Start the development server
pnpm run devYour app runs at http://localhost:5173.
pnpm run dev # Start local dev server (hot reload)
pnpm run build # Type-check + production build
pnpm run lint # Run ESLint
pnpm run test # Run all tests (Vitest)
pnpm run test:watch # Run tests in watch mode
โ ๏ธ Important: Always usepnpm(notnpmoryarn) to maintain consistency. Using different package managers creates lock file conflicts and dependency mismatches.
๐ฟ Git Flow Workflow
We use adevโmainworkflow:
dev= Active development (all PRs go here)main= Production-ready code (Vercel deploys from here)Never submit PRs to
maindirectly. All feature work goes todevfirst.
We welcome contributors of all experience levels โ whether you're building your first open-source component or you're a seasoned TypeScript developer.
Read our CONTRIBUTING.md for the full guide on branching, commits, PRs, and our review process.
Quick overview:
- Browse open issues on the Issues page
- Comment on an issue and wait to be assigned before starting
- Create your branch from
dev(notmain) - Implement the feature and ensure your PR targets
dev - All frontend PRs must include a screenshot of the UI change
- Use pnpm for all package management commands (not npm or yarn)
- Use Tailwind CSS utility classes for styling (no vanilla CSS files for new components)
๐ก All components should be written in TypeScript (
.tsx). Follow the file structure in each issue โ it tells you exactly where to create your files. See TAILWIND_MIGRATION.md for styling guidelines (available after Issue #92 is merged).
| Guide | Description |
|---|---|
| Frontend Component & Styling Conventions | Folder structure, naming rules, Tailwind-first styling, path aliases, and legacy CSS migration policy โ start here |
| Component Conventions | TypeScript, exports, props interfaces, and dead code rules |
| Tailwind Migration Guide | Step-by-step CSS โ Tailwind conversion reference |
| Tailwind Before/After Examples | Side-by-side migration examples |
| Tailwind PR Checklist | Checklist for Tailwind migration PRs |
Have questions or want to discuss ideas?
- Smart Contracts: navin-contracts
- Backend API: navin-backend
If you find Navin useful,
This project is licensed under the MIT License.
This project is licensed under the MIT License.
- #907: [Refactor] Remove the
Promise.resolve().then(() => setState(...))workaround used in effects
- #903: [Theme] NotificationsPage and UserManagement use hardcoded dark colours and look broken in light theme /* โฆ truncated 333 chars โ edit only what you need near the top โฆ */