Web Components Community 🔷

Cover image for Sharing a Deployed Project w/ Source
John Munsch
John Munsch

Posted on

Sharing a Deployed Project w/ Source

Someone was recently looking for an example of a Web Component based site actually deployed where they could look at both the site and the source for it.

I thought I'd share one of mine. It's a simple app with just one main page and a very simple about page. It uses Lit, page for routing (which I don't love, but it's OK), and Bootstrap for styling.


It's easy to build (and super fast since I only used esbuild). It has a Docker image and, if you put it in a GitHub repo, it has a GitHub action that will automatically generate the Docker image any time you push to the repo.

In addition to the above, it has a very simple Node.js server that I use to serve up the site and it's got Storybook ready to run with a handful of simple stories for the various components.

The only thing that's not really included is the Traefik configuration that I use to proxy multiple sites on the same server. I'm a colossal cheapskate and I run a couple of sites as Docker images off of one $6/month Digital Ocean server. If there's enough interest I can try to share the Traefik .toml files, the docker-compose.yml files, and whatnot to make that same kind of stacking of projects on a single server easy.

I think as many has half-a-dozen small projects could easily be run off of a server like that if they don't get a lot of traffic and Traefik can handle some really annoying stuff for you like receiving requests for multiple different domains and funneling that traffic to the right Docker images. It can also get your Let's Encrypt certificates for you and renew them automatically. That's convenient.

Top comments (2)

cjc profile image

Thanks for posting this, reading about web components inevitably results in seeing a lot of partial solutions.

There's something elegant about "just a standalone component" - you can ignore the messiest bits of build tools, tests, deployment etc - but I guess we have to deal with the rest eventually.

johnmunsch_31 profile image
John Munsch

Obviously there are lots of other well known deployed sites out there like Salesforce, the new online Photoshop, or YouTube; but good luck getting to see the source code for those :)