diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index afde510b..ecd55e4d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ In this guide, you will get an overview of the project structure and setup, as w - [Environment Variables](#environment-variables) - [Configuring your Database](#configuring-your-database) - [Configuring Clerk](#configuring-clerk) - - [Configuring Upstash](#configuring-upstash) + - [Configuring Upstash (optional)](#configuring-upstash-optional) - [Running stuff](#running-stuff) - [Closing notes](#closing-notes) @@ -171,6 +171,8 @@ And now you got Auth! #### Configuring Upstash (optional) +> **Note** Upstash is used to provide rate-limiting capabilities to Noodle, which is optional locally as that it's really only needed in the production version. + 1. Create your account through [Upstash's dashboard](https://console.upstash.com) 2. Click on "Create database" 3. Give it a name and a region @@ -179,7 +181,6 @@ And now you got Auth! 6. In the "Connect to your database" section, select "@upstash/redis" 7. Copy the url into your `.env` file as `REDIS_URL` key 8. Copy the token into your `.env` file as `REDIS_TOKEN` key -9. Upstash is only used for ratelimiting, if left empty then ratelimiting will be disabled And that's all for the redis part! diff --git a/src/env.mjs b/src/env.mjs index 7aeebf6c..fe0e9517 100644 --- a/src/env.mjs +++ b/src/env.mjs @@ -9,8 +9,8 @@ export const env = createEnv({ NODE_ENV: z .enum(["development", "test", "production"]) .default("development"), - UPSTASH_REDIS_REST_URL: z.string().min(1).optional(), - UPSTASH_REDIS_REST_TOKEN: z.string().min(0).optional(), + UPSTASH_REDIS_REST_URL: z.string().optional(), + UPSTASH_REDIS_REST_TOKEN: z.string().optional(), CLERK_SECRET_KEY: z.string().min(1), OPENWEATHER_API_KEY: z.string().min(1), },