Skip to content

snazzy-gen/Foundation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

FOUNDATION Skill

The FOUNDATION skill is a production-ready web application pattern designed for solo developers building MVPs. It prioritizes simplicity, security, and performance using a robust, non-negotiable tech stack.

Core Philosophy

  • Security by default: Built-in CSRF protection, rate limiting, bcrypt hashing, and parameterized SQL.
  • Solo developer optimized: Minimizes complexity by avoiding ORMs, build tools, and heavy JS frameworks.
  • Production-ready: Includes configurations for containers, volumes, reverse proxies, and logging from the start.
  • Clear upgrade path: Designed to easily transition from SQLite to libSQL or Turso.

Tech Stack

  • Backend: FastAPI + Uvicorn (Python 3.11+)
  • Database: SQLite (WAL mode) or libSQL
  • Frontend: Jinja2 Templates + HTMX + Vanilla CSS + Minimal Vanilla JS
  • Deployment: Podman/Docker (Multi-stage builds) + Caddy/Nginx

Directory Structure

Applications built with this skill follow a strict layout:

  • app/: Application source code (routes, templates, static files).
  • volumes/: Persistent data (config, database, logs).
  • deployment/: Container and proxy configurations.

Features

Security

  • Mandatory parameterized SQL to prevent injection.
  • Bcrypt for secure password hashing.
  • Integrated CSRF and rate limiting.

Data Layer

  • SQLite with Write-Ahead Logging (WAL) and Synchronous=NORMAL for high performance.
  • Manual schema migrations for full control.
  • Database adapter pattern for easy provider switching.

Frontend

  • HTMX for dynamic, SPA-like interactivity without JavaScript complexity.
  • Jinja2 Partials for efficient partial page updates.
  • Premium, responsive designs using Vanilla CSS.

Getting Started

  1. Initialization: The skill uses a scripts/setup.py script to scaffold the project structure, initialize the SQLite database in WAL mode, and create an initial admin user.
  2. Development: Build routes in app/routes/, templates in app/templates/, and use the database adapter in app/db/.
  3. Deployment: Use the provided deployment/ configurations for a containerized rollout with a reverse proxy.

Examples Included

  • examples/database_adapter.py: Demonstrates the recommended SQLite connection and query pattern.
  • examples/htmx_partial.py: Shows how to handle HTMX requests for partial page updates in FastAPI.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors