psincraian/myfy
Overview
This skill integrates server-side rendering with Jinja2, Tailwind CSS 4, DaisyUI 5, and Vite for fast development and production-ready static assets. It scaffolds a frontend layout, templates, and asset pipeline and exposes render_template and helper utilities for easy template rendering. Use it to combine Python backend rendering with modern frontend tooling and HMR.
How this skill works
The module provides a Jinja2 templates directory, static asset folder, and Vite integration. In development it can start a Vite dev server with HMR and inject vite_assets for JS/CSS; in production it serves built assets from a manifest with long cache headers. Templates are rendered via render_template and can receive request, user, and other context values.
When to use it
- You need SSR with Jinja2 and modern Tailwind + DaisyUI styling.
- You want Vite-powered development with hot module replacement.
- You need a quick scaffolded frontend (templates, static, config).
- You want to serve optimized, cacheable assets in production.
- You need template helpers like vite_assets and asset_url.
Best practices
- Enable auto_init for new projects to scaffold templates and configs.
- Extend a single base.html to keep layout and head assets consistent.
- Pass the request object to render_template when using url_for or CSRF.
- Build assets (npm run build) and disable Vite dev server in production.
- Enable long cache max-age for static assets and use hashed filenames.
Example use cases
- Render a homepage with Tailwind and DaisyUI components using render_template('home.html').
- Develop frontend with Vite HMR while running the Python backend locally.
- Serve user-specific pages with request context to generate dynamic URLs.
- Add custom Jinja filters (e.g., currency) after module initialization.
- Deploy production app that serves optimized assets from frontend/static/dist.
FAQ
Set MYFY_FRONTEND_ENABLE_VITE_DEV=true (default true) and ensure Vite is available at MYFY_FRONTEND_VITE_DEV_SERVER.
How are assets served in production?
Run npm run build to create dist assets; set MYFY_FRONTEND_ENVIRONMENT=production and MYFY_FRONTEND_ENABLE_VITE_DEV=false so the module serves built assets from the manifest with cache headers.
7 skills
This skill helps you integrate server-side rendering with Tailwind, DaisyUI, and Vite in frontend modules for seamless templates and static asset handling.
This skill helps you design and use custom CLI commands with dependency injection and Typer, improving automation and app tooling.
This skill integrates async SQLAlchemy data access with request-scoped sessions and pool management to simplify robust database operations.
This skill helps you implement and orchestrate SQL-based background tasks with automatic retries and DI in Python.
This skill explains and demonstrates myfy dependency injection with scopes, providers, and route integration to improve modularity and testability.
This skill helps you design and integrate modular Python applications with the myfy module protocol, lifecycle phases, and extension patterns.
This skill helps you implement comprehensive user authentication with email/password, OAuth, sessions, and JWT across web and API clients.