Skip to content

A lightweight, edge-first web framework built on Cloudflare Workers with authentication, D1 database, and a clean dark UI. Deploy a blog or small site globally in under 5 minutes. Version 1.0

Notifications You must be signed in to change notification settings

gnarzilla/deadlight-bootstrap

Repository files navigation

Deadlight Edge Bootstrap - Cloudflare Workers Blog/Site Framework - Version 1.0

A lightweight, edge-first web framework built on Cloudflare Workers with authentication, D1 database, and a clean dark UI. Deploy a blog or small site globally in under 5 minutes.

🌐 Live Demo

Table of Contents

  1. Project Update
  2. Key Features
  3. Quick Start
  4. Project Structure
  5. Common Issues
  6. Customization
  7. Contributing
  8. Roadmap
  9. License
  10. Support

Project Update

Evolved branch of this project has been moved to blog.deadlight | V4 Live Demo All updates to this project will build further upon version 4, deadlight-bootstrap (this repo) has no plans for further updates without outside contributors. The following screenshots and the README refer to the current archived repo/v1.

image image image

Key Features

  • Near Zero cold starts - Runs on Cloudflare Workers edge network
  • Authentication built-in - JWT-based auth with secure sessions
  • Markdown support - Write posts in Markdown, rendered safely
  • Dark/Light themes - Smooth theme switching with localStorage
  • D1 Database - SQLite at the edge for your content
  • Fast - Under 150KB total, loads instantly worldwide
  • Secure - XSS protection, CSRF safe, proper password hashing
deadlight boostrap blog

Quick Start

Prerequisites

  • Cloudflare account (free tier works)
  • Node.js 16+
  • Wrangler CLI (npm install -g wrangler)

Deploy in 5 minutes

  1. Clone and install:
git clone https://github.com/gnarzilla/deadlight-bootstrap.git
cd deadlight-bootstrap
npm install
  1. Create your D1 database:
wrangler d1 create your-db-name
  1. Create the database ID to wrangler.toml:
[[d1_databases]]

binding = "DB"
database_name = "your-db-name"
database_id = "your-database-id-here"
  1. Initialize the database:
wrangler d1 execute your-db-name --file=schema.sql
  1. Configure your domain in wrangler.toml:
[[routes]]

pattern = "your-domain.tld/*"
zone_id = "your-zone-id"
  1. Deploy:
wrangler deploy
  1. Create your admin user:

Project Structure

deadline-bootstrap/
├── blog.js          # Main router and request handler
├── admin.js         # Admin routes (create/edit/delete)
├── auth.js          # Authentication logic
├── jwt.js           # JWT token handling
├── render.js        # Page rendering functions
├── templates.js     # HTML templates
├── styles.js        # CSS (dark/light themes)
├── utils.js         # Utility functions
├── schema.sql       # Database schema
└── wrangler.toml    # Cloudflare configuration

Common Issues

DNS Error 1016

Add an A record pointing to 192.0.2.1 (dummy IP) with proxy enabled.

Redirects not working

Make sure to use url.origin in redirects, not relative paths.

Customization

Change Styles

Edit styles.js - both darkMinCSS and lightMinCSS are fully customizable.

Add Pages

Add new routes in blog.js following the existing pattern.

Modify Templates

Edit templates.js for layout changes

Roadmap

Evolved project moved to dedicated repository at blog.deadlight. This repo will remain active as a minimalist, blog only, implementation. Federation, email, local keyring integration, other proxying features not supported in Bootstrap version, however these limits allow the blog to be entirely edge deployed with no local dependencies.

Full integrated platform with blog.deadlight, proxy.deadlight and lib.deadlight to live at edge.deadlight

Coming Soon

  • Individual post pages with permalinks
    • Post excerpts on homepage
  • RSS feed generation
  • Tags and categories
  • Search functionality
  • Draft/scheduled posts
  • Comments (considering privacy-first approach)

Under Consideration

  • Image uploads via R2 (with content safety measures)
  • Analytics (privacy-respecting, no Google)
  • Email notifications for new posts
  • i18n/multi-language support
  • Theme marketplace
  • PWA support

Plugin Architecture

  • Extensible with Workers modules
  • Custom themes beyond dark/light
  • Webhook integrations

Contributing

This is a personal project shared for others to use and learn from. Feel free to:

  • Fork it for your own use
  • Submit PRs for bug fixes
  • Open issues for major bugs
  • Share what you build!

Note: I'm moving on to other projects, so response time may vary.

License

MIT - Use this however you want!

Support

  • Built to learn Cloudflare Workers
  • Inspired by the need for simple, fast, edge-native websites

Support is greatly appreciated! - ko-fi/gnarzilla

About

A lightweight, edge-first web framework built on Cloudflare Workers with authentication, D1 database, and a clean dark UI. Deploy a blog or small site globally in under 5 minutes. Version 1.0

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published