Simple CMS written in TypeScript, runs on Hono and Deno. Data is stored using Markdown files on disk and SQLite for metadata.
- Install Deno
git clonedeno install- Configure typewriter
deno task start
Typewriter uses two sources for its config: Either a TOML file or environment variables. The former takes precedence over the latter.
# A signing secret for your JWT
JWT_SECRET = "some big random string for signing JWTs"
# [Optional] Contains either:
# - A folder where a database file will be created for you
# - A database file itself
DB_PATH = "/some/path/to/folder/or/typewriter.db"
# [Optional] Enables console verbosity. Also prints all registered routes
VERBOSE = false# A signing secret for your JWT
export TYPEWRITER_JWT_SECRET="some big random string for signing JWTs"
# [Optional] Contains either:
# - A folder where a database file will be created for you
# - A database file itself
export TYPEWRITER_DB_PATH="/some/path/to/folder/or/typewriter.db"
# [Optional] Enables console verbosity. Also prints all registered routes
export TYPEWRITER_VERBOSE=falseTypewriter's authentication model is a combination of an allowlist with OTPs.
There are three steps:
- Send a
register <email>command on the typewriter CLI to get your email on the allowlist
> register test@example.com
successfully registered test@example.com
- Send a
POSTrequest to/auth/signupto get an OTP secret
{
"displayName": "John Smith",
"email": "john@example.com"
}- Send a
POSTrequest to/auth/loginto get your JWT
{
"email": "john@example.com",
"code": "123456",
}Typewriter has its own web server, which answers to RESTful requests. The full API is outlined here (Not built yet)
It also provides a simple CLI for issuing administrative commands, such as registering a new user and gracefully shutting down the server.
TODO