I just wanted to touch grass >.>
There are moments in software engineering when you make a tiny UI improvement and everything is fine.
Then there are moments when you add a checkbox and suddenly you're reviewing the philosophical differences between Facebook publishing, Discord notifications, outbox queues, OAuth connections, canonical content builders, and the meaning of life.
This was the second one.
It started innocently enough.
I wanted a "Share to Facebook" button on my blog and series cards.
Simple, right?
Published content already had a Facebook integration. The backend already knew how to publish. The provider already knew how to generate the post. The canonical URL builder already existed.
Just add a button.
Obviously.
Because that's how these things work.
You touch one button and God quietly opens another terminal.

The first rabbit hole
The first version of the feature was straightforward.
A published blog or series could have:
Share to Facebook
Click it.
Confirm it.
Send it.
Done.
The automatic publishing pipeline stayed untouched because manual sharing is a fundamentally different operation.
Automatic publishing has queues, retries, deduplication, connection state, configuration, and all the other machinery you need when the computer is expected to do things without asking you.
Manual sharing?
That's me clicking a button because I explicitly want something to happen right now.
So we bypassed the outbox.
That part was clean.
Then I looked at the content payload.
The Facebook publisher needed:
title
excerpt
canonical URL
cover image
The blog service already had a private builder for basically this exact thing.
Except it was called something like:
buildPublishedArticleData
Which was fine when blogs were the only consumer.
It became significantly less fine when a Series also wanted to use it.
Because apparently a series is not an article.
Who could have predicted this shocking development?
So instead of duplicating the mapping logic, the canonical content representation was extracted into a reusable CanonicalContentBuilder.
Now both notifications and social publishing can consume the same canonical content representation.
And the URL builder became part of that responsibility too.
Which was particularly useful because my second site doesn't use:
/blog/:slugIt uses:
/article/:slugSo naturally I had already ended up making the public article path configurable.
At this point, the feature was no longer just:
"Add Share to Facebook."
It was becoming:
"Maybe we should stop pretending content URLs and content metadata belong to one specific feature."
Classic.
Then Discord entered the room
Facebook wasn't the only thing happening when a blog was published.
There was also Discord.
But Discord isn't a social publisher in this architecture.
Facebook is:
SocialPublisher
↓
Provider Registry
↓
Outbox
↓
FacebookDiscord is:
NotificationService
↓
Discord Provider
↓
WebhookAnd I really didn't want to commit the cardinal sin of seeing two things in a UI and deciding they must therefore be the same abstraction.
So no.
Discord did not become a fake social provider.
No Discord OAuth.
No Discord publishing queue.
No unnecessary registry entry.
No architectural identity crisis.
Instead, the publish operation gained a distribution intent.
Something conceptually like:
distribution: {
facebook_page: true,
discord: false,
}Now the user can say:
Publish this article, but don't tell Discord.
Which is a surprisingly powerful sentence for something that is essentially two checkboxes.
The checkbox
The publish confirmation dialog now knows which destinations are available.
If Facebook is connected, it can appear.
If Discord is enabled, it can appear.
Everything available starts checked.
Because changing the default behavior would be a fantastic way to discover seventeen months later that an important notification stopped firing because someone unchecked a box once.
The intent is per-publish.
The global integration configuration remains authoritative.
The checkbox doesn't magically resurrect a disconnected Facebook Page.
It doesn't bypass the Discord configuration.
It simply answers:
"For this particular publish, where do you want this thing to go?"
That's a much cleaner mental model.
And then I realized something mildly horrifying
This entire thing was becoming future-ready.
Not because I built some enormous framework with seventeen interfaces and a factory that manufactures factories.
But because the UI now has a small data-driven definition of distribution targets.
So instead of:
if (facebook) ...
if (discord) ...
if (linkedin) ...
if (whatever-we-accidentally-add-next-week) ...there is a target definition describing what the destination is, what kind of destination it is, and how its availability is determined.
Adding another destination later should be mostly:
Add the target.
Not:
Rewrite the publishing architecture and question every decision you've made since 2024.
That distinction matters.
Good architecture isn't necessarily architecture that predicts every possible future.
Sometimes it's simply architecture that doesn't make the next change unnecessarily painful.
The funniest part
The entire thing started because I wanted to make the blog cards prettier.
Then I noticed there were too many icons.
So I moved things into a MoreVert menu.
Then I realized Publish and Unpublish had no confirmation.
So I added confirmation.
Then I realized publishing could trigger Facebook.
So I added a Facebook checkbox.
Then I realized Discord was also triggered.
So I generalized the distribution selection.
Then I realized the content builder was blog-specific.
So I extracted it.
Then I realized the URL path needed to be configurable.
So I configured that.
At some point I stopped and stared at the screen.
And thought:
"How the fuck did a checkbox turn into architecture?"
The dangerous phrase
Every developer knows the phrase.
"While we're here..."
Those three words have probably caused more technical debt than most programming languages.
"While we're here, let's clean this up."
"While we're here, let's extract this."
"While we're here, let's make it reusable."
"While we're here, let's support future providers."
And eventually you're sitting at 3:17 AM designing a distributed event system because the original task was to change the color of a button.
There is a difference between good scope expansion and a mental illness disguised as engineering quality.
This time, somehow, we landed on the good side.
Barely.
The dark lesson
The real lesson wasn't "always make things extensible."
That's how you end up with AbstractUniversalContentDistributionStrategyFactoryProviderService.ts.
The lesson was simpler:
When a second real consumer appears, that's often the right time to extract the abstraction.
Not before.
Not because "we might need it someday."
Because now you actually have evidence.
The canonical content builder had two legitimate consumers.
The distribution selection had two legitimate destinations.
The confirmation dialog had multiple legitimate publishing contexts.
That makes the abstraction earned.
Not imagined.
I still don't trust myself
Because now that this works, there is another dangerous thought forming.
Something along the lines of:
"You know what would be cool?"
No.
Absolutely not.
Close the editor.
Commit the changes.
Push.
Walk away from the computer.
Touch grass.
Do not open another file.
Do not look at another component.
Do not say:
"Since we're already in the area..."
That sentence has ruined enough of my life.
Anyway, it works
The final architecture is actually pretty boring.
And that's a compliment.
Blog Publish
│
▼
Distribution Intent
/ \
/ \
▼ ▼
Social Publishing Notifications
│ │
▼ ▼
Outbox Discord
│
▼
FacebookManual Facebook sharing remains separate:
Blog / Series Card
│
▼
Confirmation
│
▼
Social Publisher
│
▼
FacebookNo accidental notification.
No automatic publish event.
No outbox.
No status mutation.
No architectural sacrifice to the checkbox gods.
Just a reasonably clean system.
Which means, naturally, the next problem will probably be caused by CSS.
And honestly?
I'd rather debug CSS.
Final Thoughts
I started this wanting to add a Facebook button.
I ended it with configurable distribution intent, a reusable canonical content builder, provider-aware publishing, Discord-aware confirmation, and a slightly stronger conviction that software engineering is mostly just discovering increasingly sophisticated ways to say:
"Well, shit. I guess we're refactoring this now."
Welcome to The Rabbit Hole.