104 lines
2.1 KiB
TypeScript
104 lines
2.1 KiB
TypeScript
/**
|
||
* Configuration for bus tracking
|
||
* Add or modify stops and routes to track different buses
|
||
*/
|
||
|
||
export interface StopConfig {
|
||
stopId: string;
|
||
stopCode?: string;
|
||
name?: string;
|
||
lat: number;
|
||
lon: number;
|
||
}
|
||
|
||
export interface RouteConfig {
|
||
routeId: string;
|
||
shortName?: string;
|
||
name?: string;
|
||
}
|
||
|
||
export interface AppConfig {
|
||
baseUrl: string;
|
||
apiEndpoints: {
|
||
gtfsRtTripUpdates: string;
|
||
vehiclesJson: string;
|
||
nearbyTimes: string;
|
||
};
|
||
defaultStop: StopConfig;
|
||
defaultRoute: RouteConfig;
|
||
server: {
|
||
port: number;
|
||
};
|
||
tracking: {
|
||
refreshInterval: {
|
||
web: number; // milliseconds
|
||
terminal: number; // milliseconds
|
||
};
|
||
minutesAhead: number; // Show buses arriving in next X minutes
|
||
};
|
||
}
|
||
|
||
// Base configuration
|
||
const BASE_URL = 'https://www.modeshift.app/api/v1/9814b106-2afe-47c8-919b-bdec6a5e521e';
|
||
|
||
export const config: AppConfig = {
|
||
baseUrl: BASE_URL,
|
||
|
||
apiEndpoints: {
|
||
gtfsRtTripUpdates: `${BASE_URL}/transport/gtfsrt/tripupdates.pb`,
|
||
vehiclesJson: `${BASE_URL}/transport/public/vehicles`,
|
||
nearbyTimes: `${BASE_URL}/transport/planner/stops/nearbyTimes`,
|
||
},
|
||
|
||
// Default stop: АМЕРИКАН КОЛЕЏ-КОН ЦЕНТАР
|
||
defaultStop: {
|
||
stopId: '1571',
|
||
stopCode: '59',
|
||
name: 'АМЕРИКАН КОЛЕЏ-КОН ЦЕНТАР',
|
||
lat: 41.98057556152344,
|
||
lon: 21.457794189453125,
|
||
},
|
||
|
||
// Default route: Line 7
|
||
defaultRoute: {
|
||
routeId: '125',
|
||
shortName: '7',
|
||
name: 'ЛИНИЈА 7',
|
||
},
|
||
|
||
server: {
|
||
port: 3000,
|
||
},
|
||
|
||
tracking: {
|
||
refreshInterval: {
|
||
web: 5000, // 5 seconds
|
||
terminal: 10000, // 10 seconds
|
||
},
|
||
minutesAhead: 90,
|
||
},
|
||
};
|
||
|
||
/**
|
||
* Example: Adding more stops to track
|
||
* Uncomment and modify as needed
|
||
*/
|
||
|
||
// export const additionalStops: StopConfig[] = [
|
||
// {
|
||
// stopId: 'YOUR_STOP_ID',
|
||
// stopCode: 'STOP_CODE',
|
||
// name: 'Stop Name',
|
||
// lat: 42.0,
|
||
// lon: 21.5,
|
||
// },
|
||
// ];
|
||
|
||
// export const additionalRoutes: RouteConfig[] = [
|
||
// {
|
||
// routeId: 'YOUR_ROUTE_ID',
|
||
// shortName: '10',
|
||
// name: 'ЛИНИЈА 10',
|
||
// },
|
||
// ];
|