Partially working api and web

This commit is contained in:
2026-02-07 11:19:36 +01:00
parent a52482256a
commit 699c826bf0
21 changed files with 124861 additions and 0 deletions

103
config.ts Normal file
View File

@@ -0,0 +1,103 @@
/**
* 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',
// },
// ];