Skip to content

đź§° Bunch of libs that works together in a standard way of building apps with Deno & Sqlite

License

Notifications You must be signed in to change notification settings

01-edu/framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

framework

Modular TypeScript/Deno utilities for building type‑safe web apps: HTTP routing, typed clients, SPA URL-as-state navigation, SQLite helpers, time utilities, and shared types.

Type-safe HTTP toolkit: router, server wrapper, request context, logger, response helpers, env utilities, and validator. Compose end-to-end typed APIs with consistent logging and errors.

Define routes with input/output schemas, optional authorization, and automatic responses. Produces types for clients; validates GET params/body and logs with sensitive-key redaction.

Wraps your router with logging, error barrier, cookie parsing, trace/span IDs, and RequestContext creation. Handles OPTIONS and integrates respond.* errors.

AsyncLocalStorage-powered RequestContext with getContext/newContext/runContext. Carries Request, URL, cookies, trace and span across async boundaries.

Environment-aware logger (dev/test/prod) with pretty colors, call-chain, batching to devtool, filtering, and context trace/span metadata. Exposes info/warn/error/debug.

respond.* helpers to build JSON Responses for every status and paired Error classes (ResponseError). Adds default JSON headers and bodyless handling (204/304, etc.).

ENV() getter with fallback and required enforcement; typed APP_ENV guard (dev/test/prod) with validation; CI_COMMIT_SHA, DEVTOOL_TOKEN, DEVTOOL_URL accessors.

High-performance, schema-based validation with OBJ, ARR, STR, NUM, BOOL, LIST, UNION, optional. Generates assert/report functions and infers types via Asserted<T>.

Generates a strongly typed client from server route definitions. Provides fetch and reactive signal() helpers with abort/dedupe and rich JSON/body error types.

Vite dev proxy for /api/* to a localhost backend. Streams requests/responses, preserves headers/status/cookies, merges Set-Cookie, and aborts on client disconnect—avoids CORS.

SQLite helpers: declare tables, auto-generate insert/update/get/exists, foreign-key joins, tagged SQL and existence checks, singleton connection, and test restore points.

Versioned migrations via SQLite PRAGMA user_version. Reads a migrations directory for files named NNN-*.ts|js, imports each run(sql) in order, applies them, and updates user_version. Skips work on a clean DB, logs progress, and surfaces errors.

Event-sourcing style “entries” with a star‑schema. initEntries(ids, relations, types) creates the entryInternal table, the entry view (active rows), per‑type views (entry_<lowercase>), and basic indexes. Generates per‑type insert functions that capture RequestContext trace/span and timestamps, supports optional typed fields stored in dedicated tables, soft‑archive via archivedAt, plus insertListeners for streaming/SSE triggers.

URL-as-state SPA routing on @preact/signals. Typed A component, navigate, replaceParams, reactive url helpers; normalizes trailing slashes and skips external and /api links.

Time utilities in seconds: startTime, now() is a more precise Date.now(), and constants SEC, MIN, HOUR, DAY, WEEK, YEAR.

Generic utility types: deep Readonly, Expand, Awaitable, Nullish, IsUnknown, UnionToIntersection, and MatchKeys.

About

đź§° Bunch of libs that works together in a standard way of building apps with Deno & Sqlite

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •