Finished Content Management, CLI tool in progress
I should be really resting today, but I can't help it. I'll continue working on the content management mvp.
Content Management
I finished the create content endpoint and it works locally. When I deploy, I'll have to make sure to set a path it can write to and bind the right volume.
Now, I need to serve the content. For that I'll use a simple container with Nginx that serves from the shared Docker volume. On the nginx, I'll set up some caching headers, and that should be it. Here's a simplified docker-compose setup.
services:
content:
image: nginx:latest
ports:
- "8082:80"
volumes:
- content-data:/usr/share/nginx/html:ro # read only access to the shared volume
api:
image: kova98k/devjourney-api:latest
environment:
CONTENT_FS_ROOT: /content # path matches the volume mount
ports:
- "8081:8080"
volumes:
- content-data:/content # writes to shared volume
volumes:
content-data:
This way backing up is also trivial, as I can run a short lived container that will simply dump the volume to remote storage.
Next up, Submit Script.
Submit Script Brainstorming
I'm thinking about the requirements. The script should:
- accept an entry in a markdown file
- parse it to extract:
- text content
- metadata
- media content
- upload media content
- replace relative links with links of uploaded media
- authenticate using api key from ENV or parameter
- submit the finished content to devjourney
I will probably also want to at some point
- submit drafts
- update content
Now that I've layed all of this out, it seems like this goes beyond a simple script, and would be better suited for a CLI utility.
Structuring Journal Entries
Before I start on the CLI utility, I need to clean up my diary entries. Up until now, I've been writing them in a custom format, which is not very easy to parse and work with. When I initially started, I didn't want to put much thought into it and just wanted to start writing.
It has now evolved into an entry point of a complex content pipeline. For that, I need a proper format, with better organized titles, sections, and structured metadata.
For the metadata, I'm opting for front matter. It's a conventional way of adding metadata to a markdown file. I'll keep it at the top, and this is what it will look like:
---
date: 2025-06-01
project: devjourney
title: Finished Content Management, Brainstorming Submit Script
mood: happy
time-spent: 3h30m
---
Historically, I've had AI generate these titles, but they have been horrible. I will probably work on improving that later so it can generate titles for when I'm too tired or uninspired to come up with good ones. It will need some tweaking for sure.
Finished the conversion script, didn't take long using Cursor. I'll keep the old files for a bit longer, until I'm 100% sure it's properly converted, but I'm now ready to start working on the CLI tool.
Pretty scary diff.