I am looking to configure and setup subdomains and eventually custom domains for customer-controlled subdomains? I am using netlify for hosting, and Cloudflare for DNS.
The app is currently hosted at app.domain.com
I am looking to do support for
customer1.domain.com and customer2.domain.com
I’ve certainly googled a fair share, but I don’t seem to be finding anything obvious.
If anyone has resources, please do link, happy to dig in myself. Or if anyone here has done it, and can share some tips on how it works please do!
I don’t … and probably worth asking in the Netlify Community forums, but I have wondered whether or not their new Edge Handlersmight be a way to implement it.
I have not thought it through, but if “some code” ran on on the edge/cdn that detected the subdomain, it could pass that into the app as some “customerId” value that would be used my the app.
Again – this is just me spit-balling. But worth asking.
Thanks @dthyresson - I don’t want to rely on these edge handlers and serveless too much. Since it’s too much vendor lock in and not enough documentation around use cases. I would much rather stick with tried and true methods and keep it simple.
From my research I been doing so far, I have been looking in servers like Caddy which can proxy traffic. I am also in touch with netlify to get setup with a wildcard cert, so I can play around with how the app behaves.
I am also considering creating another “web” app of redwood which is hosting a customer portal, which I can deploy separately and only serves the customer portal. But it will have a shared API.
looks like you ended up getting this working @viperfx … are you able to share the way you went with this, and any lessons learned and able to be shared ??
Can you explain a little bit more about what kind of setup you want? I know a little bit about ViperFx’s setup, so maybe I can help if you share some more details
We are at the final stages of a eight year R&D project … huge backend data-AI brain platform, for which we need to build out a WebApp for, which will have many organisations with their own accounts - and would be looking to have their own sub-domain for their organisational account (and possibly for their child-orgs as well).
Literally thousands upon thousands of them.
Same use case as viperfx:
I am looking to do support for customer1.domain.com and customer2.domain.com
We’ve been looking also at blitz and just stumbled on RedwoodJS … and Redwood seems a much better fit as while we are VERY data driven, we will be working in challenging end-user environments (think intl aid, disaster relief, enviro, etc) and the edge focus with light, low-bandwidth is super valuable to user with minimal bandwidth, connection and device capabilities.
We are looking for 1.0/stable launch mid -2021, so while the timelines are tight, the webapp dev is not “that” intense (and had already been looking at vida.io for the graph/visualisations). The compute/power is in the data/AI brain platform side of things … the webapp just needs to receive authorised data from the postgresDB via API, and redwood seems super-aligned and suited to our use case.
Having the custom subdomain will just make life a little easier and more like “home” for the organisations and users
That’s a really interesting project! Looking forward to seeing it build and grow using (hopefully) Redwood
Your use case does sound surprisingly similar to what ViperFx is doing. I really didn’t think giving your users their own subdomain was that common of a thing to want to do, but looks like I might have to reconsider.
Since it’s so super similar, I’ll let @viperfx take it from here
Thx @dthyresson … that looks pretty cool and lightweight, appreciate the suggestion. We’re looking to start implementing the visualisations early-ish Q2, so this’ll be a great help.
Do you know if there is any self-serve type GUI builder/editor available to help implement ability for a user building out their own dashboards, with visualisation tiles?
eg. new tile, select type, data-sources, other options, etc and then will display the visualisation tile in the dashboard from the user selected options?
Obviously, our own use case we’d be customising any of the builders/editors, but having something existing for end-users is a big head-start to get the functionality out there more easily and maintainable with a “core” visualisation library.
The above Routes config allow you to use different routes with a single redwood app. I have a common app subdomain which is the admin portal. Then all other wildcard subdomains are a public portal. So this config works for my use case.
A simple function to just get the subdomain part of a hostname.
There is currently a known issue with this setup where I believe the Router does more renders than needed, which can cause flashes and other quirks. So for this use case, it’s not perfect and there are improvements to be made to properly support this use case. This is just a hack I came up with.