Testing application.

Efren Yevale Varela 2a436e16b6 Added SQLite3 initialization 1 mês atrás
.vscode de93a8a123 Initial commit 1 mês atrás
messages e83d6bd411 Added i18n 1 mês atrás
project.inlang e83d6bd411 Added i18n 1 mês atrás
src 2a436e16b6 Added SQLite3 initialization 1 mês atrás
static de93a8a123 Initial commit 1 mês atrás
.gitignore 2a436e16b6 Added SQLite3 initialization 1 mês atrás
.npmrc de93a8a123 Initial commit 1 mês atrás
AGENTS.md 2a436e16b6 Added SQLite3 initialization 1 mês atrás
LICENSE.md f2d8a2b015 Updated documentation 1 mês atrás
README.md 2a436e16b6 Added SQLite3 initialization 1 mês atrás
config.json.example 2a436e16b6 Added SQLite3 initialization 1 mês atrás
jsconfig.json de93a8a123 Initial commit 1 mês atrás
package.json 2a436e16b6 Added SQLite3 initialization 1 mês atrás
pnpm-lock.yaml 2a436e16b6 Added SQLite3 initialization 1 mês atrás
pnpm-workspace.yaml 2a436e16b6 Added SQLite3 initialization 1 mês atrás
vite.config.js 8f55caf389 Added configuration file and updated documentation 1 mês atrás

README.md

testing-proxy

A modern SvelteKit application with Svelte 5 runes, Tailwind CSS, and Flowbite components.

Setup

Install dependencies:

pnpm install

Configuration

Copy the example configuration to create your local config.json:

cp config.json.example config.json

This file contains settings for database and server configuration. See Configuration below for available options.

Development

Start the dev server on http://localhost:3000:

npm run dev

# Auto-open in browser
npm run dev -- --open

Hot module reload enabled by default.

Build & Deploy

Create a production build:

npm run build

Preview the production build locally:

npm run preview

Production output goes to /build/ (configured for Node.js via @sveltejs/adapter-node).

Project Structure

  • src/routes/ — SvelteKit filesystem routes
  • src/lib/ — Reusable components and utilities (access via $lib alias)
  • src/app.html — HTML shell (dark mode enabled via class="dark")

Tech Stack

  • Framework: SvelteKit 2.63.0 with Svelte 5 (runes mode)
  • Styling: Tailwind CSS 4.3.0 via @tailwindcss/vite + Forms/Typography plugins
  • Components: Flowbite Svelte 1.33.1 + Flowbite Icons
  • Build Tool: Vite 8.0.16
  • Adapter: Node.js (@sveltejs/adapter-node)

Important Notes

Svelte 5 Runes (Mandatory)

All .svelte files use runes mode by default. Use:

  • $state() for reactive variables
  • $derived for computed values
  • $effect() for side effects
  • {#snippet} for component snippets (e.g., icon slots)

See Svelte 5 runes documentation.

Styling

  • Dark mode hardcoded in app.html (remove class="dark" from <html> to disable)
  • Use Tailwind utilities directly; no CSS Modules
  • Scoped styles available via <style> blocks in .svelte files

Internationalization (i18n)

The project uses Paraglide JS for i18n with:

  • Languages: English (en-US) and Spanish (es-MX)
  • Auto-localized Routes: URLs automatically prefixed with language code (e.g., /en/ or /es/)
  • Runtime API: Use getLocale(), setLocale(), and deLocalizeUrl() from $lib/paraglide/runtime.js
  • Messages: Locale-aware functions in $lib/paraglide/messages.js

All routes are automatically localized. No manual language handling needed.

Configuration Reference

The config.json file (copied from config.json.example) controls server and database settings:

Database Configuration

{
  "database": {
    "type": "sqlite3",
    "sqlite3": {
      "fileMustExist": false,
      "filename": "app.db",
      "readonly": false,
      "timeout": 5000,
      "performance": {
        "foreignKeys": true,
        "journalMode": "wal",
        "synchronous": 1,
        "tempStore": "memory"
      }
    }
  },
  "password": {
    "algorithm": "argon2id",
    "options": {
      "memoryCost": 61440,
      "timeCost": 3,
      "parallelism": 1
    }
  }
}
  • database.type — Database backend (currently sqlite3)
  • database.sqlite3.filename — Path to the SQLite database file
  • database.sqlite3.timeout — Query timeout in milliseconds
  • database.sqlite3.performance — Performance tuning options (WAL mode, foreign keys, etc.)
  • password.algorithm — Password hashing algorithm (currently argon2id)
  • password.options — Argon2id configuration (memory cost in KiB, time cost iterations, parallelism level)

Database Initialization

The database is automatically initialized on first creation with:

  • users table — Stores user accounts with email and password (hashed) fields
  • Admin user — Created automatically with email admin@delete.me and password deleteme (hashed with argon2id)

Database initialization is idempotent and runs only once when the database file is first created. The admin user is seeded only if no users exist.

Password Security

Passwords are hashed using Argon2id (configured in config.json). Crypto utilities are available in src/lib/crypto.js for hashing and verification.

Exit Codes

The application uses the following exit codes for process termination:

Code Meaning Trigger
0 Success / Graceful shutdown SIGTERM, SIGINT signals
1 Runtime error Uncaught exceptions or unhandled promise rejections
2 Cleanup error Error during graceful shutdown cleanup logic

Exit codes are defined in src/hooks.server.js and are emitted when the process receives termination signals or encounters runtime errors.

Links