Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

refactor: move airports.json out of server/data into server/assets

Maurice68a303690985
diff --git a/.dockerignore b/.dockerignore
index dcd9575be..c0defbdbd 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -3,7 +3,6 @@ client/node_modules
server/node_modules
client/dist
data
-!server/data/airports.json
uploads
.git
.github
diff --git a/.gitignore b/.gitignore
index bfaa629a0..14638f002 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,7 +17,6 @@ client/public/icons/*.png
# User data
server/data/*
-!server/data/airports.json
server/uploads/
# Environment
diff --git a/server/data/airports.json b/server/assets/airports.json
similarity index 100%
rename from server/data/airports.json
rename to server/assets/airports.json
diff --git a/server/scripts/build-airports.mjs b/server/scripts/build-airports.mjs
index d7c004652..153fe88f1 100644
--- a/server/scripts/build-airports.mjs
+++ b/server/scripts/build-airports.mjs
@@ -1,5 +1,5 @@
#!/usr/bin/env node
-// Build server/data/airports.json from OurAirports (davidmegginson.github.io/ourairports-data).
+// Build server/assets/airports.json from OurAirports (davidmegginson.github.io/ourairports-data).
// License: Public Domain. Keeps large/medium airports with an IATA code; timezone derived from coords via tz-lookup.
import fs from 'node:fs'
@@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url'
import tzLookup from 'tz-lookup'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
-const OUT = path.join(__dirname, '..', 'data', 'airports.json')
+const OUT = path.join(__dirname, '..', 'assets', 'airports.json')
const SRC = 'https://davidmegginson.github.io/ourairports-data/airports.csv'
function fetchText(url) {
diff --git a/server/src/services/airportService.ts b/server/src/services/airportService.ts
index c3250b11f..a5745d31b 100644
--- a/server/src/services/airportService.ts
+++ b/server/src/services/airportService.ts
@@ -18,7 +18,7 @@ let byIata: Map<string, Airport> | null = null;
function load(): Airport[] {
if (cache) return cache;
- const file = path.join(__dirname, '..', '..', 'data', 'airports.json');
+ const file = path.join(__dirname, '..', '..', 'assets', 'airports.json');
if (!fs.existsSync(file)) {
console.warn('[airports] airports.json missing — run `node scripts/build-airports.mjs`');
cache = [];