views: 1011
Designing a simple CMS
02-12-2022
Why not just use WordPress?
I have two primary reasons not to use an off the shelf solution:
First, to maintain a skillset that I have little opportunity to use on my present job. I don't want to go back to full-time web programming (ever), but that doesn't mean that those skills are useless to me. We never know what the future holds, and I have several personal projects that may be better off hosted on a website than installed locally.
Second, ready-made solutions are often very large, and provide far more power than I actually need for this site. The WordPress core has around 346,000 lines of code, as of Dec. 2020. Using Wordpress would be like gettig an F1 team to perform maintenance on my car, when all I really needed to do was change the window fluid. Not necessary, and I don't think the potential slow down and added complexity are good trade-offs in order to avoid writing my own code.
Goals:
- No Javascript
- Searchable
- Multiple types of pre-formatted content (blog posts, coding examples, art, reviews, etc
- Nothing off the shelf (e.g. Wordpress)
- Minimal development time
- Minimal upkeep required
- Editable anywhere: command line, text editor, etc.
- Batch import
Backend options:
Filesystem store: Store straight .html documents on the webserver; search, paginate and assemble with PHP
Relational DB: Store content in a table, use SQL to handle search and PHP for assembly
Document DB: More like the filesystem store; put full documents in the DB, but use database for search and other functions.
Design considerations:
My own background is in CLI programs written primarily in C++. I have some web experience, due to my first couple of jobs and from a social media site that I wrote and maintained with my husband. I am very strong in relational databases, having created, maintained, transformed and ultimately redesigned many over the course of my career. I have years of experience with Oracle DB, PostrgreSQL and MySQL.
However, I haven't had the opportunity yet to play with NoSQL, document databases like MongoDB. Getting a chance to use something new, especially something that seems designed for storing many different kinds of documents with minimal fuss, is appealing to me.
I haven't decided yet whether I am going to write my posts in straight HTML or with something like Markdown. Given that I will want to include code examples on some of my posts and don't want to use Javascript to do any fancy formatting (line numbers, alternating colors on each line, syntax highlighting), I will probably need to use some <pre> tags to make things look right. I don't think MD is powerful enough for that. Perhaps a mixed approach would work. Either way, not making a final decision on document content and format is another reason to consider using Mongo for this project.