Skip to content

NeaByteLab/Deserve-VE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deserve-VE

Deserve with DVE: file-based routes, server-side templates, static assets.

Deno Deserve License

Deserve-VE preview

Note

You need Deno 2.5 or later. This repo is only about DVE (server-side templates).

Features

  • Routes = files. One file in routes becomes one URL. No config.
  • DVE templates. Server-side views with variables, conditionals, loops, partials.
  • Shared layout. Head, nav, footer as partials. Reuse everywhere.
  • Static assets. CSS and images in public folder, served at /assets.
  • Deno only. No Node or bundler. UI from Bootstrap CDN.

Installation

Clone and run:

git clone https://github.com/NeaByteLab/Deserve-VE.git
cd Deserve-VE
deno install

Quick Start

Run the server:

deno task start

Open http://localhost:8000. All pages are server-rendered with DVE.

Development (watch):

deno task dev

Restarts when main.ts or routes/ change. For view/CSS changes, refresh the browser.

Project Structure

Deserve-VE/
├── main.ts                 # Router, routesDir, viewsDir, static
├── deno.json               # Tasks, imports
├── deno.lock               # Lockfile
├── public/
│   └── css/
│       └── style.css       # Sticky footer + overrides
├── routes/
│   ├── index.ts            # Home
│   ├── about.ts            # About (conditional content)
│   ├── dashboard.ts        # Stats, table, list (complex DVE)
│   ├── items.ts            # List with #each
│   └── hello.ts            # Minimal DVE
└── views/
    ├── home.dve
    ├── about.dve
    ├── dashboard.dve
    ├── items.dve
    ├── hello.dve
    └── partials/
        ├── head.dve        # Meta, title, CSS
        ├── header.dve      # Navbar
        └── footer.dve      # Copyright (year from route)

DVE in This Repo

Page DVE use
Home Variables, partials
About {{#if showExtra}}
Items {{#each items as item}}, @index
Dashboard Multiple #each, #if, nested data
Hello Single variable

Templates use Bootstrap 5 (CDN) for layout and components; narrative copy is lorem ipsum.

Tasks

Task Description
deno task start Run server (no watch)
deno task dev Run server with file watch

References

  • Deserve (JSR) — HTTP server, file-based routing, DVE rendering, static middleware
  • Deserve docs — Router, views, ctx.render(), static

License

This project is licensed under the MIT license. See the LICENSE file for details.