diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..70c0e34 --- /dev/null +++ b/.env.example @@ -0,0 +1,7 @@ +POSTGRES_USER="" +POSTGRES_PASSWORD="" +POSTGRES_DB="" +POSTGRES_HOST="" +POSTGRES_PORT= + +YOUTUBE_API_KEY="" \ No newline at end of file diff --git a/.github/workflows/lockb.yml b/.github/workflows/lockb.yml index 516d992..05ebba3 100644 --- a/.github/workflows/lockb.yml +++ b/.github/workflows/lockb.yml @@ -7,8 +7,6 @@ on: paths: - "**/package.json" - "**/bun.lockb" - pull_request: - types: [opened, reopened, synchronize] permissions: contents: write diff --git a/.gitignore b/.gitignore index 9104d93..5384f8e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,7 @@ next-env.d.ts # server *.sql *.db -.env \ No newline at end of file +.env + +# million +.million \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index c3a21af..8e0b12b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/icons.tsx b/components/icons.tsx index e2a6989..59bfe35 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -3,212 +3,212 @@ import * as React from "react"; import { IconSvgProps } from "@/types"; export const Logo: React.FC = ({ - size = 36, - height, - ...props + size = 36, + height, + ...props }) => ( - - - + + + ); export const DiscordIcon: React.FC = ({ - size = 24, - width, - height, - ...props + size = 24, + width, + height, + ...props }) => { - return ( - - - - ); + return ( + + + + ); }; export const TwitterIcon: React.FC = ({ - size = 24, - width, - height, - ...props + size = 24, + width, + height, + ...props }) => { - return ( - - - - ); + return ( + + + + ); }; export const GithubIcon: React.FC = ({ - size = 24, - width, - height, - ...props + size = 24, + width, + height, + ...props }) => { - return ( - - - - ); + return ( + + + + ); }; export const MoonFilledIcon = ({ - size = 24, - width, - height, - ...props + size = 24, + width, + height, + ...props }: IconSvgProps) => ( - + ); export const SunFilledIcon = ({ - size = 24, - width, - height, - ...props + size = 24, + width, + height, + ...props }: IconSvgProps) => ( - + ); export const HeartFilledIcon = ({ - size = 24, - width, - height, - ...props + size = 24, + width, + height, + ...props }: IconSvgProps) => ( - + ); export const SearchIcon = (props: IconSvgProps) => ( - + ); export const NextUILogo: React.FC = (props) => { - const { width, height = 40 } = props; + const { width, height = 40 } = props; - return ( - - - - - - ); + return ( + + + + + + ); }; diff --git a/components/primitives.ts b/components/primitives.ts index 472973c..8fe6f52 100644 --- a/components/primitives.ts +++ b/components/primitives.ts @@ -1,53 +1,53 @@ import { tv } from "tailwind-variants"; export const title = tv({ - base: "tracking-tight inline font-semibold", - variants: { - color: { - violet: "from-[#FF1CF7] to-[#b249f8]", - yellow: "from-[#FF705B] to-[#FFB457]", - blue: "from-[#5EA2EF] to-[#0072F5]", - cyan: "from-[#00b7fa] to-[#01cfea]", - green: "from-[#6FEE8D] to-[#17c964]", - pink: "from-[#FF72E1] to-[#F54C7A]", - foreground: "dark:from-[#FFFFFF] dark:to-[#4B4B4B]", + base: "tracking-tight inline font-semibold", + variants: { + color: { + violet: "from-[#FF1CF7] to-[#b249f8]", + yellow: "from-[#FF705B] to-[#FFB457]", + blue: "from-[#5EA2EF] to-[#0072F5]", + cyan: "from-[#00b7fa] to-[#01cfea]", + green: "from-[#6FEE8D] to-[#17c964]", + pink: "from-[#FF72E1] to-[#F54C7A]", + foreground: "dark:from-[#FFFFFF] dark:to-[#4B4B4B]", + }, + size: { + sm: "text-3xl lg:text-4xl", + md: "text-[2.3rem] lg:text-5xl leading-9", + lg: "text-4xl lg:text-6xl", + }, + fullWidth: { + true: "w-full block", + }, }, - size: { - sm: "text-3xl lg:text-4xl", - md: "text-[2.3rem] lg:text-5xl leading-9", - lg: "text-4xl lg:text-6xl", + defaultVariants: { + size: "md", }, - fullWidth: { - true: "w-full block", - }, - }, - defaultVariants: { - size: "md", - }, - compoundVariants: [ - { - color: [ - "violet", - "yellow", - "blue", - "cyan", - "green", - "pink", - "foreground", - ], - class: "bg-clip-text text-transparent bg-gradient-to-b", - }, - ], + compoundVariants: [ + { + color: [ + "violet", + "yellow", + "blue", + "cyan", + "green", + "pink", + "foreground", + ], + class: "bg-clip-text text-transparent bg-gradient-to-b", + }, + ], }); export const subtitle = tv({ - base: "w-full md:w-1/2 my-2 text-lg lg:text-xl text-default-600 block max-w-full", - variants: { - fullWidth: { - true: "!w-full", + base: "w-full md:w-1/2 my-2 text-lg lg:text-xl text-default-600 block max-w-full", + variants: { + fullWidth: { + true: "!w-full", + }, + }, + defaultVariants: { + fullWidth: true, }, - }, - defaultVariants: { - fullWidth: true, - }, }); diff --git a/components/theme-switch.tsx b/components/theme-switch.tsx index 622c433..068f7aa 100644 --- a/components/theme-switch.tsx +++ b/components/theme-switch.tsx @@ -7,80 +7,82 @@ import clsx from "clsx"; import { SunFilledIcon, MoonFilledIcon } from "@/components/icons"; export interface ThemeSwitchProps { - className?: string; - classNames?: SwitchProps["classNames"]; + className?: string; + classNames?: SwitchProps["classNames"]; } export const ThemeSwitch: FC = ({ - className, - classNames, + className, + classNames, }) => { - const [isMounted, setIsMounted] = useState(false); + const [isMounted, setIsMounted] = useState(false); - const { theme, setTheme } = useTheme(); + const { theme, setTheme } = useTheme(); - const onChange = () => { - theme === "light" ? setTheme("dark") : setTheme("light"); - }; + const onChange = () => { + theme === "light" ? setTheme("dark") : setTheme("light"); + }; - const { - Component, - slots, - isSelected, - getBaseProps, - getInputProps, - getWrapperProps, - } = useSwitch({ - isSelected: theme === "light", - onChange, - }); + const { + Component, + slots, + isSelected, + getBaseProps, + getInputProps, + getWrapperProps, + } = useSwitch({ + isSelected: theme === "light", + onChange, + }); - useEffect(() => { - setIsMounted(true); - }, [isMounted]); + useEffect(() => { + setIsMounted(true); + }, [isMounted]); - // Prevent Hydration Mismatch - if (!isMounted) return
; + // Prevent Hydration Mismatch + if (!isMounted) return
; - return ( - - - - -
- {isSelected ? ( - - ) : ( - - )} -
-
- ); + return ( + + + + +
+ {isSelected ? ( + + ) : ( + + )} +
+
+ ); }; diff --git a/config/fonts.ts b/config/fonts.ts index 0e7d9c9..120c402 100644 --- a/config/fonts.ts +++ b/config/fonts.ts @@ -1,11 +1,11 @@ import { Fira_Code as FontMono, Inter as FontSans } from "next/font/google"; export const fontSans = FontSans({ - subsets: ["latin"], - variable: "--font-sans", + subsets: ["latin"], + variable: "--font-sans", }); export const fontMono = FontMono({ - subsets: ["latin"], - variable: "--font-mono", + subsets: ["latin"], + variable: "--font-mono", }); diff --git a/config/site.ts b/config/site.ts index f559f7e..d90f045 100644 --- a/config/site.ts +++ b/config/site.ts @@ -2,8 +2,7 @@ export type SiteConfig = typeof siteConfig; export const siteConfig = { name: "JSALStats", - description: - "Make beautiful websites regardless of your design experience.", + description: "The home of YouTube analytics for JackSucksAtLife!", navItems: [ { label: "Home", diff --git a/next.config.js b/next.config.js index dcc13ca..e3ac8ec 100644 --- a/next.config.js +++ b/next.config.js @@ -1,24 +1,44 @@ +const MillionLint = require("@million/lint"); /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, images: { remotePatterns: [ { - protocol: 'https', - hostname: '**', - port: '', - pathname: '**', + protocol: "https", + hostname: "**", + port: "", + pathname: "**", }, ], }, async rewrites() { return [ { - source: '/sitemap.xml', - destination: '/api/sitemap', + source: "/sitemap.xml", + destination: "/api/sitemap", + }, + ]; + }, + async headers() { + return [ + { + source: "/(.*)", + headers: [ + { + key: "Access-Control-Allow-Origin", + value: "*", + }, + { + key: "Access-Control-Allow-Methods", + value: "GET", + }, + ], }, ]; }, }; -module.exports = nextConfig; +module.exports = MillionLint.next({ + enabled: true, +})(nextConfig); diff --git a/package.json b/package.json index 4805f6a..f325a93 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,12 @@ "scripts": { "dev": "concurrently 'next dev --turbo --port 5815' 'bun --watch ./server/index.ts'", "build": "next build", - "start:site": "next start --port 5815", + "start:site": "next start --port 5818", "start:server": "bun ./server/index.ts", "lint": "eslint . --ext .ts,.tsx -c .eslintrc.json --fix" }, "dependencies": { + "@million/lint": "^1.0.13", "@nextui-org/button": "2.0.38", "@nextui-org/code": "2.0.33", "@nextui-org/input": "2.2.5", diff --git a/pages/404.tsx b/pages/404.tsx index 85f357d..f27d329 100644 --- a/pages/404.tsx +++ b/pages/404.tsx @@ -19,7 +19,6 @@ export default function IndexPage() {
+ {/*