Daftar #
Daftar is my little personal blogging utility. If you want to use it, there you go!
It lets me write posts in a nice WYSIWYG Markdown editor, serve them on a subdomain chosen by me, and generate a valid RSS feed for my blog.
I built it because I dislike other blogging platforms and I feel like they've got too much bloat. They're just not mine! Building the auth and editor were the biggest challenges. I also created middleware for displaying messages (which isn't a huge feat but I love it), et cetera.
Features #
I implemented the following:
- Register, Login, Logout.
- Form validation! Custom JS on the frontend for cute warnings and zod on the backend for security (just in case 😛).
- Create, Edit, Publish, Unpublish and Delete Posts.
- Nice custom WYSIWYG Markdown editor that took a long while to implement. 100% worth it though.
- Should be safe to a degree, as in, no evident XSS.
- It has a RSS generator! A very rudimentary one but the online RSS validator approves of it.
Ka-boom. - A JS "pseudo-bundler" to serve the editor. (this is more of a "how it works" thing)
- Serving blog (posts + rss) in a separate subdomain depending on the user. (
user.domain.com)
Running it #
Requirements #
You need Bun to run the code. Get it from their website. You might need docker if you want to containerize it instead.
You also need git to fetch this repo. And a web browser to access the app. And a keyboard to operate the web browser.
Ok, now what? #
Daftar is built in TypeScript, using Hono, Zod, DOMPurify, a markdown parsing lib, ProseMirror, Eta, and Drizzle ORM. It can be easily tested using the following commands:
git clone https://tangled.org/poy.ooo/daftar
cd daftar
cp .env.example .env && nano .env
mkdir ./data && mkdir ./drizzle
bun install && bun push && bun dev
or use the Dockerfile included in this repo.
Proceed to http://localhost:1984 afterwards! (NOTE: Blogs will not work when developing on localhost. Tunnel from your laptop to a stable domain and then it'll work)
Make sure to replace the default environment variables with yours, if needed.
Anyway, a public instance might be available at https://oreneta.dev.
Contribute #
To be fair, if you're capable of contributing to this repo, just build your own. Make it better! Serve random cat pics! Make it so if you tilt your phone, it goes "Mooo"! It's not worth saving this.
I promise it'll be fun. Unless you're not a programmer. Or you hate coding.
If you're that stubborn, I've left behind a little DEVELOPMENT.md that you could use as a "handbook" of some sort for my helper functions.
Aftermath #
I ended up not using this project at all. I don't even like writing blog posts! But I love writing code. I enjoyed the process more than the end result. It was the first time I implemented session-based auth, which is a very useful "skill" to learn I later used to make another project.
I'm happy with it.