Design Decisions

Philosophy and technical choices that shape the Snek platform

Core Philosophy

Snek is built on a set of guiding principles that inform every technical and design decision:

Technical Decisions

Why aiohttp Over Flask/Django

Decision: Use aiohttp as the web framework.

Rationale:

Why Dataset ORM Over SQLAlchemy

Decision: Use Dataset for database access.

Rationale:

Why Vanilla JavaScript Over React/Vue

Decision: Use vanilla ES6 JavaScript with no frameworks.

Rationale:

Why SQLite as Default Database

Decision: Use SQLite as the default database.

Rationale:

Security Decisions

No IP Logging

Decision: Do not log IP addresses or user activity.

Snek does not record IP addresses, request logs, or user behavior patterns. This is a fundamental privacy commitment, not a configuration option.

No Email Required

Decision: Registration requires only username and password.

Email is optional. Users can register and participate without providing any personally identifiable information. Password recovery relies on administrator assistance.

Session Handling

Sessions use secure, HTTP-only cookies with server-side storage. Session data is encrypted and expires after configurable inactivity periods.

Password Storage

Passwords are hashed using SHA-256 with a configurable salt. The plain password is never stored or logged.

UI/UX Decisions

Dark Theme Default

Decision: Use dark theme as the default and primary design.

The dark theme reduces eye strain for extended use, is preferred by developers, and provides better contrast for code display.

Card-Based Layouts

Content is organized in cards with consistent padding, border-radius, and shadow. Cards provide visual grouping and work well across screen sizes.

Minimal Animation

Animations are limited to subtle transitions (hover states, menu opens). No gratuitous motion that could distract or slow down interaction.

Typography

No Component Shadow DOM

Decision: Custom Elements use light DOM with separate CSS files.

Each component has its own CSS file that integrates with the global stylesheet. This allows consistent theming and easier debugging compared to Shadow DOM isolation.

Code Standards

No Comments

Code should be self-documenting through clear naming and structure. Comments indicate code that needs refactoring.

Author Attribution

Every file includes the author tag at the top:

# retoor <retoor@molodetz.nl>

Modular Organization

Code is organized into small, focused modules. One class per file for JavaScript. Related functionality grouped in directories.

Explicit Over Implicit

Prefer explicit code paths over magic behavior. No auto-imports, no implicit conversions, no hidden side effects.