Making a Blog Editor

Sometimes it's relaxing to kick back on the couch with a laptop and get your thoughts out on your projects. So, I made a blog editor to do so.

-Sean J. Miller 6/302022

I've seen Blog sites over the years like Word Press.  They are pretty cool.  What interested me about them is that they are database driven versus static content driven.  That is, a person doesn't make a single web page and store it on the web server.  Rather, they are typing in an editor that then stores the various text fields into a database.

So, I thought, how could I do that.  I had used tinyMCE for a work project.  It is a WYSIWYG rich text editor that actually is generating HTML markups around your text.  Since I first applied it at work, it has got a lot of added features.  So, I quickly realized it is my editor of choice.  (I'm using it right now!)

With the editor side taken care of, I needed a place to store the meta data and body of my blogs produced by tinyMCE.  I went with SQLite3.  It is a database that is stored into a single file!  Awesome!  It actually only has a handful of datatypes.  The reality is, though, numbers and text are pretty much all you need.  It's smart with date fields in that if you give it a date, it will stuff it as text, but already formatted for chronological sorting.

The benefit of a single file-based approach is that you can mirror your site to a private GitHub repository.  In turn, you can backup and restore your entire web application and its database.  There is no installation of a giant database like Microsoft SQL or Oracle.  However, Microsofts SQL Express has gotten pretty easy to install these days - but nothing as easy as SQL Lite.  You can learn how to use it with my prior blog:  https://www.raisingawesome.site/blogs/LinuxSQLite

To handle the talking to the database, I'm using a Razor Page.  There is a C# package available that provides the class to make short work of any transaction.

Now, I can brain dump to my heart's content and have very little overhead involved to organize and store the information to our web page.  In turn, I have a project diary like I could keep in OneNote, but shared to other enthusiasts.

Have a question?
Back to Home