diff --git a/.env.example b/.env.example index 14c3169c..0b30b1fc 100644 --- a/.env.example +++ b/.env.example @@ -11,9 +11,9 @@ NEXT_PUBLIC_CLERK_SIGN_UP_URL='/sign-up' NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL='/app' NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL='/app' -# Upstash Redis -UPSTASH_REDIS_REST_URL= -UPSTASH_REDIS_REST_TOKEN= +# Redis URL +# Example: redis://localhost:6379 +REDIS_URL= # Resend RESEND_API_KEY= diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index d05cddac..f37df405 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -25,9 +25,8 @@ jobs: NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL: '/app' NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL: '/app' - # Upstash - UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }} - UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }} + # Redis + REDIS_URL: ${{ secrets.REDIS_URL }} # Resend RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 90070247..a516ad0b 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -22,9 +22,8 @@ jobs: NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL: '/app' NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL: '/app' - # Upstash - UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }} - UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }} + # Redis + REDIS_URL: ${{ secrets.REDIS_URL }} # Resend RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a18ae910..5eeb399e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,7 +67,7 @@ The Tech Stack: - [ShadCN UI](https://ui.shadcn.com) - [NeonDB](https://neon.tech) - [Clerk Auth](https://clerk.dev/) -- [Upstash](https://upstash.com) +- [Redis](https://redis.io/) - [Resend](https://resend.com) Development stuff: diff --git a/bun.lockb b/bun.lockb index 0d70c10d..5a70274f 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/cspell.config.yaml b/cspell.config.yaml index 02cb5277..687d2365 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -51,7 +51,6 @@ words: - tseslint - typecheck - Uploadthing - - Upstash - healthcheck - timeago - usehooks diff --git a/package.json b/package.json index 0acfc3da..ecbcfd5a 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,6 @@ "@trpc/client": "next", "@trpc/react-query": "next", "@trpc/server": "next", - "@upstash/redis": "^1.34.0", "@vercel/analytics": "^1.3.1", "@vercel/speed-insights": "^1.0.12", "class-variance-authority": "^0.7.0", @@ -85,6 +84,7 @@ "drizzle-zod": "^0.5.1", "framer-motion": "^11.5.2", "geist": "^1.3.1", + "ioredis": "^5.4.1", "jiti": "^1.21.6", "lucide-react": "^0.438.0", "next": "14.2.8", diff --git a/src/env.ts b/src/env.ts index feb6b89c..216c51b0 100644 --- a/src/env.ts +++ b/src/env.ts @@ -15,9 +15,8 @@ export const env = createEnv({ // Neon DB DATABASE_URL: z.string().url(), - // Upstash - UPSTASH_REDIS_REST_URL: z.string(), - UPSTASH_REDIS_REST_TOKEN: z.string(), + // Redis + REDIS_URL: z.string(), // Resend RESEND_API_KEY: z.string(), diff --git a/src/lib/redis.ts b/src/lib/redis.ts index 43176830..7caabfce 100644 --- a/src/lib/redis.ts +++ b/src/lib/redis.ts @@ -1,8 +1,4 @@ -import { Redis } from '@upstash/redis'; - import { env } from '@/env'; +import Redis from 'ioredis'; -export const redis = new Redis({ - url: env.UPSTASH_REDIS_REST_URL, - token: env.UPSTASH_REDIS_REST_TOKEN, -}); +export const redis = new Redis(env.REDIS_URL); diff --git a/src/server/trpc.ts b/src/server/trpc.ts index 74ff0556..e076108c 100644 --- a/src/server/trpc.ts +++ b/src/server/trpc.ts @@ -1,12 +1,11 @@ +import { db } from '@/db'; +import { redis } from '@/lib/redis'; +import { resend } from '@/lib/resend'; import { currentUser } from '@clerk/nextjs/server'; import { initTRPC, TRPCError } from '@trpc/server'; import superjson from 'superjson'; import { ZodError } from 'zod'; -import { db } from '@/db'; -import { resend } from '@/lib/resend'; -import { redis } from '@/lib/redis'; - export const createTRPCContext = (opts: { headers: Headers }) => { return { db,