Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🔥 Remove unused files (#2170)

Luke Vella844cfece0bbb
diff --git a/apps/web/i18n.config.js b/apps/web/i18n.config.js
deleted file mode 100644
index 028e542be..000000000
--- a/apps/web/i18n.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const languages = require("@rallly/languages/languages.json");
-
-module.exports = {
- defaultLocale: "en",
- locales: Object.keys(languages),
-};
diff --git a/apps/web/knip.json b/apps/web/knip.json
new file mode 100644
index 000000000..46a3c961b
--- /dev/null
+++ b/apps/web/knip.json
@@ -0,0 +1,5 @@
+{
+ "$schema": "https://unpkg.com/knip@5/schema.json",
+ "tags": ["-lintignore"],
+ "entry": ["i18next-scanner.config.js"]
+}
diff --git a/apps/web/src/app/[locale]/(auth)/register/actions.ts b/apps/web/src/app/[locale]/(auth)/register/actions.ts
deleted file mode 100644
index b095f5988..000000000
--- a/apps/web/src/app/[locale]/(auth)/register/actions.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-"use server";
-
-import { cookies } from "next/headers";
-
-export async function setToken(token: string) {
- (await cookies()).set("registration-token", token, {
- httpOnly: true,
- secure: process.env.NEXT_PUBLIC_BASE_URL?.startsWith("https://"),
- sameSite: "lax",
- maxAge: 15 * 60,
- });
-}
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/components/top-bar.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/components/top-bar.tsx
deleted file mode 100644
index 637c4b9a4..000000000
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/components/top-bar.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { cn } from "@rallly/ui";
-
-export function TopBar({
- children,
- className,
-}: {
- children: React.ReactNode;
- className?: string;
-}) {
- return (
- <div
- className={cn(
- "sticky top-0 z-10 flex items-center gap-4 rounded-t-lg border-b bg-background/90 px-4 py-3 backdrop-blur-md",
- className,
- )}
- >
- {children}
- </div>
- );
-}
-
-export function TopBarLeft({ children }: { children: React.ReactNode }) {
- return <div className="flex flex-1 items-center gap-x-4">{children}</div>;
-}
-
-export function TopBarRight({ children }: { children: React.ReactNode }) {
- return (
- <div className="flex flex-1 items-center justify-end gap-x-4">
- {children}
- </div>
- );
-}
-
-export function TopBarGroup({
- children,
- className,
-}: {
- children: React.ReactNode;
- className?: string;
-}) {
- return (
- <div className={cn("flex items-center gap-x-1", className)}>{children}</div>
- );
-}
-
-export function TopBarSeparator() {
- return <div className="h-4 w-px bg-border" />;
-}
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/events/types.ts b/apps/web/src/app/[locale]/(space)/(dashboard)/events/types.ts
deleted file mode 100644
index 92f1411b7..000000000
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/events/types.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export type ScheduledEvent = {
- id: string;
- title: string;
- start: Date;
- duration: number;
- timeZone: string | null;
- participants: { name: string }[];
-};
diff --git a/apps/web/src/app/[locale]/(space)/mobile-navigation.tsx b/apps/web/src/app/[locale]/(space)/mobile-navigation.tsx
deleted file mode 100644
index 4596924e4..000000000
--- a/apps/web/src/app/[locale]/(space)/mobile-navigation.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-"use client";
-
-import { Slot } from "@radix-ui/react-slot";
-import { cn } from "@rallly/ui";
-import { Button } from "@rallly/ui/button";
-import {
- BarChart2Icon,
- CalendarIcon,
- HomeIcon,
- MenuIcon,
- PlusIcon,
-} from "lucide-react";
-import Link from "next/link";
-import { usePathname } from "next/navigation";
-
-function MobileNavigationIcon({ children }: { children: React.ReactNode }) {
- return (
- <Slot className="size-5 text-muted-foreground group-hover:text-foreground group-focus:text-primary group-[.is-active]:text-primary">
- {children}
- </Slot>
- );
-}
-
-function MobileNavigationItem({
- children,
- href,
-}: {
- href: string;
- children?: React.ReactNode;
-}) {
- const pathname = usePathname();
- return (
- <Link
- className={cn(
- "group flex grow basis-1/5 flex-col items-center gap-1 rounded-lg",
- {
- "is-active pointer-events-none": pathname === href,
- },
- )}
- href={href}
- >
- {children}
- </Link>
- );
-}
-
-export function MobileNavigation() {
- return (
- <div className="flex items-center justify-between gap-x-4">
- <MobileNavigationItem href="/">
- <MobileNavigationIcon>
- <HomeIcon />
- </MobileNavigationIcon>
- </MobileNavigationItem>
- <MobileNavigationItem href="/polls">
- <MobileNavigationIcon>
- <BarChart2Icon />
- </MobileNavigationIcon>
- </MobileNavigationItem>
- <Button asChild variant="primary">
- <Link href="/new">
- <PlusIcon className="size-5 text-white" />
- </Link>
- </Button>
- <MobileNavigationItem href="/events">
- <MobileNavigationIcon>
- <CalendarIcon />
- </MobileNavigationIcon>
- </MobileNavigationItem>
- <MobileNavigationItem href="/menu">
- <MobileNavigationIcon>
- <MenuIcon />
- </MobileNavigationIcon>
- </MobileNavigationItem>
- </div>
- );
-}
diff --git a/apps/web/src/app/[locale]/(space)/settings/members/components/tabs.tsx b/apps/web/src/app/[locale]/(space)/settings/members/components/tabs.tsx
deleted file mode 100644
index 58f28d907..000000000
--- a/apps/web/src/app/[locale]/(space)/settings/members/components/tabs.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import {
- PageTabs,
- PageTabsContent,
- PageTabsList,
- PageTabsTrigger,
-} from "@/app/components/page-tabs";
-import { Trans } from "@/components/trans";
-import type { MemberRole } from "@/features/space/schema";
-
-export const MembersTabs = ({
- value = "all",
- children,
-}: {
- value?: "all" | MemberRole;
- children: React.ReactNode;
-}) => {
- return (
- <PageTabs name="role" value={value}>
- <PageTabsList>
- <PageTabsTrigger value="all">
- <Trans i18nKey="allMembers" defaults="All" />
- </PageTabsTrigger>
- <PageTabsTrigger value="member">
- <Trans i18nKey="member" defaults="Member" />
- </PageTabsTrigger>
- <PageTabsTrigger value="admin">
- <Trans i18nKey="admin" defaults="Admin" />
- </PageTabsTrigger>
- </PageTabsList>
- <PageTabsContent value={value}>{children}</PageTabsContent>
- </PageTabs>
- );
-};
diff --git a/apps/web/src/app/[locale]/(space)/settings/members/schema.ts b/apps/web/src/app/[locale]/(space)/settings/members/schema.ts
deleted file mode 100644
index 977c83ce9..000000000
--- a/apps/web/src/app/[locale]/(space)/settings/members/schema.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import * as z from "zod";
-
-export const searchParamsSchema = z.object({
- page: z.coerce.number().min(1).default(1),
- pageSize: z.coerce.number().min(1).default(10),
- q: z.string().optional(),
- role: z.enum(["all", "member", "admin"]).optional().catch("all"),
-});
diff --git a/apps/web/src/app/[locale]/poll/[urlId]/duplicate-dialog.tsx b/apps/web/src/app/[locale]/poll/[urlId]/duplicate-dialog.tsx
deleted file mode 100644
index fc43391ca..000000000
--- a/apps/web/src/app/[locale]/poll/[urlId]/duplicate-dialog.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-"use client";
-import { usePostHog } from "@rallly/posthog/client";
-import { Button } from "@rallly/ui/button";
-import type { DialogProps } from "@rallly/ui/dialog";
-import {
- Dialog,
- DialogClose,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@rallly/ui/dialog";
-import { useRouter } from "next/navigation";
-
-import { DuplicateForm } from "@/app/[locale]/(optional-space)/poll/[urlId]/duplicate-form";
-import { Trans } from "@/components/trans";
-import { trpc } from "@/trpc/client";
-
-const formName = "duplicate-form";
-export function DuplicateDialog({
- pollId,
- pollTitle,
- ...props
-}: DialogProps & { pollId: string; pollTitle: string }) {
- const duplicate = trpc.polls.duplicate.useMutation();
- const posthog = usePostHog();
- const router = useRouter();
- return (
- <Dialog {...props}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>
- <Trans i18nKey="duplicate" />
- </DialogTitle>
- <DialogDescription>
- <Trans i18nKey="duplicateDescription" />
- </DialogDescription>
- </DialogHeader>
- <DuplicateForm
- name={formName}
- defaultValues={{
- title: pollTitle,
- }}
- onSubmit={(data) => {
- duplicate.mutate(
- { pollId, newTitle: data.title },
- {
- onSuccess: async (res) => {
- posthog?.capture("duplicate poll", {
- pollId,
- newPollId: res.id,
- });
- router.push(`/poll/${res.id}`);
- },
- },
- );
- }}
- />
- <DialogFooter>
- <DialogClose asChild>
- <Button>
- <Trans i18nKey="cancel" />
- </Button>
- </DialogClose>
- <Button
- type="submit"
- loading={duplicate.isPending}
- variant="primary"
- form={formName}
- >
- <Trans i18nKey="duplicate" />
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- );
-}
diff --git a/apps/web/src/app/api/stripe/webhook/handlers/checkout/index.ts b/apps/web/src/app/api/stripe/webhook/handlers/checkout/index.ts
deleted file mode 100644
index f8e656308..000000000
--- a/apps/web/src/app/api/stripe/webhook/handlers/checkout/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "./completed";
-export * from "./expired";
diff --git a/apps/web/src/app/api/stripe/webhook/handlers/customer-subscription/index.ts b/apps/web/src/app/api/stripe/webhook/handlers/customer-subscription/index.ts
deleted file mode 100644
index f0e3ec474..000000000
--- a/apps/web/src/app/api/stripe/webhook/handlers/customer-subscription/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from "./created";
-export * from "./deleted";
-export * from "./updated";
diff --git a/apps/web/src/app/components/page-tabs.tsx b/apps/web/src/app/components/page-tabs.tsx
deleted file mode 100644
index 0b49dbd4d..000000000
--- a/apps/web/src/app/components/page-tabs.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-"use client";
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@rallly/ui/page-tabs";
-import { useRouter, useSearchParams } from "next/navigation";
-import React from "react";
-
-export function PageTabs({
- children,
- value,
- name,
-}: {
- name: string;
- value?: string;
- children: React.ReactNode;
-}) {
- const searchParams = useSearchParams();
- const router = useRouter();
- const [tab, setTab] = React.useState(value);
- const handleTabChange = React.useCallback(
- (value: string) => {
- const params = new URLSearchParams(searchParams);
- params.set(name, value);
- params.delete("page");
- setTab(value);
-
- const newUrl = `?${params.toString()}`;
- router.replace(newUrl, { scroll: false });
- },
- [router, searchParams, name],
- );
-
- return (
- <Tabs className="group" value={tab} onValueChange={handleTabChange}>
- {children}
- </Tabs>
- );
-}
-export const PageTabsList = TabsList;
-export const PageTabsTrigger = TabsTrigger;
-
-export function PageTabsContent({
- value,
- children,
-}: {
- value: string;
- children: React.ReactNode;
-}) {
- return (
- <TabsContent
- tabIndex={-1}
- forceMount={true}
- key={value}
- className="transition-opacity data-[state=inactive]:pointer-events-none data-[state=inactive]:opacity-50 data-[state=inactive]:delay-200"
- value={value}
- >
- {children}
- </TabsContent>
- );
-}
diff --git a/apps/web/src/components/layouts/timeformat.tsx b/apps/web/src/components/layouts/timeformat.tsx
deleted file mode 100644
index 0946adfeb..000000000
--- a/apps/web/src/components/layouts/timeformat.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-"use client";
-
-import { Button } from "@rallly/ui/button";
-import { Icon } from "@rallly/ui/icon";
-import { ClockIcon } from "lucide-react";
-
-import { Trans } from "@/components/trans";
-import { usePreferences } from "@/contexts/preferences";
-import { useDayjs } from "@/utils/dayjs";
-
-export function TimeFormatControl() {
- const { timeFormat } = useDayjs();
- const { updatePreferences } = usePreferences();
-
- return (
- <Button
- variant="ghost"
- onClick={() => {
- if (timeFormat === "hours12") {
- updatePreferences({ timeFormat: "hours24" });
- } else {
- updatePreferences({ timeFormat: "hours12" });
- }
- }}
- >
- <Icon>
- <ClockIcon />
- </Icon>
- {timeFormat === "hours12" ? (
- <Trans i18nKey="12h" />
- ) : (
- <Trans i18nKey="24h" />
- )}
- </Button>
- );
-}
diff --git a/apps/web/src/components/layouts/timezone-control.tsx b/apps/web/src/components/layouts/timezone-control.tsx
deleted file mode 100644
index f27c4a206..000000000
--- a/apps/web/src/components/layouts/timezone-control.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-"use client";
-import { Button } from "@rallly/ui/button";
-import { CommandDialog } from "@rallly/ui/command";
-import { useDialog } from "@rallly/ui/dialog";
-import { Icon } from "@rallly/ui/icon";
-import { GlobeIcon } from "lucide-react";
-
-import { TimeZoneCommand } from "@/components/time-zone-picker/time-zone-select";
-import { usePreferences } from "@/contexts/preferences";
-import { useDayjs } from "@/utils/dayjs";
-
-export function TimezoneControl() {
- const { timeZone } = useDayjs();
- const { updatePreferences } = usePreferences();
- const dialog = useDialog();
- return (
- <>
- <Button
- variant="ghost"
- onClick={() => {
- dialog.trigger();
- }}
- >
- <Icon>
- <GlobeIcon />
- </Icon>
- {timeZone}
- </Button>
- <CommandDialog {...dialog.dialogProps}>
- <TimeZoneCommand
- value={timeZone}
- onSelect={(newTimeZone) => {
- dialog.dismiss();
- updatePreferences({ timeZone: newTimeZone });
- }}
- />
- </CommandDialog>
- </>
- );
-}
diff --git a/apps/web/src/components/modal/index.ts b/apps/web/src/components/modal/index.ts
deleted file mode 100644
index 12bed0a56..000000000
--- a/apps/web/src/components/modal/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { useModal } from "./use-modal";
diff --git a/apps/web/src/components/modal/use-modal.tsx b/apps/web/src/components/modal/use-modal.tsx
deleted file mode 100644
index d9dab0562..000000000
--- a/apps/web/src/components/modal/use-modal.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import React from "react";
-
-import type { ModalProps } from "./modal";
-import Modal from "./modal";
-
-type OpenModalFn = () => void;
-type CloseModalFn = () => void;
-
-export const useModal = (
- props?: ModalProps,
-): [React.ReactElement<ModalProps>, OpenModalFn, CloseModalFn] => {
- const [visible, setVisible] = React.useState(false);
- const modal = (
- <Modal
- {...props}
- visible={visible}
- onOk={() => {
- props?.onOk?.();
- setVisible(false);
- }}
- onCancel={() => {
- props?.onCancel?.();
- setVisible(false);
- }}
- />
- );
- return [modal, () => setVisible(true), () => setVisible(false)];
-};
diff --git a/apps/web/src/components/poll/guest-alert.tsx b/apps/web/src/components/poll/guest-alert.tsx
deleted file mode 100644
index e69de29bb..000000000
diff --git a/apps/web/src/components/poll/poll-viz.tsx b/apps/web/src/components/poll/poll-viz.tsx
deleted file mode 100644
index 5c6d14163..000000000
--- a/apps/web/src/components/poll/poll-viz.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-"use client";
-
-import React from "react";
-
-import DesktopPoll from "@/components/poll/desktop-poll";
-import MobilePoll from "@/components/poll/mobile-poll";
-
-const checkIfWideScreen = () => window.innerWidth > 640;
-
-export function PollViz() {
- React.useEffect(() => {
- const listener = () => setIsWideScreen(checkIfWideScreen());
-
- window.addEventListener("resize", listener);
-
- return () => {
- window.removeEventListener("resize", listener);
- };
- }, []);
-
- const [isWideScreen, setIsWideScreen] = React.useState(checkIfWideScreen);
- const PollComponent = isWideScreen ? DesktopPoll : MobilePoll;
-
- return <PollComponent />;
-}
diff --git a/apps/web/src/components/relative-date.tsx b/apps/web/src/components/relative-date.tsx
deleted file mode 100644
index efe23bc5d..000000000
--- a/apps/web/src/components/relative-date.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-"use client";
-
-import { dayjs } from "@/lib/dayjs";
-
-export function RelativeDate({ date }: { date: Date }) {
- return <>{dayjs(date).fromNow()}</>;
-}
diff --git a/apps/web/src/components/settings-group.tsx b/apps/web/src/components/settings-group.tsx
deleted file mode 100644
index feaf5c058..000000000
--- a/apps/web/src/components/settings-group.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-export function SettingsGroup({ children }: { children: React.ReactNode }) {
- return <div className="flex flex-col gap-6 lg:flex-row">{children}</div>;
-}
-
-export function SettingsGroupHeader({
- children,
-}: {
- children: React.ReactNode;
-}) {
- return <div className="lg:w-1/3">{children}</div>;
-}
-
-export function SettingsGroupTitle({
- children,
-}: {
- children: React.ReactNode;
-}) {
- return <h2 className="font-medium text-sm">{children}</h2>;
-}
-
-export function SettingsGroupDescription({
- children,
-}: {
- children: React.ReactNode;
-}) {
- return <p className="mt-1 text-muted-foreground text-sm">{children}</p>;
-}
-
-export function SettingsGroupContent({
- children,
-}: {
- children: React.ReactNode;
-}) {
- return <div className="flex-1">{children}</div>;
-}
diff --git a/apps/web/src/components/steps/index.ts b/apps/web/src/components/steps/index.ts
deleted file mode 100644
index 73a2deb0a..000000000
--- a/apps/web/src/components/steps/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from "./steps";
diff --git a/apps/web/src/components/steps/step.tsx b/apps/web/src/components/steps/step.tsx
deleted file mode 100644
index e816592e1..000000000
--- a/apps/web/src/components/steps/step.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import type React from "react";
-
-export interface StepProps {
- title: string;
- children?: React.ReactNode;
-}
-
-const Step: React.FunctionComponent<StepProps> = ({ title, children }) => {
- return (
- <div>
- <div>{title}</div>
- <div>{children}</div>
- </div>
- );
-};
-
-export default Step;
diff --git a/apps/web/src/components/steps/steps.tsx b/apps/web/src/components/steps/steps.tsx
deleted file mode 100644
index 6cd972176..000000000
--- a/apps/web/src/components/steps/steps.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { cn } from "@rallly/ui";
-import type React from "react";
-
-import { useTranslation } from "@/i18n/client";
-
-export interface StepsProps {
- current: number;
- total: number;
- className?: string;
-}
-
-const Steps: React.FunctionComponent<StepsProps> = ({
- current,
- total,
- className,
-}) => {
- const { t } = useTranslation();
-
- return (
- <div className={cn("inline-flex items-center gap-2.5", className)}>
- <div className="font-medium text-sm tracking-tight">
- {t("stepSummary", {
- current: current + 1,
- total,
- })}
- </div>
- <div className="flex items-center gap-2">
- {[...Array(total)].map((_, i) => {
- return (
- <span
- // biome-ignore lint/suspicious/noArrayIndexKey: Fix this later
- key={i}
- className={cn("h-2 w-2 rounded-full transition-all", {
- "bg-primary/70": i <= current,
- "bg-gray-300": i > current,
- "animate-pulse ring-4 ring-primary/30": i === current,
- })}
- />
- );
- })}
- </div>
- </div>
- );
-};
-
-export default Steps;
diff --git a/apps/web/src/components/table/table-column-header.tsx b/apps/web/src/components/table/table-column-header.tsx
deleted file mode 100644
index ec4ee908c..000000000
--- a/apps/web/src/components/table/table-column-header.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { cn } from "@rallly/ui";
-import { Icon } from "@rallly/ui/icon";
-import type { Column } from "@tanstack/react-table";
-import { ArrowDownIcon, ArrowUpIcon, ChevronsUpDownIcon } from "lucide-react";
-
-interface DataTableColumnHeaderProps<TData, TValue>
- extends React.HTMLAttributes<HTMLDivElement> {
- column: Column<TData, TValue>;
- title: string;
-}
-
-export function DataTableColumnHeader<TData, TValue>({
- column,
- title,
- className,
-}: DataTableColumnHeaderProps<TData, TValue>) {
- if (!column.getCanSort()) {
- return <div className={cn(className)}>{title}</div>;
- }
-
- return (
- <button
- type="button"
- className="flex w-full items-center gap-x-2.5"
- onClick={() => {
- column.toggleSorting();
- }}
- >
- <span>{title}</span>
- {column.getIsSorted() === "desc" ? (
- <Icon>
- <ArrowDownIcon />
- </Icon>
- ) : column.getIsSorted() === "asc" ? (
- <Icon>
- <ArrowUpIcon />
- </Icon>
- ) : (
- <Icon>
- <ChevronsUpDownIcon />
- </Icon>
- )}
- </button>
- );
-}
diff --git a/apps/web/src/components/user-avatar/gradients.ts b/apps/web/src/components/user-avatar/gradients.ts
deleted file mode 100644
index 4d3ae291b..000000000
--- a/apps/web/src/components/user-avatar/gradients.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import ColorHash from "color-hash";
-
-const colorHash = new ColorHash({ saturation: 1.0 });
-
-export const stringToColour = (s: string): string => colorHash.hex(s);
-
-export const generateColours = (s: string): [string, string] => {
- const s1 = s.substring(0, s.length / 2);
- const s2 = s.substring(s.length / 2);
- const c1 = stringToColour(s1);
- const c2 = stringToColour(s2);
-
- return [c1, c2];
-};
-
-export const generateSVG = (s: string, size = 256): string => {
- const [c1, c2] = generateColours(s);
-
- const svg = `
-<svg width="${size}" height="${size}" viewBox="0 0 ${size} ${size}" fill="none" xmlns="http://www.w3.org/2000/svg">
- <circle cx="${size / 2}" cy="${size / 2}" r="${
- size / 2
- }" fill="url(#gradient)" />
- <defs>
- <linearGradient id="gradient" x1="0" y1="0" x2="${size}" y2="${size}" gradientUnits="userSpaceOnUse">
- <stop stop-color="${c1}" />
- <stop offset="1" stop-color="${c2}" />
- </linearGradient>
- </defs>
-</svg>
- `.trim();
-
- return svg;
-};
diff --git a/apps/web/src/components/visibility-trigger.tsx b/apps/web/src/components/visibility-trigger.tsx
deleted file mode 100644
index 1ce3949e3..000000000
--- a/apps/web/src/components/visibility-trigger.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import React from "react";
-
-export function useVisibilityTrigger<T extends Element>(onVisible: () => void) {
- const triggerRef = React.useRef<T | null>(null);
-
- React.useEffect(() => {
- const currentTriggerRef = triggerRef.current;
- if (!currentTriggerRef) return;
-
- const observer = new IntersectionObserver(
- (entries) => {
- if (entries[0].isIntersecting) {
- onVisible();
- }
- },
- {
- root: null, // Use the viewport as the root
- rootMargin: "0px",
- threshold: 1.0, // Trigger when 100% of the element is visible
- },
- );
-
- observer.observe(currentTriggerRef);
-
- return () => {
- if (currentTriggerRef) {
- observer.unobserve(currentTriggerRef);
- }
- };
- }, [onVisible]);
-
- return triggerRef;
-}
-
-export function VisibilityTrigger({
- children,
- onVisible,
- className,
-}: {
- children: React.ReactNode;
- onVisible: () => void;
- className?: string;
-}) {
- const triggerRef = useVisibilityTrigger<HTMLDivElement>(onVisible);
-
- return (
- <div className={className} ref={triggerRef}>
- {children}
- </div>
- );
-}
diff --git a/apps/web/src/features/calendars/schema.ts b/apps/web/src/features/calendars/schema.ts
deleted file mode 100644
index 320d2c7d5..000000000
--- a/apps/web/src/features/calendars/schema.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import * as z from "zod";
-
-export const calendarProviderSchema = z.enum(["google", "microsoft"]);
-export type CalendarProvider = z.infer<typeof calendarProviderSchema>;
-
-export const calendarConnectionStatusSchema = z.enum([
- "active",
- "expired",
- "error",
- "revoked",
-]);
-
-export const timeSlotSchema = z.object({
- start: z.date(),
- end: z.date(),
- isBusy: z.boolean(),
- title: z.string().optional(),
-});
-
-export const availabilityRequestSchema = z.object({
- startTime: z.date(),
- endTime: z.date(),
- connectionIds: z.array(z.string()).optional(),
-});
-
-export const oauthTokensSchema = z.object({
- accessToken: z.string(),
- refreshToken: z.string().optional(),
- expiresAt: z.date().optional(),
- scopes: z.array(z.string()),
-});
-
-export const userInfoSchema = z.object({
- id: z.string(),
- email: z.string().email(),
- name: z.string().optional(),
-});
-
-export const calendarSchema = z.object({
- id: z.string(),
- name: z.string(),
- primary: z.boolean().optional(),
-});
-
-export const calendarEventSchema = z.object({
- id: z.string(),
- title: z.string(),
- start: z.date(),
- end: z.date(),
- isAllDay: z.boolean(),
- isBusy: z.boolean(),
-});
diff --git a/apps/web/src/features/instance-settings/client.tsx b/apps/web/src/features/instance-settings/client.tsx
deleted file mode 100644
index 852d709a0..000000000
--- a/apps/web/src/features/instance-settings/client.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-"use client";
-
-import React from "react";
-import type { InstanceSettings } from "./schema";
-
-const InstanceSettingsContext = React.createContext<InstanceSettings>({
- disableUserRegistration: false,
-});
-
-export function InstanceSettingsProvider({
- value,
- children,
-}: {
- value: InstanceSettings;
- children: React.ReactNode;
-}) {
- return (
- <InstanceSettingsContext.Provider value={value}>
- {children}
- </InstanceSettingsContext.Provider>
- );
-}
-
-export const useInstanceSettings = () =>
- React.useContext(InstanceSettingsContext);
diff --git a/apps/web/src/features/poll/analytics.ts b/apps/web/src/features/poll/analytics.ts
deleted file mode 100644
index 37b96af8b..000000000
--- a/apps/web/src/features/poll/analytics.ts
+++ /dev/null
@@ -1,179 +0,0 @@
-import type { PollStatus } from "@/features/poll/schema";
-
-// Base event data that all events share
-interface BaseEventData {
- userId: string;
- pollId: string;
- properties?: Record<string, unknown>;
-}
-
-export interface PollGroupProperties {
- name: string; // PostHog group name (same as title)
- title: string;
- status: PollStatus;
- is_guest: boolean;
- created_at: string;
- participant_count: number;
- hide_participants: boolean;
- require_participant_email: boolean;
- hide_scores: boolean;
- disable_comments: boolean;
- comment_count: number;
- option_count: number;
- has_location: boolean;
- has_description: boolean;
- timezone?: string;
-}
-
-// Discriminated union of all possible poll events
-export type PollEvent =
- | PollCreateEvent
- | PollUpdateDetailsEvent
- | PollUpdateOptionsEvent
- | PollUpdateSettingsEvent
- | PollDeleteEvent
- | PollScheduleEvent
- | PollReopenEvent
- | PollCloseEvent
- | PollWatchEvent
- | PollUnwatchEvent
- | PollResponseSubmitEvent
- | PollResponseUpdateEvent
- | PollResponseDeleteEvent
- | PollCommentAddEvent
- | PollCommentDeleteEvent
- | PollErrorEvent;
-
-// Poll events
-export interface PollCreateEvent extends BaseEventData {
- type: "poll_create";
- spaceId?: string;
- properties: {
- title: string;
- optionCount: number;
- hasLocation: boolean;
- hasDescription: boolean;
- timezone?: string;
- disableCommnets: boolean;
- hideScores: boolean;
- hideParticipants: boolean;
- requireParticipantEmail: boolean;
- isGuest: boolean;
- };
-}
-
-export interface PollUpdateDetailsEvent extends BaseEventData {
- type: "poll_update_details";
- properties: {
- title: string;
- hasDescription: boolean;
- hasLocation: boolean;
- isGuest: boolean;
- };
-}
-
-export interface PollUpdateOptionsEvent extends BaseEventData {
- type: "poll_update_options";
- properties: {
- optionCount: number;
- isGuest: boolean;
- };
-}
-
-export interface PollUpdateSettingsEvent extends BaseEventData {
- type: "poll_update_settings";
- properties: {
- hideScores: boolean;
- hideParticipants: boolean;
- disableComments: boolean;
- requireParticipantEmail: boolean;
- isGuest: boolean;
- };
-}
-
-export interface PollDeleteEvent extends BaseEventData {
- type: "poll_delete";
- properties?: {
- isGuest: boolean;
- };
-}
-
-export interface PollScheduleEvent extends BaseEventData {
- type: "poll_schedule";
- properties: {
- participantCount: number;
- attendeeCount: number;
- daysSinceCreated: number;
- };
-}
-
-export interface PollReopenEvent extends BaseEventData {
- type: "poll_reopen";
-}
-
-export interface PollCloseEvent extends BaseEventData {
- type: "poll_close";
- properties?: {
- isGuest: boolean;
- };
-}
-
-export interface PollWatchEvent extends BaseEventData {
- type: "poll_watch";
-}
-
-export interface PollUnwatchEvent extends BaseEventData {
- type: "poll_unwatch";
-}
-
-export interface PollResponseSubmitEvent extends BaseEventData {
- type: "poll_response_submit";
- properties: {
- participantId: string;
- hasEmail: boolean;
- totalResponses: number;
- isCreator: boolean;
- isGuest: boolean;
- };
-}
-
-export interface PollResponseUpdateEvent extends BaseEventData {
- type: "poll_response_update";
- properties: {
- participantId: string;
- };
-}
-
-export interface PollResponseDeleteEvent extends BaseEventData {
- type: "poll_response_delete";
- properties: {
- participantId: string;
- };
-}
-
-// Poll comment events
-export interface PollCommentAddEvent extends BaseEventData {
- type: "poll_comment_add";
- properties: {
- commentId: string;
- isGuest: boolean;
- };
-}
-
-export interface PollCommentDeleteEvent extends BaseEventData {
- type: "poll_comment_delete";
- properties: {
- commentId: string;
- };
-}
-
-// Error events
-export interface PollErrorEvent extends BaseEventData {
- type: "poll_error";
- properties: {
- operation: string;
- errorMessage: string;
- errorCode?: string;
- errorStatus?: number;
- };
-}
diff --git a/apps/web/src/features/scheduled-event/components/scheduled-event-status-badge.tsx b/apps/web/src/features/scheduled-event/components/scheduled-event-status-badge.tsx
deleted file mode 100644
index 7c70a4313..000000000
--- a/apps/web/src/features/scheduled-event/components/scheduled-event-status-badge.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Badge } from "@rallly/ui/badge";
-
-import { Trans } from "@/components/trans";
-import type { Status } from "@/features/scheduled-event/schema";
-
-export function ScheduledEventStatusBadge({ status }: { status: Status }) {
- switch (status) {
- case "past":
- return (
- <Badge>
- <Trans i18nKey="past" defaults="Past" />
- </Badge>
- );
- case "upcoming":
- return null;
- case "canceled":
- return (
- <Badge>
- <Trans i18nKey="canceled" defaults="Canceled" />
- </Badge>
- );
- case "unconfirmed":
- return (
- <Badge>
- <Trans i18nKey="unconfirmed" defaults="Unconfirmed" />
- </Badge>
- );
- }
-}
diff --git a/apps/web/src/features/space/member/schema.ts b/apps/web/src/features/space/member/schema.ts
deleted file mode 100644
index c6263afd3..000000000
--- a/apps/web/src/features/space/member/schema.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import * as z from "zod";
-
-export const memberRoleSchema = z.enum(["member", "admin"]);
-export type MemberRole = z.infer<typeof memberRoleSchema>;
diff --git a/apps/web/src/global-error.tsx b/apps/web/src/global-error.tsx
deleted file mode 100644
index 3a040bef0..000000000
--- a/apps/web/src/global-error.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-"use client";
-
-import * as Sentry from "@sentry/nextjs";
-import NextError from "next/error";
-import React from "react";
-
-export default function GlobalError({
- error,
-}: {
- error: Error & { digest?: string };
-}) {
- React.useEffect(() => {
- Sentry.captureException(error);
- }, [error]);
-
- return (
- <html lang="en">
- <body>
- {/* `NextError` is the default Next.js error page component. Its type
- definition requires a `statusCode` prop. However, since the App Router
- does not expose status codes for errors, we simply pass 0 to render a
- generic error message. */}
- <NextError statusCode={0} />
- </body>
- </html>
- );
-}
diff --git a/apps/web/src/globals.css b/apps/web/src/globals.css
deleted file mode 100644
index c6fa7dc55..000000000
--- a/apps/web/src/globals.css
+++ /dev/null
@@ -1,4 +0,0 @@
-@import "tailwindcss";
-@import "@rallly/tailwind-config";
-
-/* Any app specific overrides will go here */
diff --git a/apps/web/src/lib/oauth/client.tsx b/apps/web/src/lib/oauth/client.tsx
deleted file mode 100644
index 6bcebde60..000000000
--- a/apps/web/src/lib/oauth/client.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-"use client";
-
-export function connect(provider: string) {
- const url = new URL(
- `/api/integrations/auth/${provider}`,
- window.location.origin,
- );
- url.searchParams.set("redirect", window.location.pathname);
- window.location.href = url.toString();
-}
diff --git a/apps/web/src/lib/timezone/client/calendar-date.tsx b/apps/web/src/lib/timezone/client/calendar-date.tsx
deleted file mode 100644
index 78a0c8881..000000000
--- a/apps/web/src/lib/timezone/client/calendar-date.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-"use client";
-
-import { useTranslation } from "@/i18n/client";
-import { dayjs } from "@/lib/dayjs";
-import { useTimezone } from "@/lib/timezone/client/context";
-
-export function CalendarDate({ date }: { date: string }) {
- const { timezone } = useTimezone();
-
- const { t } = useTranslation();
- return (
- <time dateTime={dayjs(date).toISOString()}>
- {dayjs(date)
- .tz(timezone)
- .calendar(null, {
- sameDay: `[${t("today", { defaultValue: "Today" })}]`,
- nextDay: `[${t("tomorrow", { defaultValue: "Tomorrow" })}]`,
- nextWeek: "dddd",
- lastDay: `[${t("yesterday", { defaultValue: "Yesterday" })}]`,
- lastWeek: `[${t("lastWeek", { defaultValue: "Last Week" })}]`,
- sameElse: "DD MMM YYYY",
- })}
- </time>
- );
-}
diff --git a/apps/web/src/lib/timezone/formatted-date-time-server.tsx b/apps/web/src/lib/timezone/formatted-date-time-server.tsx
deleted file mode 100644
index e8e121fb7..000000000
--- a/apps/web/src/lib/timezone/formatted-date-time-server.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import { cn } from "@rallly/ui";
-import type { ConfigType } from "dayjs";
-import type * as React from "react";
-
-import { dayjs } from "@/lib/dayjs";
-
-interface FormattedDateTimeServerProps
- extends Omit<React.HTMLAttributes<HTMLTimeElement>, "dateTime"> {
- /** The date/time to format (Accepts Date, ISO string, Unix timestamp, Dayjs object). */
- date: ConfigType | null | undefined;
- /** The IANA timezone string to use for formatting. Required for server component. */
- timezone: string;
- /** A dayjs format string (e.g., "YYYY-MM-DD HH:mm", "h:mm A"). Defaults to a locale-aware format. */
- format?: string;
- /** If true, formats the time without applying the context timezone. Defaults to false. */
- floating?: boolean;
- /** Optional locale string (e.g., "en-US", "fr-FR"). Defaults to browser/system locale if applicable on server, otherwise server default. */
- locale?: string;
-}
-
-/**
- * Server Component to render a formatted date/time string based on a provided timezone.
- *
- * Does NOT use React Context.
- */
-export const FormattedDateTimeServer = ({
- date,
- timezone,
- format,
- floating = false,
- locale,
- className,
- ...props
-}: FormattedDateTimeServerProps) => {
- if (!date) {
- return null; // Return null for invalid dates
- }
-
- let dayjsInstance = dayjs(date);
-
- // Apply locale if provided
- if (locale) {
- dayjsInstance = dayjsInstance.locale(locale);
- }
-
- // Apply timezone unless floating is true
- if (!floating) {
- try {
- dayjsInstance = dayjsInstance.tz(timezone);
- } catch (error) {
- console.warn(
- `FormattedDateTimeServer: Invalid timezone provided: "${timezone}". Falling back.`,
- error,
- );
- // Fallback or default behavior if timezone is invalid
- // Might default to UTC or system time depending on Dayjs config
- }
- } else {
- // Standardize floating times to UTC before formatting without tz
- dayjsInstance = dayjsInstance.utc();
- }
-
- // Determine the format string
- const defaultFormat = floating ? "LT" : "LLLL"; // LT for floating, LLLL for timezone-aware
- const formatString = format ?? defaultFormat;
-
- const formattedDate = dayjsInstance.format(formatString);
- // Provide machine-readable dateTime attribute, usually in ISO format
- const machineReadableDate = dayjs(date).toISOString();
-
- return (
- <time dateTime={machineReadableDate} className={cn(className)} {...props}>
- {formattedDate}
- </time>
- );
-};
diff --git a/apps/web/src/lib/timezone/index.ts b/apps/web/src/lib/timezone/index.ts
deleted file mode 100644
index 512fc980c..000000000
--- a/apps/web/src/lib/timezone/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "./client/context";
-export * from "./utils";
diff --git a/apps/web/src/lib/timezone/utils.ts b/apps/web/src/lib/timezone/utils.ts
deleted file mode 100644
index 61e83d09d..000000000
--- a/apps/web/src/lib/timezone/utils.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-import { dayjs } from "@/lib/dayjs";
-
-/**
- * Get the browser's timezone
- */
-export const getBrowserTimezone = (): string => {
- if (typeof window !== "undefined") {
- return Intl.DateTimeFormat().resolvedOptions().timeZone;
- }
- return "UTC";
-};
-
-/**
- * Get a list of all available timezones
- */
-export const getAllTimezones = (): string[] => {
- // This is a simplified list - in a real implementation, you might want to use a more comprehensive list
- return [
- "UTC",
- "Africa/Cairo",
- "Africa/Johannesburg",
- "Africa/Lagos",
- "America/Anchorage",
- "America/Bogota",
- "America/Chicago",
- "America/Denver",
- "America/Los_Angeles",
- "America/Mexico_City",
- "America/New_York",
- "America/Phoenix",
- "America/Sao_Paulo",
- "America/Toronto",
- "Asia/Bangkok",
- "Asia/Dubai",
- "Asia/Hong_Kong",
- "Asia/Jakarta",
- "Asia/Kolkata",
- "Asia/Seoul",
- "Asia/Shanghai",
- "Asia/Singapore",
- "Asia/Tokyo",
- "Australia/Melbourne",
- "Australia/Perth",
- "Australia/Sydney",
- "Europe/Amsterdam",
- "Europe/Berlin",
- "Europe/Istanbul",
- "Europe/London",
- "Europe/Madrid",
- "Europe/Moscow",
- "Europe/Paris",
- "Europe/Rome",
- "Pacific/Auckland",
- "Pacific/Honolulu",
- ];
-};
-
-/**
- * Convert a date from one timezone to another
- */
-export const convertTimezone = (
- date: string | Date | dayjs.Dayjs,
- fromTimezone: string,
- toTimezone: string,
-): dayjs.Dayjs => {
- return dayjs(date).tz(fromTimezone).tz(toTimezone);
-};
-
-/**
- * Format a date for display with timezone
- */
-export const formatWithTimezone = (
- date: string | Date | dayjs.Dayjs,
- timezone: string,
- format: string,
-): string => {
- return dayjs(date).tz(timezone).format(format);
-};
-
-/**
- * Get the timezone offset as a string (e.g., "UTC+1:00")
- */
-export const getTimezoneOffset = (timezone: string): string => {
- const offset = dayjs().tz(timezone).format("Z");
- return `UTC${offset}`;
-};
-
-/**
- * Group timezones by offset
- */
-export const groupTimezonesByOffset = (): Record<string, string[]> => {
- const timezones = getAllTimezones();
- const grouped: Record<string, string[]> = {};
-
- timezones.forEach((tz) => {
- const offset = dayjs().tz(tz).format("Z");
- if (!grouped[offset]) {
- grouped[offset] = [];
- }
- grouped[offset].push(tz);
- });
-
- return grouped;
-};
diff --git a/apps/web/src/utils/api-auth.ts b/apps/web/src/utils/api-auth.ts
deleted file mode 100644
index 9927262b0..000000000
--- a/apps/web/src/utils/api-auth.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { headers } from "next/headers";
-import { NextResponse } from "next/server";
-
-/**
- * Checks if the request is authorized using the cron secret for Vercel cron jobs
- * @returns A NextResponse with 401 status if unauthorized, or null if authorized
- */
-export async function checkApiAuthorization() {
- const headersList = await headers();
- const authorization = headersList.get("authorization");
-
- if (authorization !== `Bearer ${process.env.CRON_SECRET}`) {
- return NextResponse.json(
- { success: false, message: "Unauthorized" },
- { status: 401 },
- );
- }
-
- return null;
-}
diff --git a/apps/web/src/utils/color-hash.ts b/apps/web/src/utils/color-hash.ts
deleted file mode 100644
index 023a7a418..000000000
--- a/apps/web/src/utils/color-hash.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import ColorHash from "color-hash";
-
-export const colorHash = new ColorHash({
- hue: [{ min: 220, max: 320 }],
- lightness: [0.65],
- saturation: 0.8,
-});
-
-export const generateGradient = (s: string): string => {
- const s1 = s.substring(0, s.length / 2);
- const s2 = s.substring(s.length / 2);
- const c1 = colorHash.hex(s1);
- const c2 = colorHash.hex(s2);
-
- return `linear-gradient(45deg, ${c1}, ${c2})`;
-};
diff --git a/apps/web/src/utils/cookies.ts b/apps/web/src/utils/cookies.ts
deleted file mode 100644
index 7a90a4277..000000000
--- a/apps/web/src/utils/cookies.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import Cookies from "js-cookie";
-
-export function setCookie(key: string, value: string) {
- Cookies.set(key, value);
-}
-
-export function popCookie(key: string) {
- const value = Cookies.get(key);
- Cookies.remove(key);
- return value;
-}
diff --git a/apps/web/src/utils/next.ts b/apps/web/src/utils/next.ts
deleted file mode 100644
index 496e95705..000000000
--- a/apps/web/src/utils/next.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { NextApiHandler } from "next";
-
-export function composeApiHandlers(...fns: NextApiHandler[]): NextApiHandler {
- return async (req, res) => {
- for (const fn of fns) {
- await fn(req, res);
- if (res.writableEnded) {
- return;
- }
- }
- };
-}
diff --git a/apps/web/src/utils/selectors.ts b/apps/web/src/utils/selectors.ts
deleted file mode 100644
index 01309d761..000000000
--- a/apps/web/src/utils/selectors.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export const getPortal = () => {
- const el = document.getElementById("portal");
- if (el === null) {
- throw new Error("Portal element not found");
- }
- return el;
-};
diff --git a/apps/web/src/utils/try-catch.ts b/apps/web/src/utils/try-catch.ts
deleted file mode 100644
index b61e7e57a..000000000
--- a/apps/web/src/utils/try-catch.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-// Types for the result object with discriminated union
-type Success<T> = {
- data: T;
- error: null;
-};
-
-type Failure<E> = {
- data: null;
- error: E;
-};
-
-export type Result<T, E = Error> = Success<T> | Failure<E>;
-
-// Main wrapper function
-export async function tryCatch<T, E = Error>(
- promise: Promise<T>,
-): Promise<Result<T, E>> {
- try {
- const data = await promise;
- return { data, error: null };
- } catch (error) {
- return { data: null, error: error as E };
- }
-}