npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ubkerp.transport.module

v0.1.1

Published

UBK ERP reusable Transport Module for React Native apps

Downloads

32

Readme

ubkerp.transport.module

Reusable React Native Transport Module for UBKERP (UBK INFOTECH PVT LTD). This package keeps authentication external and makes API + UI reusable.

Setup (library)

cd transport-module
npm i
npm run build

Install (consumer app)

npm i ubkerp.transport.module

Usage

A) Direct token

<TransportProvider apiBaseUrl="https://domain.com/api" authToken={token}>
  <StudentRouteDetailsScreen />
</TransportProvider>

B) Async token callback (recommended)

<TransportProvider
  apiBaseUrl="https://domain.com/api"
  getAuthToken={async () => {
    return await AsyncStorage.getItem('token');
  }}>
  <StudentRouteDetailsScreen />
</TransportProvider>

C) Custom headers (optional)

<TransportProvider
  apiBaseUrl="https://domain.com/api"
  headers={{
    Authorization: token,
  }}>
  <StudentRouteDetailsScreen />
</TransportProvider>

API Configuration

TransportProvider configures a dedicated Axios instance:

  • Dynamic apiBaseUrl
  • Dynamic headers (static headers + token injection)
  • Axios interceptors
  • Token refresh support (optional refreshAuthToken)
  • Retry mechanism (configurable via retry)
  • Global API error handling (optional onApiError)

Exports

export {
  TransportProvider,
  useTransport,
  TransportDashboard,
  StudentRouteDetailsScreen,
} from '@ubkerp/transport-module';

Example

Use the screen exports in your consumer app navigation.

Migration Strategy (incremental)

This library is designed to migrate your existing Transport module without rewriting the business logic.

Current Source Files (in ERP app)

  • src/screens/TransportRoute/TransportRoute.jsx → dashboard/hub UI
  • src/screens/TransportRoute/RouteTransport.jsx → student route details UI + API call
  • src/screens/TransportRoute/TransportFee.jsx → transport fee UI + receipts (large; migrate after RouteDetails)
  • src/api/fee_show_data.jsfee_show_data2() transport fee API
  • src/api/apiService.js → generic GET/POST wrappers
  • src/styles/TransportRoute/TransportRoute.styles.jsx → styles
  • src/routes/StackNavigator.js → navigation registration (must stay in consumer app)

Move Order (recommended)

  1. Services first (no UI)
  • Move API calls into transport-module/src/services/**
  • Keep endpoints unchanged; only remove hardcoded API_BASE_URL usage
  1. Types
  • Introduce strong TypeScript models in transport-module/src/types/**
  1. Provider
  • Add TransportProvider to replace internal AuthContext dependency
  1. Screens
  • Move screens into transport-module/src/screens/**
  • Remove useNavigation() from screens; expose callbacks/props instead
  1. Shared UI components
  • Extract cards, loading/empty/error states into src/components/**

Refactoring Needed (safe + minimal)

  • Replace API_BASE_URL imports with TransportProvider (apiBaseUrl)
  • Replace AuthContext with external token injection (authToken / getAuthToken / headers)
  • Keep request paths identical (example: /student/studentAPP/TransportDetails/studentRoutedetails)

Dependency Mapping (Transport module)

  • Must be provided by consumer (peer deps): react, react-native
  • Included by library: axios
  • Optional consumer-level dependencies depending on migrated screens:
    • If you keep native-base, react-native-fast-image, @fortawesome/*, they should be added as peerDependencies later when those screens are migrated

Breaking Changes Prevention

  • Preserve endpoint paths and payload shapes
  • Avoid changing response parsing; wrap only for reusability
  • Keep UI props backward compatible by adding optional props instead of changing required ones

Next Modules (planned)

  • Transport Fee (fee_show_data2 + TransportFee screen)
  • Vehicle / Driver / Route management (if present in ERP app)
  • Pickup point + allocation screens
  • GPS tracking + bus attendance + reports