PostOwl is an open-source web application that let's you create your own website for:
- blogging (public posts)
- sharing letters (share secret links with friends and notify them by email)
- keeping a journal or diary (private posts)
All your writing in one place!
A key feature of PostOwl is 'in-place' editing that makes it super easy and fast to update your site.
Learn more about PostOwl on the website: https://www.postowl.com
PostOwl is open-source software so you can deploy it to any web host you wish.
We'll be releasing a hosted version soon. Join the email newsletter to hear when it's ready.
Hear about new releases and what's going on in the PostOwl community by joining the email newsletter.
PostOwl is a SvelteKit application inspired by editable.website using SQLite for the database. It's currently optimised for SvelteKit's adapter-node to enable deployment to Fly.io.
- Git
- Node.js (minimum 16.20.0 LTS or 18.16.0 LTS recommended) or other JavaScript runtime (not tested).
- SQLite
- Clone this repo to a directory on your computer:
git clone https://github.com/PostOwl/postowl.git
- Enter the directory you cloned the repo to:
cd postowl
- Run
npm install
- Rename
.env.example
to.env
and edit for your environment - Create the database with
sqlite3 data/db.sqlite3 < scripts/schema.sql
- Run the dev server and open a new browser tab with
npm run dev -- --open
- Sign in with the ADMIN_PASSWORD you set in
.env
PostOwl uses SQLite. Beekeeper studio is an excellent app for exploring the database during development.
PostOwl sends emails when you share a letter with friends.
In development we recommend using mailpit to test email without sending real emails.
- Install mailpit
- Make sure mailpit is running (if installed with Homebrew on macOS run
mailpit
) - Configure
.env
with the examples shown for mailpit in.env.example
- Start the local development server with
npm run dev
- the app is now running indev
mode and emails can be sent without encryption - Use PostOwl to add a friend at http://localhost:5173/friends
- Create and send them a letter
- View the email they would have received in the mailpit web interface at http://localhost:8025
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
We can't promise we won't add tests in the future 😉
More seriously: PostOwl is currently an early technical preview, so we've been moving fast and breaking things.
We like JavaScript. That doesn't mean that PostOwl might not be converted to TypeScript sometime in the future.
New contributors welcome! Join the Discussions or submit a PR. (We have opinions about what should be included in PostOwl, so it's best to discuss with first to see if a new feature will be accepted.)
Clever Cloud is a European cloud provider that handles all the infrastructure so developers can focus on their code. Deployments are immutable, meaning your app will restart when scaling, crashing or updating. PostOwl uses SQLite, so this tutorial explains how to deploy PostOwl with a replicated and always updated database. At the end, you'll get:
- A deployed PostOwl app
- A really fast integrated database ❤️
- ... continuously replicated!
For this, we are going to use Litestream and Clever Cloud deployment hooks and its S3-like object storage service, Cellar.
- Git
- A Clever Cloud account
- Litestream installed on your machine
You'll need an object storage bucket (also called S3 storage) where you'll store your database snapshots. From the Clever Cloud Console, create an Cellar add-on:
- Click on Create > an add-on
- Choose Cellar
- Create a bucket and name it as you wish
On Cellar dashboard, check Informations with the environment variables you'll need in your project:
CELLAR_ADDON_HOST
CELLAR_ADDON_KEY_ID
CELLAR_ADDON_KEY_SECRET
Copy those values and save it somewhere safe.
Fill litestream.yml
with these environment variables values:
Now you can run the command to replicate your SQLite database : ./litestream replicate -config litestream.yml
.
💡I usually advise that you create a specific folder in your bucket to host the database snapshots, you can use s3cmd CLI or a S3 client like Cyberduck to do so. If you create a folder in your bucket, make sure to change the path
value in your litestream.yml
.
Finally, add litestream.yml
to your gitignore, and
There is a litestream.sh
file at the root of this repository that will:
- Download Litestream on Clever Cloud server
- Create a configuration file for Litestream
- Remove your database and recreate it with the last backups from your Cellar bucket
Time to deploy!
Follow these steps to deploy your PostOwl app.
- From Clever Cloud console, click on Create>an application
- Choose your deployment method (Git or Github)
- Choose a NodeJS runtime and select your instance size (smallest one works for a small project)
- Inject the following environment variables (use Expert)
BUCKET_DIRECTORY= "."
CC_PRE_RUN_HOOK="./litestream.sh"
CC_WORKER_COMMAND="./litestream replicate -config litestream.yml"
CC_WORKER_RESTART="always"
CC_WORKER_RESTART_DELAY="60"
CELLAR_REGION="fr-par"
DATA_DIR="data"
DB_PATH="data/db.sqlite3"
LITESTREAM_BACKUPS="."
LITESTREAM_BUCKET="<name-of-your-bucket>"
LITESTREAM_VERSION="0.3.9"
BUCKET_DIRECTORY
and LITESTREAM_BACKUPS
.
Add variables from your project's .env
file as well. Variables will be dynamically injected on deployment.
Before pushing your code, we'll connect your Cellar add-on to your app so its environment variables will be injected as well.
- From your NodeJS app menu, click on Service dependencies
- On Link add-ons, select your Cellar add-on
- From your NodeJS app menu, go to Information
- Copy the deployment command
- Paste it at the root of your project and launch it
Now your deployment has started, which you can follow from the Logs panel.