CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/sqlite-node-best-practices

SQLite best practices for Node.js with better-sqlite3 — WAL mode, pragmas, foreign keys, STRICT tables, transactions, migrations, graceful shutdown, and query patterns

97

1.65x
Quality

98%

Does it follow best practices?

Impact

96%

1.65x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Blog Platform Backend

Problem/Feature Description

Build a simple blog platform backend with Node.js, TypeScript, and Express. Use SQLite for storage (self-hosted single-server deployment).

The platform needs:

  • Authors: name, email (unique), bio. An author can have multiple posts.
  • Posts: title, slug (unique), body (markdown text), status (draft/published/archived), published date, and metadata stored as a flexible JSON object (for SEO title, description, open graph image, etc.).
  • Tags: posts can have many tags, tags can be on many posts (many-to-many).
  • Create a post with tags: given author ID, post data, and an array of tag names, create the post and associate all tags (creating any new tags that don't exist yet). This should be all-or-nothing.
  • List published posts with author name and tags, ordered by published date, with pagination (limit/offset).
  • Get a single post by slug with full author info, tags, and metadata.
  • Search posts by text in title or body.
  • List all posts by a specific tag name.

Output Specification

Produce:

  • src/db.ts — Database connection, pragmas, and schema migrations
  • src/posts.ts — Post query functions
  • src/routes.ts — Express routes
  • package.json — With dependencies

Complete TypeScript, no placeholders.

evals

scenario-1

criteria.json

task.md

tile.json