Clojure/Hiccup/HTMX/XTDB codebase containing RealWorld examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec as much as possible while sticking to HATEOAS principals.
This codebase was created to demonstrate a fully fledged backend application built with Clojure/HTMX including CRUD operations, authentication, routing, pagination, and more.
-
Using Clojure to implement realworld backend server.
- Ring: ring
- Reitit: [reitit]:(https://github.com/metosin/reitit)
- Hiccup: [hiccup]:(https://github.com/weavejester/hiccup)
- HTMX: htmx
- Hyperscript: hyperscript
-
Using XTDB to store data.
-
Using Nix Flakes to build and deploy
The app listens and serves on 0.0.0.0:3000.
Do drop into a nix shell (you will need the nix package manager installed)
nix developThis will install the binaries needed as well as display useful information to get started developing.
In Progress...
- Docker Build
a build to let non-nix users run server
- switch to libsql
- refactor to xtdb
- swap out datalevin for xtdb
- swap session to xtdb or some kv store other then datalevin
- Auth
- Add is authed middleware
- Return and list errors from form
- Login
- Post to Login
- Add user to session
- Add user data to layout
- Flash message on success
- Sign Up
- Post
- Create user
- Flash message on success
- Sign out
- Can re-login
- Settings page
- Get settings page
- make errors dynamic
- add post for form
- add logout handler
- Update settings
- image
- username
- bio
- password
- Get new/edit articles page
- edit tags
- /editor/slug - edit
- Load article and prefill page
- update links to patch
- /editor - new
- Home
- Render Page
- load global articles
- Load tags
- load user feed articles
- pagination
- load tags from article preview (FE only)
- Views
- add banners
- add error message on htmx 500
- Comments
- API
- create comment on article
- delete comment from article
- get article comment by slug
- Repo
- create
- read by id
- list by article id
- delete
- Service
- create
- delete
- mark if owner
- API
- Get Article page
- delete if owner
- Follow/Unfollow author
- Favorite/Unfavorite article
- comments
- Get on load
- mark if owner
- delete comment if owner
- /article/:slug
- Articles
- Repo
- create
- get by id
- get by slug
- list by favorited
- update
- favorite
- unfavorite
- delete
- Service
- create
- find
- update
- favorite
- unfavorite
- delete article
- Api
- Filter articles
- by author
- by tag
- by favorites
- by author
- Favorite
- Unfavorite
- Insert tags
- Get popular tags
- delete article
- Filter articles
- Repo
- Profile page
- Get profile page
- link to settings
- hide follow if own profile
- Make content live
- follow author
- show favorited articles
- Add seed data import
- Add xtdb
- Add init script
- Add users
- Add articles
- Add default user on cli flag
- Add author details
- Add comments