refactor: make frontend a pure presentation layer fetching from backend API
Server components now fetch composed data from the backend instead of directly querying SQLite and external APIs. Removes better-sqlite3 dependency from the frontend entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import { WeekNav } from "./WeekNav";
|
||||
import { Legend } from "./Legend";
|
||||
import { EmptyState } from "./EmptyState";
|
||||
import { PARKS, groupByRegion } from "@/lib/parks";
|
||||
import type { DayData } from "@/lib/db";
|
||||
import type { DayData } from "@/lib/types";
|
||||
|
||||
const REFRESH_INTERVAL_MS = 2 * 60 * 1000; // 2 minutes
|
||||
const OPEN_REFRESH_BUFFER_MS = 30_000; // 30s after opening time before hitting the API
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Park } from "@/lib/scrapers/types";
|
||||
import type { DayData } from "@/lib/db";
|
||||
import type { DayData } from "@/lib/types";
|
||||
import type { Region } from "@/lib/parks";
|
||||
import { ParkCard } from "./ParkCard";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Link from "next/link";
|
||||
import type { Park } from "@/lib/scrapers/types";
|
||||
import type { DayData } from "@/lib/db";
|
||||
import type { DayData } from "@/lib/types";
|
||||
import { getTimezoneAbbr } from "@/lib/env";
|
||||
|
||||
interface ParkCardProps {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Link from "next/link";
|
||||
import type { DayData } from "@/lib/db";
|
||||
import type { DayData } from "@/lib/types";
|
||||
import { getTimezoneAbbr } from "@/lib/env";
|
||||
|
||||
interface ParkMonthCalendarProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Fragment } from "react";
|
||||
import Link from "next/link";
|
||||
import type { Park } from "@/lib/scrapers/types";
|
||||
import type { DayData } from "@/lib/db";
|
||||
import type { DayData } from "@/lib/types";
|
||||
import type { Region } from "@/lib/parks";
|
||||
import { getTodayLocal, getTimezoneAbbr } from "@/lib/env";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user