🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Update Footer and AppSidebar components for improved user experience
Bill Yangabe4dc82635e
diff --git a/client/src/app/components/Footer.tsx b/client/src/app/components/Footer.tsxindex adaf71290..948e2e623 100644--- a/client/src/app/components/Footer.tsx+++ b/client/src/app/components/Footer.tsx@@ -108,7 +108,7 @@ export function Footer() {rel="noopener noreferrer"className="text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-white transition-colors">- Community+ Discord</a></li><li>diff --git a/client/src/components/AppSidebar.tsx b/client/src/components/AppSidebar.tsxindex 8c85b50da..3c1be1a39 100644--- a/client/src/components/AppSidebar.tsx+++ b/client/src/components/AppSidebar.tsx@@ -1,6 +1,6 @@"use client";-import { BarChart, BookOpen, Building2, HomeIcon, LogOut, Settings, ShieldUser, User } from "lucide-react";+import { BarChart, BookOpen, Building2, HomeIcon, LogOut, Settings, ShieldUser, User, HelpCircle, Lightbulb } from "lucide-react";import Link from "next/link";import { usePathname } from "next/navigation";import { Suspense, useState } from "react";@@ -12,6 +12,7 @@ import { RybbitLogo } from "./RybbitLogo";import { ThemeSwitcher } from "./ThemeSwitcher";import { authClient } from "../lib/auth";import { useSignout } from "../hooks/useSignout";+import { useStripeSubscription } from "../lib/subscription/useStripeSubscription";function AdminLink({ isExpanded }: { isExpanded: boolean }) {const pathname = usePathname();@@ -36,12 +37,14 @@ function AppSidebarContent() {const embed = useEmbedablePage();const signout = useSignout();+ const { data: subscription } = useStripeSubscription();+if (embed) return null;return (<divclassName={cn(- "flex flex-col items-start justify-between h-dvh p-2 py-3 bg-neutral-50 dark:bg-neutral-900 border-r border-neutral-200 dark:border-neutral-850 gap-3 transition-all duration-1s00",+ "flex flex-col items-start justify-between h-dvh p-2 py-3 bg-neutral-50 dark:bg-neutral-900 border-r border-neutral-200 dark:border-neutral-850 gap-3 transition-all duration-200",isExpanded ? "w-44" : "w-[45px]")}onMouseEnter={() => setIsExpanded(true)}@@ -68,6 +71,26 @@ function AppSidebarContent() {active={false}expanded={isExpanded}/>+ {+ IS_CLOUD && subscription?.status === "active" && <SidebarLink+ href="https://rybbit.featurebase.app"+ icon={<Lightbulb className="w-5 h-5" />}+ label="Feedback"+ target="_blank"+ active={false}+ expanded={isExpanded}+ />+ }+ {+ IS_CLOUD && subscription?.status === "active" && <SidebarLink+ href="mailto:[email protected]"+ icon={<HelpCircle className="w-5 h-5" />}+ label="Email Support"+ target="_blank"+ active={false}+ expanded={isExpanded}+ />+ }{/* <SidebarLinkhref="/uptime/monitors"icon={<SquareActivity className="w-5 h-5" />}diff --git a/docs/src/components/Footer.tsx b/docs/src/components/Footer.tsxindex ce70779bb..7fce4e718 100644--- a/docs/src/components/Footer.tsx+++ b/docs/src/components/Footer.tsx@@ -11,8 +11,8 @@ export function Footer() {<div className="space-y-4"><Image src="/rybbit-text.svg" alt="Rybbit" width={120} height={0} style={{ height: "auto" }}className="dark:invert-0 invert"-- />++ />{/* <p className="text-sm text-neutral-400 max-w-xs">Open source, privacy-focused web analytics platform that respectsuser privacy.@@ -172,9 +172,14 @@ export function Footer() {</Link></li><li>- <Link href="https://ipapi.is/" className="text-neutral-500 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white transition-colors">- Geolocation by ipapi.is- </Link>+ <a+ href="https://rybbit.featurebase.app/"+ target="_blank"+ rel="noopener noreferrer"+ className="text-neutral-500 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white transition-colors"+ >+ Feedback+ </a></li><li><Link href="/oss-friends" className="text-neutral-500 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-white transition-colors">diff --git a/server/src/services/tracker/trackEvent.ts b/server/src/services/tracker/trackEvent.tsindex 65ccfef7d..e3f469553 100644--- a/server/src/services/tracker/trackEvent.ts+++ b/server/src/services/tracker/trackEvent.ts@@ -256,7 +256,7 @@ export async function trackEvent(request: FastifyRequest, reply: FastifyReply) {// Get the site configuration to get the numeric siteIdconst siteConfiguration = await siteConfig.getConfig(validatedPayload.site_id);if (!siteConfiguration) {- // logger.warn({ siteId: validatedPayload.site_id }, "Site not found");+ logger.warn({ siteId: validatedPayload.site_id }, "Site not found");return reply.status(404).send({success: false,error: "Site not found",@@ -271,7 +271,7 @@ export async function trackEvent(request: FastifyRequest, reply: FastifyReply) {// Use custom user agent if provided, otherwise fall back to headerconst userAgent = validatedPayload.user_agent || (request.headers["user-agent"] as string);if (userAgent && isbot(userAgent)) {- // logger.info({ siteId: validatedPayload.site_id, userAgent }, "Bot request filtered");+ logger.info({ siteId: validatedPayload.site_id, userAgent }, "Bot request filtered");return reply.status(200).send({success: true,message: "Event not tracked - bot detected",@@ -281,7 +281,7 @@ export async function trackEvent(request: FastifyRequest, reply: FastifyReply) {// Check if the site has exceeded its monthly limit (using numeric siteId)if (usageService.isSiteOverLimit(siteConfiguration.siteId)) {- // logger.info({ siteId: validatedPayload.site_id }, "Skipping event - site over monthly limit");+ logger.info({ siteId: validatedPayload.site_id }, "Skipping event - site over monthly limit");return reply.status(200).send("Site over monthly limit, event not tracked");}@@ -292,7 +292,7 @@ export async function trackEvent(request: FastifyRequest, reply: FastifyReply) {if (siteConfiguration.excludedIPs && siteConfiguration.excludedIPs.length > 0) {const isExcluded = await siteConfig.isIPExcluded(requestIP, validatedPayload.site_id);if (isExcluded) {- // logger.info({ siteId: validatedPayload.site_id, ip: requestIP }, "IP excluded from tracking");+ logger.info({ siteId: validatedPayload.site_id, ip: requestIP }, "IP excluded from tracking");return reply.status(200).send({success: true,message: "Event not tracked - IP excluded",