- TypeScript 47.8%
- CSS 38%
- JavaScript 12.8%
- HTML 0.9%
- Dockerfile 0.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| cms | ||
| dbscripts | ||
| lib | ||
| site | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| deno.json | ||
| deno.lock | ||
| docker-compose-example.yml | ||
| Dockerfile | ||
| LICENSE | ||
| main.ts | ||
| README.md | ||
| update-prod.sh | ||
reboot.li
My personal website: reboot.li
Built upon Deno, TypeScript, Oak, SQLite, Tailwind and HTMX.
It aims for minimal dependencies and long-term maintainability.
Features:
- File based routing (routes are generated at startup time based on the files in the ./site/routes and ./cms/routes folders)
- A simple admin interface to manage entries (session/cookie based authentication)
- Markdown for entries, rendered using the marked library
Development setup
Make sure Deno is installed on your system.
Setup example database
mkdir ./db
deno run --allow-all ./dbscripts/00_setup-database.ts
# additional setup scripts as needed
# deno run --allow-all ./dbscripts/01_setup-entries-table.ts
# deno run --allow-all ./dbscripts/02_setup-example-data.ts
Run server
Install and run the server:
deno task dev
The server should be running at http://localhost:3002 and show the main page of the website.
The admin interface/CMS should be running at http://localhost:3002/cms and show a login screen.
The example user and password are 'admin' and '1234'. This can be changed in the ./dbscripts/00_setup-database.ts script.
NOTE/TODO: Currently users and passwords cannot be managed within the CMS. Ideally unsafe default passwords should never be used but instead a password should be set when executing the setup database script or at 1st login.
Deployment with Docker
Copy the .env.example file to .env and adjust the settings as needed.
cp .env.example .env
Use docker to run the setup database scripts:
mkdir db/
docker run --rm \
--env-file=.env \
-v db:/db \
-v .:/app \
-w /app \
denoland/deno:latest \
deno run --allow-all ./dbscripts/00_setup-database.ts
NOTE: Run this for the respective database scripts as needed.
NOTE: This creates the database file with root permissions. Eventually you'll want to correct this:
When using the provided docker compose file we run deno as an unprivileged user. we need to give this user write permission on the database. 1 way to achieve this is by creating a deno group and adapt the permissions accordingly.
sudo groupadd -g 1993 deno
sudo chown -R $USER:deno ./db
sudo chmod 775 ./db
sudo chmod 664 ./db/db.sqlite
Then use docker compose to run the server.
docker compose up -d
Usually you use a reverse on the server (e.g. nginx or apache) to forward requests to the server and also set up SSL with e.g. certbot.