From 6171bf812a8c74d111dc36565b90e29eb4747cfb Mon Sep 17 00:00:00 2001
From: ajvpot <553597+ajvpot@users.noreply.github.com>
Date: Wed, 10 Sep 2025 03:21:40 +0200
Subject: [PATCH] restructure: use app route group and replace relative imports
with @ imports
---
src/app/{ => (app)}/api-docs/page.tsx | 0
src/app/{ => (app)}/api/chat/route.ts | 0
src/app/{ => (app)}/api/map/route.ts | 0
.../api/meshcore/node/[publicKey]/neighbors/route.ts | 0
.../{ => (app)}/api/meshcore/node/[publicKey]/route.ts | 0
src/app/{ => (app)}/api/meshcore/search/route.ts | 0
src/app/{ => (app)}/api/stats/nodes-over-time/route.ts | 0
.../{ => (app)}/api/stats/popular-channels/route.ts | 0
.../{ => (app)}/api/stats/repeater-prefixes/route.ts | 0
src/app/{ => (app)}/api/stats/total-nodes/route.ts | 0
src/app/{ => (app)}/globals.css | 0
src/app/{ => (app)}/layout.tsx | 6 +++---
src/app/{ => (app)}/meshcore/node/[publicKey]/page.tsx | 0
src/app/{ => (app)}/messages/page.tsx | 0
src/app/{ => (app)}/not-found.tsx | 0
src/app/{ => (app)}/page.tsx | 2 +-
src/app/{ => (app)}/search/page.tsx | 0
src/app/{ => (app)}/stats/page.tsx | 0
src/components/ChatBox.tsx | 10 +++++-----
src/components/ChatMessageItem.tsx | 2 +-
src/components/ConfigContext.tsx | 4 ++--
src/components/Header.tsx | 2 +-
src/components/InfoModal.tsx | 2 +-
src/components/MapIcons.tsx | 6 +++---
src/components/MapView.tsx | 8 ++++----
src/components/PathVisualization.tsx | 4 ++--
src/components/RegionSelector.tsx | 2 +-
src/hooks/useChatMessages.ts | 4 ++--
src/hooks/useMeshcoreSearch.ts | 2 +-
src/hooks/useMessageDecryption.ts | 2 +-
src/hooks/useNeighbors.ts | 2 +-
src/hooks/useNodeData.ts | 2 +-
src/lib/clickhouse/actions.ts | 2 +-
src/lib/regionFilters.ts | 2 +-
34 files changed, 32 insertions(+), 32 deletions(-)
rename src/app/{ => (app)}/api-docs/page.tsx (100%)
rename src/app/{ => (app)}/api/chat/route.ts (100%)
rename src/app/{ => (app)}/api/map/route.ts (100%)
rename src/app/{ => (app)}/api/meshcore/node/[publicKey]/neighbors/route.ts (100%)
rename src/app/{ => (app)}/api/meshcore/node/[publicKey]/route.ts (100%)
rename src/app/{ => (app)}/api/meshcore/search/route.ts (100%)
rename src/app/{ => (app)}/api/stats/nodes-over-time/route.ts (100%)
rename src/app/{ => (app)}/api/stats/popular-channels/route.ts (100%)
rename src/app/{ => (app)}/api/stats/repeater-prefixes/route.ts (100%)
rename src/app/{ => (app)}/api/stats/total-nodes/route.ts (100%)
rename src/app/{ => (app)}/globals.css (100%)
rename src/app/{ => (app)}/layout.tsx (90%)
rename src/app/{ => (app)}/meshcore/node/[publicKey]/page.tsx (100%)
rename src/app/{ => (app)}/messages/page.tsx (100%)
rename src/app/{ => (app)}/not-found.tsx (100%)
rename src/app/{ => (app)}/page.tsx (51%)
rename src/app/{ => (app)}/search/page.tsx (100%)
rename src/app/{ => (app)}/stats/page.tsx (100%)
diff --git a/src/app/api-docs/page.tsx b/src/app/(app)/api-docs/page.tsx
similarity index 100%
rename from src/app/api-docs/page.tsx
rename to src/app/(app)/api-docs/page.tsx
diff --git a/src/app/api/chat/route.ts b/src/app/(app)/api/chat/route.ts
similarity index 100%
rename from src/app/api/chat/route.ts
rename to src/app/(app)/api/chat/route.ts
diff --git a/src/app/api/map/route.ts b/src/app/(app)/api/map/route.ts
similarity index 100%
rename from src/app/api/map/route.ts
rename to src/app/(app)/api/map/route.ts
diff --git a/src/app/api/meshcore/node/[publicKey]/neighbors/route.ts b/src/app/(app)/api/meshcore/node/[publicKey]/neighbors/route.ts
similarity index 100%
rename from src/app/api/meshcore/node/[publicKey]/neighbors/route.ts
rename to src/app/(app)/api/meshcore/node/[publicKey]/neighbors/route.ts
diff --git a/src/app/api/meshcore/node/[publicKey]/route.ts b/src/app/(app)/api/meshcore/node/[publicKey]/route.ts
similarity index 100%
rename from src/app/api/meshcore/node/[publicKey]/route.ts
rename to src/app/(app)/api/meshcore/node/[publicKey]/route.ts
diff --git a/src/app/api/meshcore/search/route.ts b/src/app/(app)/api/meshcore/search/route.ts
similarity index 100%
rename from src/app/api/meshcore/search/route.ts
rename to src/app/(app)/api/meshcore/search/route.ts
diff --git a/src/app/api/stats/nodes-over-time/route.ts b/src/app/(app)/api/stats/nodes-over-time/route.ts
similarity index 100%
rename from src/app/api/stats/nodes-over-time/route.ts
rename to src/app/(app)/api/stats/nodes-over-time/route.ts
diff --git a/src/app/api/stats/popular-channels/route.ts b/src/app/(app)/api/stats/popular-channels/route.ts
similarity index 100%
rename from src/app/api/stats/popular-channels/route.ts
rename to src/app/(app)/api/stats/popular-channels/route.ts
diff --git a/src/app/api/stats/repeater-prefixes/route.ts b/src/app/(app)/api/stats/repeater-prefixes/route.ts
similarity index 100%
rename from src/app/api/stats/repeater-prefixes/route.ts
rename to src/app/(app)/api/stats/repeater-prefixes/route.ts
diff --git a/src/app/api/stats/total-nodes/route.ts b/src/app/(app)/api/stats/total-nodes/route.ts
similarity index 100%
rename from src/app/api/stats/total-nodes/route.ts
rename to src/app/(app)/api/stats/total-nodes/route.ts
diff --git a/src/app/globals.css b/src/app/(app)/globals.css
similarity index 100%
rename from src/app/globals.css
rename to src/app/(app)/globals.css
diff --git a/src/app/layout.tsx b/src/app/(app)/layout.tsx
similarity index 90%
rename from src/app/layout.tsx
rename to src/app/(app)/layout.tsx
index a7d6006..f733425 100644
--- a/src/app/layout.tsx
+++ b/src/app/(app)/layout.tsx
@@ -1,9 +1,9 @@
import type { Metadata, Viewport } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
-import Header from "../components/Header";
-import { ConfigProvider } from "../components/ConfigContext";
-import { QueryProvider } from "../components/QueryProvider";
+import Header from "@/components/Header";
+import { ConfigProvider } from "@/components/ConfigContext";
+import { QueryProvider } from "@/components/QueryProvider";
const geistSans = Geist({
variable: "--font-geist-sans",
diff --git a/src/app/meshcore/node/[publicKey]/page.tsx b/src/app/(app)/meshcore/node/[publicKey]/page.tsx
similarity index 100%
rename from src/app/meshcore/node/[publicKey]/page.tsx
rename to src/app/(app)/meshcore/node/[publicKey]/page.tsx
diff --git a/src/app/messages/page.tsx b/src/app/(app)/messages/page.tsx
similarity index 100%
rename from src/app/messages/page.tsx
rename to src/app/(app)/messages/page.tsx
diff --git a/src/app/not-found.tsx b/src/app/(app)/not-found.tsx
similarity index 100%
rename from src/app/not-found.tsx
rename to src/app/(app)/not-found.tsx
diff --git a/src/app/page.tsx b/src/app/(app)/page.tsx
similarity index 51%
rename from src/app/page.tsx
rename to src/app/(app)/page.tsx
index e63c0ce..9c8bc94 100644
--- a/src/app/page.tsx
+++ b/src/app/(app)/page.tsx
@@ -1,4 +1,4 @@
-import MapWithChatClient from "../components/MapWithChatClient";
+import MapWithChatClient from "@/components/MapWithChatClient";
export default function Home() {
return ;
diff --git a/src/app/search/page.tsx b/src/app/(app)/search/page.tsx
similarity index 100%
rename from src/app/search/page.tsx
rename to src/app/(app)/search/page.tsx
diff --git a/src/app/stats/page.tsx b/src/app/(app)/stats/page.tsx
similarity index 100%
rename from src/app/stats/page.tsx
rename to src/app/(app)/stats/page.tsx
diff --git a/src/components/ChatBox.tsx b/src/components/ChatBox.tsx
index 249b4f1..1b6b93c 100644
--- a/src/components/ChatBox.tsx
+++ b/src/components/ChatBox.tsx
@@ -2,14 +2,14 @@
import { useState } from "react";
import { MinusIcon, PlusIcon } from "@heroicons/react/24/outline";
import { useConfig } from "./ConfigContext";
-import { getChannelIdFromKey } from "../lib/meshcore";
+import { getChannelIdFromKey } from "@/lib/meshcore";
import ChatMessageItem from "./ChatMessageItem";
import RefreshButton from "./RefreshButton";
import RegionSelector from "./RegionSelector";
-import { getRegionConfig } from "../lib/regions";
-import { useChatMessages } from "../hooks/useChatMessages";
-import { useIntersectionObserver } from "../hooks/useIntersectionObserver";
-import { useQueryParams } from "../hooks/useQueryParams";
+import { getRegionConfig } from "@/lib/regions";
+import { useChatMessages } from "@/hooks/useChatMessages";
+import { useIntersectionObserver } from "@/hooks/useIntersectionObserver";
+import { useQueryParams } from "@/hooks/useQueryParams";
interface ChatBoxProps {
diff --git a/src/components/ChatMessageItem.tsx b/src/components/ChatMessageItem.tsx
index e05bfe9..92d78a5 100644
--- a/src/components/ChatMessageItem.tsx
+++ b/src/components/ChatMessageItem.tsx
@@ -1,7 +1,7 @@
"use client";
import React, { useMemo } from "react";
import { useConfig } from "./ConfigContext";
-import { useMessageDecryption } from "../hooks/useMessageDecryption";
+import { useMessageDecryption } from "@/hooks/useMessageDecryption";
import PathVisualization, { PathData } from "./PathVisualization";
import NodeLinkWithHover from "./NodeLinkWithHover";
diff --git a/src/components/ConfigContext.tsx b/src/components/ConfigContext.tsx
index f3e834f..4dddb53 100644
--- a/src/components/ConfigContext.tsx
+++ b/src/components/ConfigContext.tsx
@@ -1,7 +1,7 @@
"use client";
import React, { createContext, useContext, useState, useEffect, useRef, useLayoutEffect, ReactNode } from "react";
-import { getChannelIdFromKey } from "../lib/meshcore";
-import { getRegionFriendlyNames } from "../lib/regions";
+import { getChannelIdFromKey } from "@/lib/meshcore";
+import { getRegionFriendlyNames } from "@/lib/regions";
import Modal from "./Modal";
// Config shape
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index c32361b..b60e5cf 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -4,7 +4,7 @@ import { Cog6ToothIcon, InformationCircleIcon, ChevronDownIcon } from "@heroicon
import { useConfig } from "./ConfigContext";
import React, { useState, useEffect, useRef, useCallback } from "react";
import InfoModal from "./InfoModal";
-import { getAppName } from "../lib/api";
+import { getAppName } from "@/lib/api";
interface HeaderProps {
configButtonRef?: React.Ref;
diff --git a/src/components/InfoModal.tsx b/src/components/InfoModal.tsx
index 4dc0915..88f119c 100644
--- a/src/components/InfoModal.tsx
+++ b/src/components/InfoModal.tsx
@@ -1,6 +1,6 @@
"use client";
import React from "react";
-import { getAppName } from "../lib/api";
+import { getAppName } from "@/lib/api";
import Modal from "./Modal";
interface InfoModalProps {
diff --git a/src/components/MapIcons.tsx b/src/components/MapIcons.tsx
index 57ea568..3288166 100644
--- a/src/components/MapIcons.tsx
+++ b/src/components/MapIcons.tsx
@@ -1,8 +1,8 @@
import React from 'react';
import moment from "moment";
-import { formatPublicKey } from '../lib/meshcore';
-import { getNameIconLabel } from '../lib/meshcore-map-nodeutils';
-import { NodePosition } from '../types/map';
+import { formatPublicKey } from '@/lib/meshcore';
+import { getNameIconLabel } from '@/lib/meshcore-map-nodeutils';
+import { NodePosition } from '@/types/map';
interface NodeMarkerProps {
node: NodePosition;
diff --git a/src/components/MapView.tsx b/src/components/MapView.tsx
index f0ff48e..ff5ac62 100644
--- a/src/components/MapView.tsx
+++ b/src/components/MapView.tsx
@@ -11,10 +11,10 @@ import { useConfig } from "./ConfigContext";
import RefreshButton from "@/components/RefreshButton";
import { NodeMarker, ClusterMarker, PopupContent } from "./MapIcons";
import { renderToString } from "react-dom/server";
-import { buildApiUrl } from "../lib/api";
-import { NodePosition } from "../types/map";
-import { useNeighbors, type Neighbor } from "../hooks/useNeighbors";
-import { useQueryParams } from "../hooks/useQueryParams";
+import { buildApiUrl } from "@/lib/api";
+import { NodePosition } from "@/types/map";
+import { useNeighbors, type Neighbor } from "@/hooks/useNeighbors";
+import { useQueryParams } from "@/hooks/useQueryParams";
const DEFAULT = {
lat: 46.56, // Center between Seattle and Portland
diff --git a/src/components/PathVisualization.tsx b/src/components/PathVisualization.tsx
index 1eea194..bb5c809 100644
--- a/src/components/PathVisualization.tsx
+++ b/src/components/PathVisualization.tsx
@@ -6,8 +6,8 @@ import Link from "next/link";
import Tree from 'react-d3-tree';
import { ArrowsPointingOutIcon, ArrowsPointingInIcon } from "@heroicons/react/24/outline";
import PathDisplay from "./PathDisplay";
-import { useMeshcoreSearches } from "../hooks/useMeshcoreSearch";
-import type { MeshcoreSearchResult } from "../hooks/useMeshcoreSearch";
+import { useMeshcoreSearches } from "@/hooks/useMeshcoreSearch";
+import type { MeshcoreSearchResult } from "@/hooks/useMeshcoreSearch";
import { useConfig } from "./ConfigContext";
export interface PathData {
diff --git a/src/components/RegionSelector.tsx b/src/components/RegionSelector.tsx
index e7293f3..a44eec0 100644
--- a/src/components/RegionSelector.tsx
+++ b/src/components/RegionSelector.tsx
@@ -1,6 +1,6 @@
"use client";
import { useConfig } from "./ConfigContext";
-import { getRegionFriendlyNames } from "../lib/regions";
+import { getRegionFriendlyNames } from "@/lib/regions";
interface RegionSelectorProps {
onRegionSelected?: () => void;
diff --git a/src/hooks/useChatMessages.ts b/src/hooks/useChatMessages.ts
index 4b9b23e..ab7030e 100644
--- a/src/hooks/useChatMessages.ts
+++ b/src/hooks/useChatMessages.ts
@@ -2,8 +2,8 @@
import { useInfiniteQuery, useQuery, useQueryClient } from '@tanstack/react-query';
import { useEffect, useMemo } from 'react';
-import { buildApiUrl } from '../lib/api';
-import { ChatMessage } from '../components/ChatMessageItem';
+import { buildApiUrl } from '@/lib/api';
+import { ChatMessage } from '@/components/ChatMessageItem';
interface ChatMessagesParams {
channelId?: string;
diff --git a/src/hooks/useMeshcoreSearch.ts b/src/hooks/useMeshcoreSearch.ts
index 3427c1b..c7981f1 100644
--- a/src/hooks/useMeshcoreSearch.ts
+++ b/src/hooks/useMeshcoreSearch.ts
@@ -1,6 +1,6 @@
import { useQuery, useQueries } from '@tanstack/react-query';
import { create, windowScheduler, indexedResolver } from '@yornaath/batshit';
-import { buildApiUrl } from '../lib/api';
+import { buildApiUrl } from '@/lib/api';
import { useMemo } from 'react';
export interface MeshcoreSearchResult {
diff --git a/src/hooks/useMessageDecryption.ts b/src/hooks/useMessageDecryption.ts
index ce2b6d3..7b290a5 100644
--- a/src/hooks/useMessageDecryption.ts
+++ b/src/hooks/useMessageDecryption.ts
@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query';
-import { decryptMeshcoreGroupMessage } from '../lib/meshcore';
+import { decryptMeshcoreGroupMessage } from '@/lib/meshcore';
import { useMemo } from 'react';
export interface MessageDecryptionParams {
diff --git a/src/hooks/useNeighbors.ts b/src/hooks/useNeighbors.ts
index c3d83c7..8cf12bd 100644
--- a/src/hooks/useNeighbors.ts
+++ b/src/hooks/useNeighbors.ts
@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query';
-import { buildApiUrl } from '../lib/api';
+import { buildApiUrl } from '@/lib/api';
export interface Neighbor {
public_key: string;
diff --git a/src/hooks/useNodeData.ts b/src/hooks/useNodeData.ts
index 4fdfd74..52210bc 100644
--- a/src/hooks/useNodeData.ts
+++ b/src/hooks/useNodeData.ts
@@ -1,5 +1,5 @@
import { useQuery } from '@tanstack/react-query';
-import { buildApiUrl } from '../lib/api';
+import { buildApiUrl } from '@/lib/api';
export interface NodeInfo {
public_key: string;
diff --git a/src/lib/clickhouse/actions.ts b/src/lib/clickhouse/actions.ts
index 2955361..a88fcee 100644
--- a/src/lib/clickhouse/actions.ts
+++ b/src/lib/clickhouse/actions.ts
@@ -1,6 +1,6 @@
"use server";
import { clickhouse } from "./clickhouse";
-import { generateRegionWhereClauseFromArray, generateRegionWhereClause } from "../regionFilters";
+import { generateRegionWhereClauseFromArray, generateRegionWhereClause } from "@/lib/regionFilters";
export async function getNodePositions({ minLat, maxLat, minLng, maxLng, nodeTypes, lastSeen }: { minLat?: string | null, maxLat?: string | null, minLng?: string | null, maxLng?: string | null, nodeTypes?: string[], lastSeen?: string | null } = {}) {
try {
diff --git a/src/lib/regionFilters.ts b/src/lib/regionFilters.ts
index 8f25ade..33498b2 100644
--- a/src/lib/regionFilters.ts
+++ b/src/lib/regionFilters.ts
@@ -1,4 +1,4 @@
-import { getRegionConfig } from "./regions";
+import { getRegionConfig } from "@/lib/regions";
/**
* Generates a ClickHouse WHERE clause for filtering by region using broker and topic fields