Templated Needed for Dub.co
dheerajydv19
PROOP

a year ago

Dub.co is a popular and currently the best link attribution platform that supports conversion tracking. I tried to deploy it myself but am facing issuing in it as it's monorepo and i don't have much experience in coding and deployment too.

I will be happy to pay a small amount to anyone who can help me in it's deployment. Also, you can make this template and others will also be able to use this which will a decent bounty for you at no extra efforts.

Github - https://github.com/dubinc/dub

$100 Bounty

23 Replies

Railway
BOT

a year ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


a year ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 11 months ago


a year ago

Loudbook and I have started work on this 🙂


noahd

Loudbook and I have started work on this 🙂

dheerajydv19
PROOP

a year ago

Thanks, buddy, let me know when you complete it, i will be happy to try and report any issue if arise.


irazvan2745
FREE

a year ago

Dub analystics are using a SaaS, cannot be fully selfhosted on railway


irazvan2745
FREE

a year ago

Also the databases are using a SaaS, upstash sdk, which cannot be selfhosted


a year ago

I also literally cannot get their repository to compile.


irazvan2745
FREE

a year ago

Exactly, its an app made for vercel and other similar apps, practically impossible unless you make a massive codebase change


a year ago

Well, the bounty is there until someone presents a quality template that isn't a fork.


irazvan2745
FREE

a year ago

its not possible without external services


irazvan2745

Also the databases are using a SaaS, upstash sdk, which cannot be selfhosted

dheerajydv19
PROOP

a year ago

I understand that there are some dependencies that can't be self-hosted, like Upstash, Cloudflare R2, etc, and that's totally ok. You can define those as environment variables wherever self-hosting is not possible.

I want a template that makes the deployment easy. I already have all dependencies ready, but I am still unable to host the application on Railway. It's a monorepo, and I don't have much coding experience, and in deployment too.


noahd

Loudbook and I have started work on this 🙂

dheerajydv19
PROOP

a year ago

Hey buddy, any update?


a year ago

Yep, as OP said, I don't expect the template to self host the external dependencies that dub requires, they can be be input as environment variables.


dheerajydv19

Hey buddy, any update?

a year ago

Have been working on job related things unfortunately so I have been unable to work too much. Working n it now though and will make progress over the day.


a year ago

Hey dheerajydv19.

Building the plain image from the dub repo does seem to be outputting this weird error. I wonder if we can disable type checking based on an ENV flag to make building on Railway better.

Doing a bit more investigating with this before I give a solid "this doesnt work" but it might involve some config being PRed into the project if that's alright.

Attachments


brody

Yep, as OP said, I don't expect the template to self host the external dependencies that dub requires, they can be be input as environment variables.

irazvan2745
FREE

a year ago

might aswell just use dub directly atp, anyways, good luck noah and loudbook


a year ago

Yeah it looks like it is quite a bit more complex to create then I would hope. I think I'll pass on working on it (too much time to be worth the bounty) but Loudbook is probably still interested.


a year ago

So I did more looking into this and unfortunately the dub codebase currently has an error which wont allow you to build.

Apps > web > app > (ee) > api > cron > groups > create-default-links > routes.ts 149:17

Are you or any of the dub maintainers able to shed some light on this or fix in your end?

It also looks like the previews deployments are also all failing as of ~8 hours ago


noahd

Hey dheerajydv19\. ![](https://station-server.railway.com/attachments/att_01k6nahag2f20sx9bf795y9dym)Building the plain image from the dub repo does seem to be outputting this weird error. I wonder if we can disable type checking based on an ENV flag to make building on Railway better. Doing a bit more investigating with this before I give a solid "this doesnt work" but it might involve some config being PRed into the project if that's alright.

dheerajydv19
PROOP

a year ago

Hey, i am not a maintainer of dub, i am just a normal user trying to use that open-source project into one of my project. You can submit a PR but it's acceptance is not in our control.


noahd

So I did more looking into this and unfortunately the dub codebase currently has an error which wont allow you to build. Apps > web > app > (ee) > api > cron > groups > create-default-links > routes.ts 149:17 Are you or any of the dub maintainers able to shed some light on this or fix in your end? ![](image.png)![](https://station-server.railway.com/attachments/att_01k6nn05j9fztb6nbr5ay0mkxg) It also looks like the previews deployments are also all failing as of \~8 hours ago![](https://station-server.railway.com/attachments/att_01k6nn33csfahrnt224f2rfpj1)

dheerajydv19
PROOP

a year ago

I also came across these issues, and some problems got fixed when you use the correct package version.

Package Version

node v23.11.0

pnpm 9.15.9

The project is not building correctly locally - verify your versions of node and pnpm Match the recommended versions above. Delete all node_modules, .next, and .turbo directories in the apps and packages directory. You may now reinstall node_modules by running pnpm install and attempt to rebuild the project with pnpm build.

Some issues will get fixed by doing this, some will still remain, which I don't know how to resolve. I mostly code in Python and am new to frontend.


aceweb
HOBBY

a month ago

Phew, this was easier said than done, but it's done now and available here 👉 https://railway.com/deploy/dub-railway?referralCode=aceweb&utm_medium=integration&utm_source=template&utm_campaign=generic

The catch is that Dub isn't really built to self-host outside Vercel, so a few things needed solving:

  • Database: Dub queries MySQL through PlanetScale's serverless HTTP driver, so the template runs a tiny ps-http-sim proxy in front of a standard Railway MySQL to speak that protocol.
  • Build: Railway's security scanner blocks Dub's pinned Next.js CVE (bumped it across the workspace), and a couple of routes need env present at build time (handled with placeholders). Build uses the public DB URL, runtime uses the private one.
  • Dashboard: Dub hardcodes app.dub.co, so a plain deploy just showed "Link Not Found". Patched it so your Railway domain is treated as the app domain and login works out of the box.

What's in it: three wired services (Dub app + MySQL + the proxy), auto-generated secrets, and the database fully auto-wired. You just bring your own Upstash (Redis + QStash), Tinybird, object storage, and one login method (GitHub/Google OAuth or Resend).

Take it for a spin and let me know how it works. 😄


aceweb

Phew, this was easier said than done, but it's done now and available here 👉 https://railway.com/deploy/dub-railway?referralCode=aceweb&utm_medium=integration&utm_source=template&utm_campaign=generic The catch is that Dub isn't really built to self-host outside Vercel, so a few things needed solving: - **Database**: Dub queries MySQL through PlanetScale's serverless HTTP driver, so the template runs a tiny ps-http-sim proxy in front of a standard Railway MySQL to speak that protocol. - **Build**: Railway's security scanner blocks Dub's pinned Next.js CVE (bumped it across the workspace), and a couple of routes need env present at build time (handled with placeholders). Build uses the public DB URL, runtime uses the private one. - **Dashboard**: Dub hardcodes app.dub.co, so a plain deploy just showed "Link Not Found". Patched it so your Railway domain is treated as the app domain and login works out of the box. **What's in it**: three wired services (Dub app + MySQL + the proxy), auto-generated secrets, and the database fully auto-wired. You just bring your own Upstash (Redis + QStash), Tinybird, object storage, and one login method (GitHub/Google OAuth or Resend). Take it for a spin and let me know how it works. 😄

irazvan2745
FREE

a month ago

forks arent allowed


aceweb
HOBBY

a month ago

hmm aren't allowed by whom? it's not possible to make it work without a fork as their repo cannot possibly be built on railway, and also needs some slight customizations to make it work well and have everything it needs. Anyway the template is there for anybody that needs it


dheerajydv19

Thanks, buddy, let me know when you complete it, i will be happy to try and report any issue if arise.

aceweb
HOBBY

a month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...