dubinc / dub

Open-source link management infrastructure. Loved by modern marketing teams like Vercel, Raycast, and Perplexity.
https://dub.co
GNU Affero General Public License v3.0
17.63k stars 1.84k forks source link

Eliminate dependency on external services #598

Open peaklabs-dev opened 7 months ago

peaklabs-dev commented 7 months ago
linear[bot] commented 7 months ago

ENG-179 Eliminate dependency on external services

versecafe commented 7 months ago
  • [ ] Eliminate dependency on all external services -> let us use them if we want, but also let us use local databases and also let us deploy the server whre want not only on Vercel.
  1. Vercel: You can deploy to Node JS just fine, SST allows decently easy AWS deployments, and Amplify could be used, Netlify also has NextJS deployment you just have to configure some basics for using turborepo with them, you'll also have to find a CRON system to use, SST works easily but you can roll any system you'd like if you configure the Auth Bearer Token for CRON Jobs

  2. PlanetScale: you can use a MySQL DB hosted anywhere including locally with minimal change

  3. Upstash: You can swap out the base connection to a standard redis connection without much difficulty and host that anywhere, similar applies to QStash features

The only thing you lose here is domain transfers are built around Vercel DNS, no guarantees on how you'll set that up.

You'll still need outside systems for things like Cloudinary or unsplash the full list of outside env vars is:

PlansetScale DB "DATABASE_URL", Domain transfer "TEAM_ID_VERCEL", "PROJECT_ID_VERCEL", TB analytics "TINYBIRD_API_KEY", Upstash services "UPSTASH_REDIS_REST_URL", "UPSTASH_REDIS_REST_TOKEN", "RATELIMIT_UPSTASH_REDIS_REST_URL", "RATELIMIT_UPSTASH_REDIS_REST_TOKEN", "QSTASH_TOKEN", "QSTASH_CURRENT_SIGNING_KEY", "QSTASH_NEXT_SIGNING_KEY", Magic link login + other emails "RESEND_API_KEY", "RESEND_AUDIENCE_ID", Stripe for payment "STRIPE_SECRET_KEY", "STRIPE_SECRET_KEY_LIVE", "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY", "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE", OAuth "GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET", "GITHUB_CLIENT_ID", "GITHUB_CLIENT_SECRET", Bitly porting "NEXT_PUBLIC_BITLY_REDIRECT_URI", "BITLY_CLIENT_SECRET", Unsplash images for OG "UNSPLASH_ACCESS_KEY", "CLOUDINARY_URL"

peaklabs-dev commented 7 months ago

How can I eliminate all external dependencies? or will this be possible along with docker hosting soon?

versecafe commented 7 months ago

@ayntk-ai you could pull all the oauth deps and roll passwords on your self hosted DB, bitly and unsplash you'd just have to loose the features same with stripe. TB could be done with a kafka pipeline, domain transfer is also just lost, Resend could be done with Nodemailer and SMTP servers if you really wanted but it's a huge hassle

steven-tey commented 6 months ago

this is planned: https://dub.co/docs/self-hosting#caveats

versecafe commented 6 months ago

@steven-tey any idea on how to replace Tinybird, kafka + clickhouse with a small node/express/next API to glue it together to match the TB interface?

rickylabs commented 3 months ago

Any news on this ?

peaklabs-dev commented 2 months ago

@steven-tey any updates on when we will be able to host dub without any external services just local services via docker compose?