Building a Website Builder: Page and Section Data Lifecycle

I budgeted a week to plan out my website builder MVP thinking that I’d be itching to jump back into coding by the end of it…but I’ve surprised myself! I’m really enjoying the planning process and have decided to turn my planning week into an entire planning sprint and spend one more week planning 🥰

I spent most of the weekend thinking through the data lifecycle of pages and their sections. Having the ability to create a draft complicated things a bit, but I think I landed on something that will work for me for the MVP and hopefully future iterations of the website builder 🤞

Someone viewing the Coding with Callie website will only see published pages. As an admin, though, I can also view the `/edit` endpoint for each page where the page’s sections are visible and editable 📝

A page is really just a collection of sections. In terms of published vs. draft, I have a `publish_date` column in the Page table to determine whether or not that page should be added to my router and visible to end users 👀

Draft data is saved at section level. Sections have `published_data` and `draft_data`. While I work on the content of a section, my changes will be saved as json in the `draft_data` column of my Section table. When I’m happy with my changes, I will click the publish page button and my `draft_data` will replace my `published_data` for all of the page’s sections.

What do you think?! 🤔

Want to develop your codings skills and network with other developers? Join the Coding with Callie community!

Coding with Callie – https://coding-with-callie.com/
LinkedIn – https://www.linkedin.com/company/coding-with-callie/

You May Also Like