Skip to content

BrunoBernardino/deno-boilerplate-simple-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Deno Website Boilerplate

This is a simple website boilerplate built using Deno and deployed using Deno Deploy.

Demo at simple-deno-website-boilerplate.onbrn.com.

Framework-less

This right here is vanilla TypeScript and JavaScript. It's very easy to update and maintain.

It's meant to have no extra dependencies, builders, packagers, bundlers, or pre/post-processors. Just vanilla stuff.

It does include some examples for building complex apps, like:

  1. No JS form submission in /form
  2. Dynamic client-side updates in /dynamic with vanilla JS
  3. Hydration in /ssr (when some JS is dynamically created to update the client state once it's finished the initial load) with vanilla JS
  4. Using Just-In-Time-transpiled-TypeScript (inspired by ts-serve) Web Components for dynamic client-side updates in /web-component
  5. Using Just-In-Time-transpiled-SASS for SCSS → CSS output
  6. React with SSR and hydration in /react (and /react/5, for example)
  7. Also, if you want to see things like Google Sign-in or GitHub Sign-in, running PostgreSQL database migrations, filling PDFs, sending emails with attachments, dynamic sitemaps, or uploading files to AWS S3, I've also published a Deno Code Examples app and repo.

You can build pretty complex and complicated things without frameworks or loads of dependencies, but if you need a framework, I'd suggest you try fresh, Snel, or Aleph to still be able to enjoy a lot of Deno. They're pretty nice.

Requirements

This was tested with deno's version stated in the .dvmrc file, though it's possible other versions might work.

There are no other dependencies. Deno!

Development

$ make start
$ make format
$ make test

Structure

  • Backend routes are defined at routes.ts.
  • Static files are defined at public/.
  • Pages are defined at pages/.

Everything else can be structured differently.

Deployment

  • Deno Deploy: Just push to the main branch. Any other branch will create a preview deployment.

TODOs

Here are some things you will likely want to change before "publishing" this, or after cloning it:

  • baseUrl, defaultTitle, defaultDescription, and content-security-policy in lib/utils.ts
  • Title, description, and links in this README.md file
  • robots.txt and sitemap.xml files