This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI, Tailwind, tRPC, better-auth, Drizzle ORM with PostgreSQL, and Biome. | |
<architecture> | |
1. Always leverage the Next.js App Router pattern, separating server and client components | |
2. Implement route groups (folders in parentheses) for logical organization | |
3. Use route handlers for API functionality with proper HTTP methods | |
4. Structure projects with clean separation between UI, data fetching, and business logic | |
5. Implement parallel routes and intercepting routes for advanced UI patterns when appropriate | |
</architecture> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /app/api/[...trpc]/route.ts | |
/** | |
"trpc-openapi": "^1.2.0", | |
"@trpc/client": "next", | |
"@trpc/next": "next", | |
"@trpc/react-query": "next", | |
"@trpc/server": "next", | |
**/ | |
import { createOpenApiNextHandler } from "trpc-openapi"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch'); | |
const jsonexport = require('jsonexport'); | |
const fs = require('fs').promises; | |
const path = require('path'); | |
const API_URL = process.env.API_URL; | |
const EMAIL = process.env.EMAIL; | |
const PASSWORD = process.env.PASSWORD; | |
const OUTPUT_PATH = process.env.OUTPUT_PATH; | |
const NAME = process.env.NAME; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const useGsapContext = ( | |
func: gsap.ContextFunc, | |
deps: any[] = [], | |
target?: any, | |
) => { | |
useEffect(() => { | |
const ctx = gsap.context(func, target) | |
return () => ctx?.revert() | |
}, deps) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Export Toggl Entries to CSV | |
import "@johnlindquist/kit"; | |
const jsonexport = await npm("jsonexport"); | |
const API_URL = await env("API_URL"); | |
const EMAIL = await env("EMAIL"); | |
const PASSWORD = await env("PASSWORD"); | |
const OUTPUT_PATH = await env("OUTPUT_PATH"); | |
const NAME = await env("NAME"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Provider } from "next-auth/providers"; | |
export const FigmaProvider: Provider = { | |
id: "figma", | |
name: "Figma", | |
type: "oauth", | |
authorization: { | |
url: "https://www.figma.com/oauth", | |
params: { | |
scope: "file_read", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 5-minute-cron | |
on: | |
schedule: | |
- cron: "*/5 * * * *" | |
jobs: | |
cron: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Call the sync API endpoint on Vercel | |
run: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const theme = (() => { | |
let theme = 'light' | |
if (typeof localStorage !== 'undefined' && localStorage.getItem('theme')) { | |
theme = localStorage.getItem('theme') | |
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) { | |
theme = 'dark' | |
} | |
window.localStorage.setItem('theme', theme) | |
return theme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NextSeo } from "next-seo"; | |
import Head from "next/head"; | |
import { useRouter } from "next/router"; | |
type IMetaProps = { | |
title: string; | |
description: string; | |
image?: string; | |
canonical?: string; | |
}; |