🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
rearrange deps
Bill Yangdeb3f2cf09bb
diff --git a/client/src/app/components/Header/CustomDateRangePicker.tsx b/client/src/app/[site]/components/Header/CustomDateRangePicker.tsxsimilarity index 100%rename from client/src/app/components/Header/CustomDateRangePicker.tsxrename to client/src/app/[site]/components/Header/CustomDateRangePicker.tsxdiff --git a/client/src/app/components/Header/DateSelector.tsx b/client/src/app/[site]/components/Header/DateSelector.tsxsimilarity index 97%rename from client/src/app/components/Header/DateSelector.tsxrename to client/src/app/[site]/components/Header/DateSelector.tsxindex dc0a6c761..dca61716c 100644--- a/client/src/app/components/Header/DateSelector.tsx+++ b/client/src/app/[site]/components/Header/DateSelector.tsx@@ -1,6 +1,5 @@"use client";-import { Button } from "@/components/ui/button";import {DropdownMenu,DropdownMenuContent,diff --git a/client/src/app/components/Header/Header.tsx b/client/src/app/[site]/components/Header/Header.tsxsimilarity index 97%rename from client/src/app/components/Header/Header.tsxrename to client/src/app/[site]/components/Header/Header.tsxindex 195f4c629..ea5906806 100644--- a/client/src/app/components/Header/Header.tsx+++ b/client/src/app/[site]/components/Header/Header.tsx@@ -12,7 +12,7 @@ import {import { ChevronLeft, ChevronRight } from "lucide-react";import { DateSelector } from "./DateSelector";import { DateTime } from "luxon";-import { authedFetch } from "../../../hooks/utils";+import { authedFetch } from "@/hooks/utils";const canGoForward = (time: Time) => {const currentDay = DateTime.now().startOf("day");diff --git a/client/src/app/components/MainSection/BucketSelection.tsx b/client/src/app/[site]/components/MainSection/BucketSelection.tsxsimilarity index 94%rename from client/src/app/components/MainSection/BucketSelection.tsxrename to client/src/app/[site]/components/MainSection/BucketSelection.tsxindex 39b96e098..5a342bc73 100644--- a/client/src/app/components/MainSection/BucketSelection.tsx+++ b/client/src/app/[site]/components/MainSection/BucketSelection.tsx@@ -1,13 +1,13 @@"use client";-import { Time, useTimeSelection } from "../../../lib/timeSelectionStore";+import { Time, useTimeSelection } from "@/lib/timeSelectionStore";import {SelectItem,Select,SelectContent,SelectTrigger,SelectValue,-} from "../../../components/ui/select";+} from "@/components/ui/select";import { DateTime } from "luxon";const getOptions = (time: Time) => {diff --git a/client/src/app/components/MainSection/Chart.tsx b/client/src/app/[site]/components/MainSection/Chart.tsxsimilarity index 97%rename from client/src/app/components/MainSection/Chart.tsxrename to client/src/app/[site]/components/MainSection/Chart.tsxindex ba7a7929e..85fb7e0a9 100644--- a/client/src/app/components/MainSection/Chart.tsx+++ b/client/src/app/[site]/components/MainSection/Chart.tsx@@ -2,9 +2,9 @@import { ResponsiveLine } from "@nivo/line";import { round } from "lodash";import { DateTime } from "luxon";-import { APIResponse, GetPageViewsResponse } from "../../../hooks/api";-import { nivoTheme } from "../../../lib/nivo";-import { Time, useTimeSelection } from "../../../lib/timeSelectionStore";+import { APIResponse, GetPageViewsResponse } from "@/hooks/api";+import { nivoTheme } from "@/lib/nivo";+import { Time, useTimeSelection } from "@/lib/timeSelectionStore";export const formatter = Intl.NumberFormat("en", { notation: "compact" });diff --git a/client/src/app/components/MainSection/MainSection.tsx b/client/src/app/[site]/components/MainSection/MainSection.tsxsimilarity index 95%rename from client/src/app/components/MainSection/MainSection.tsxrename to client/src/app/[site]/components/MainSection/MainSection.tsxindex 1b643cd44..68ce6448a 100644--- a/client/src/app/components/MainSection/MainSection.tsx+++ b/client/src/app/[site]/components/MainSection/MainSection.tsx@@ -1,6 +1,6 @@"use client";import { Card, CardContent, CardLoader } from "@/components/ui/card";-import { useGetOverview, useGetPageviews } from "../../../hooks/api";+import { useGetOverview, useGetPageviews } from "@/hooks/api";import { BucketSelection } from "./BucketSelection";import { Chart } from "./Chart";import { Overview } from "./Overview";diff --git a/client/src/app/components/MainSection/Overview.tsx b/client/src/app/[site]/components/MainSection/Overview.tsxsimilarity index 95%rename from client/src/app/components/MainSection/Overview.tsxrename to client/src/app/[site]/components/MainSection/Overview.tsxindex 3bd00fd02..ded1287f1 100644--- a/client/src/app/components/MainSection/Overview.tsx+++ b/client/src/app/[site]/components/MainSection/Overview.tsx@@ -1,10 +1,10 @@"use client";import { Duration } from "luxon";-import { Badge } from "../../../components/ui/badge";-import { Skeleton } from "../../../components/ui/skeleton";-import { useGetOverview } from "../../../hooks/api";-import { formatter } from "../../../lib/utils";+import { Badge } from "@/components/ui/badge";+import { Skeleton } from "@/components/ui/skeleton";+import { useGetOverview } from "@/hooks/api";+import { formatter } from "@/lib/utils";const ChangePercentage = ({current,diff --git a/client/src/app/components/MainSection/PreviousChart.tsx b/client/src/app/[site]/components/MainSection/PreviousChart.tsxsimilarity index 93%rename from client/src/app/components/MainSection/PreviousChart.tsxrename to client/src/app/[site]/components/MainSection/PreviousChart.tsxindex beb1dddeb..c1eeb2308 100644--- a/client/src/app/components/MainSection/PreviousChart.tsx+++ b/client/src/app/[site]/components/MainSection/PreviousChart.tsx@@ -1,9 +1,9 @@"use client";import { ResponsiveLine } from "@nivo/line";import { DateTime } from "luxon";-import { APIResponse, GetPageViewsResponse } from "../../../hooks/api";-import { nivoTheme } from "../../../lib/nivo";-import { Time, useTimeSelection } from "../../../lib/timeSelectionStore";+import { APIResponse, GetPageViewsResponse } from "@/hooks/api";+import { nivoTheme } from "@/lib/nivo";+import { Time, useTimeSelection } from "@/lib/timeSelectionStore";import { useMemo } from "react";const getMin = (time: Time) => {diff --git a/client/src/app/components/sections/Browsers/Browsers.tsx b/client/src/app/[site]/components/sections/Browsers/Browsers.tsxsimilarity index 97%rename from client/src/app/components/sections/Browsers/Browsers.tsxrename to client/src/app/[site]/components/sections/Browsers/Browsers.tsxindex 7c0670118..d13bf4ad8 100644--- a/client/src/app/components/sections/Browsers/Browsers.tsx+++ b/client/src/app/[site]/components/sections/Browsers/Browsers.tsx@@ -3,7 +3,7 @@import { Compass } from "lucide-react";import Image from "next/image";import { StandardCard } from "../../shared/StandardCard";-import { useGetBrowsers } from "../../../../hooks/api";+import { useGetBrowsers } from "@/hooks/api";const BROWSER_TO_LOGO: Record<string, string> = {Chrome: "Chrome.svg",diff --git a/client/src/app/components/sections/Countries/Countries.tsx b/client/src/app/[site]/components/sections/Countries/Countries.tsxsimilarity index 95%rename from client/src/app/components/sections/Countries/Countries.tsxrename to client/src/app/[site]/components/sections/Countries/Countries.tsxindex 1088e6c88..7d25dfe8e 100644--- a/client/src/app/components/sections/Countries/Countries.tsx+++ b/client/src/app/[site]/components/sections/Countries/Countries.tsx@@ -4,7 +4,7 @@ import React from "react";import { StandardCard } from "../../shared/StandardCard";import { countries } from "countries-list";import * as CountryFlags from "country-flag-icons/react/3x2";-import { useGetCountries } from "../../../../hooks/api";+import { useGetCountries } from "@/hooks/api";export function Countries() {const { data, isLoading } = useGetCountries();diff --git a/client/src/app/components/sections/Devices/Devices.tsx b/client/src/app/[site]/components/sections/Devices/Devices.tsxsimilarity index 86%rename from client/src/app/components/sections/Devices/Devices.tsxrename to client/src/app/[site]/components/sections/Devices/Devices.tsxindex bcec478f4..c2268258c 100644--- a/client/src/app/components/sections/Devices/Devices.tsx+++ b/client/src/app/[site]/components/sections/Devices/Devices.tsx@@ -1,6 +1,6 @@"use client";-import { useGetDevices } from "../../../../hooks/api";+import { useGetDevices } from "@/hooks/api";import { StandardCard } from "../../shared/StandardCard";export function Devices() {diff --git a/client/src/app/components/sections/Map/Chloropleth.tsx b/client/src/app/[site]/components/sections/Map/Chloropleth.tsxsimilarity index 98%rename from client/src/app/components/sections/Map/Chloropleth.tsxrename to client/src/app/[site]/components/sections/Map/Chloropleth.tsxindex 457683f56..2238469c4 100644--- a/client/src/app/components/sections/Map/Chloropleth.tsx+++ b/client/src/app/[site]/components/sections/Map/Chloropleth.tsx@@ -6,7 +6,7 @@ import { useEffect, useMemo, useState } from "react";import { Feature, FeatureCollection } from "geojson";import { scaleLinear } from "d3-scale";import dynamic from "next/dynamic";-import { useGetCountries } from "../../../../hooks/api";+import { useGetCountries } from "@/hooks/api";const MapContainer = dynamic(() => import("react-leaflet").then((mod) => mod.MapContainer),diff --git a/client/src/app/components/sections/Map/Map.tsx b/client/src/app/[site]/components/sections/Map/Map.tsxsimilarity index 98%rename from client/src/app/components/sections/Map/Map.tsxrename to client/src/app/[site]/components/sections/Map/Map.tsxindex 5e30cea3b..7f10e6f66 100644--- a/client/src/app/components/sections/Map/Map.tsx+++ b/client/src/app/[site]/components/sections/Map/Map.tsx@@ -16,12 +16,12 @@ import {CardHeader,CardLoader,CardTitle,-} from "../../../../components/ui/card";+} from "@/components/ui/card";import { countries } from "countries-list";import * as CountryFlags from "country-flag-icons/react/3x2";import React from "react";-import { useGetCountries } from "../../../../hooks/api";+import { useGetCountries } from "@/hooks/api";const geoUrl = "/countries.geojson";diff --git a/client/src/app/components/sections/OperatingSystems/OperatingSystems.tsx b/client/src/app/[site]/components/sections/OperatingSystems/OperatingSystems.tsxsimilarity index 95%rename from client/src/app/components/sections/OperatingSystems/OperatingSystems.tsxrename to client/src/app/[site]/components/sections/OperatingSystems/OperatingSystems.tsxindex 505e60e18..be176e5c3 100644--- a/client/src/app/components/sections/OperatingSystems/OperatingSystems.tsx+++ b/client/src/app/[site]/components/sections/OperatingSystems/OperatingSystems.tsx@@ -3,7 +3,7 @@import { Compass } from "lucide-react";import { StandardCard } from "../../shared/StandardCard";import Image from "next/image";-import { useGetOperatingSystems } from "../../../../hooks/api";+import { useGetOperatingSystems } from "@/hooks/api";const OS_TO_LOGO: Record<string, string> = {Windows: "Windows.svg",diff --git a/client/src/app/components/sections/Pages/Pages.tsx b/client/src/app/[site]/components/sections/Pages/Pages.tsxsimilarity index 86%rename from client/src/app/components/sections/Pages/Pages.tsxrename to client/src/app/[site]/components/sections/Pages/Pages.tsxindex 48bc42845..7666110c6 100644--- a/client/src/app/components/sections/Pages/Pages.tsx+++ b/client/src/app/[site]/components/sections/Pages/Pages.tsx@@ -1,6 +1,6 @@"use client";-import { useGetPages } from "../../../../hooks/api";+import { useGetPages } from "@/hooks/api";import { StandardCard } from "../../shared/StandardCard";export function Pages() {diff --git a/client/src/app/components/sections/Referrers/Referrers.tsx b/client/src/app/[site]/components/sections/Referrers/Referrers.tsxsimilarity index 93%rename from client/src/app/components/sections/Referrers/Referrers.tsxrename to client/src/app/[site]/components/sections/Referrers/Referrers.tsxindex 3d9475b63..28e63da8e 100644--- a/client/src/app/components/sections/Referrers/Referrers.tsx+++ b/client/src/app/[site]/components/sections/Referrers/Referrers.tsx@@ -1,6 +1,6 @@"use client";-import { useGetReferrers } from "../../../../hooks/api";+import { useGetReferrers } from "@/hooks/api";import { StandardCard } from "../../shared/StandardCard";export function Referrers() {diff --git a/client/src/app/components/shared/StandardCard.tsx b/client/src/app/[site]/components/shared/StandardCard.tsxsimilarity index 95%rename from client/src/app/components/shared/StandardCard.tsxrename to client/src/app/[site]/components/shared/StandardCard.tsxindex edcf94c13..f4a7a711c 100644--- a/client/src/app/components/shared/StandardCard.tsx+++ b/client/src/app/[site]/components/shared/StandardCard.tsx@@ -1,21 +1,21 @@"use client";import { ReactNode } from "react";-import { Button } from "../../../components/ui/button";+import { Button } from "@/components/ui/button";import {Card,CardContent,CardHeader,CardLoader,CardTitle,-} from "../../../components/ui/card";+} from "@/components/ui/card";import {Dialog,DialogContent,DialogHeader,DialogTitle,DialogTrigger,-} from "../../../components/ui/dialog";+} from "@/components/ui/dialog";export function StandardCard<T extends { percentage: number; count: number }>({title,diff --git a/client/src/app/[site]/page.tsx b/client/src/app/[site]/page.tsxindex 937208ed4..bf72bf552 100644--- a/client/src/app/[site]/page.tsx+++ b/client/src/app/[site]/page.tsx@@ -1,3 +1,30 @@+import { Header } from "./components/Header/Header";+import { MainSection } from "./components/MainSection/MainSection";+import { Browsers } from "./components/sections/Browsers/Browsers";+import { Countries } from "./components/sections/Countries/Countries";+import { Devices } from "./components/sections/Devices/Devices";+import { Map } from "./components/sections/Map/Map";+import { OperatingSystems } from "./components/sections/OperatingSystems/OperatingSystems";+import { Pages } from "./components/sections/Pages/Pages";+import { Referrers } from "./components/sections/Referrers/Referrers";+export default function SitePage() {- return <div>fads</div>;+ return (+ <main className="flex min-h-screen flex-col items-center p-4 pt-12">+ <div className="w-full max-w-6xl">+ <Header />+ <MainSection />+ <div className="grid grid-cols-2 gap-4 mt-4">+ <OperatingSystems />+ <Browsers />+ <Devices />+ <Pages />+ <Referrers />+ <Countries />+ <Map />+ {/* <Chloropleth /> */}+ </div>+ </div>+ </main>+ );}diff --git a/client/src/app/page.tsx b/client/src/app/page.tsxindex b3b3ebca7..6c6a52956 100644--- a/client/src/app/page.tsx+++ b/client/src/app/page.tsx@@ -1,30 +1,7 @@-import { Header } from "./components/Header/Header";-import { MainSection } from "./components/MainSection/MainSection";-import { Browsers } from "./components/sections/Browsers/Browsers";-import { Countries } from "./components/sections/Countries/Countries";-import { Devices } from "./components/sections/Devices/Devices";-import { Map } from "./components/sections/Map/Map";-import { OperatingSystems } from "./components/sections/OperatingSystems/OperatingSystems";-import { Pages } from "./components/sections/Pages/Pages";-import { Referrers } from "./components/sections/Referrers/Referrers";-export default function Home() {return (<main className="flex min-h-screen flex-col items-center p-4 pt-12">- <div className="w-full max-w-6xl">- <Header />- <MainSection />- <div className="grid grid-cols-2 gap-4 mt-4">- <OperatingSystems />- <Browsers />- <Devices />- <Pages />- <Referrers />- <Countries />- <Map />- {/* <Chloropleth /> */}- </div>- </div>+ home</main>);}