Project Pages Overhaul
Recently, I began to overhaul the project index of the site, from a hard-coded static list to one that is built from the database. This update allowed me to make changes to the process of adding and maintaining projects that I have added.
About The Index
The project index is built from the projects collection within the database. The collection follows a relatively simple schema, that I've already had to make changes to a few times (which is very easy and straight forward with MongoDB). The index will display all projects I have created an entry for, in a nice bootstrap grid.
Adding and Editing a Project
For me, since I can login, I have the ability to add a new project. This page allows me to set the details you can see within the schema (except for the date, that is done automatically when adding or editing a project to set the current timestamp).
As of now, the image is a written link, as I haven't yet implemented a working file upload option (which is next on the list). The project description is written following markdown syntax, and is then converted to HTML when saving and serialized. I save both the markdown and the HTML to the collection for two reasons:
1. When viewing a project, I only need to fetch the HTML column from the database and display it, instead of having to convert the markdown each time someone views a project
2. When I edit a project I need to fetch the markdown to populate the description field for further editing
Overall, I'm glad to have finally made these changes and it makes maintaining the website that much easier and allows me to avoid having to create a page for each project.