Skip to main content

Frontend module for myfy with Tailwind 4, DaisyUI 5, and Vite

Project description

myfy-frontend

Frontend module for myfy with Tailwind 4, DaisyUI 5, Vite, and Jinja2.

Features

  • ๐ŸŽจ DaisyUI 5 - Complete component library
  • โšก Tailwind 4 - Native CSS engine, faster builds
  • ๐Ÿ”ฅ Vite - Lightning-fast HMR and bundling
  • ๐Ÿ“ Jinja2 - Server-side template rendering
  • ๐ŸŒ— Dark Mode - Built-in theme switcher
  • ๐Ÿš€ Zero Config - Works out of the box

Installation

pip install myfy-frontend

Quick Start

from myfy.core import Application
from myfy.web import WebModule
from myfy.frontend import FrontendModule, render_template
from myfy.web import route

# Add the frontend module
app = Application(auto_discover=False)
app.add_module(WebModule())
app.add_module(FrontendModule())

# Create a route
@route.get("/")
async def home():
    return render_template("home.html", title="Welcome")

What Happens on First Run

  1. Detects missing frontend/ directory
  2. Copies template files and configurations
  3. Installs Node.js dependencies (Tailwind 4, DaisyUI 5, Vite)
  4. Starts Vite dev server
  5. Ready to use!

Project Structure (After Init)

your-project/
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ””โ”€โ”€ input.css          # Tailwind imports
โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ”œโ”€โ”€ main.js
โ”‚   โ”‚   โ””โ”€โ”€ theme-switcher.js
โ”‚   โ”œโ”€โ”€ templates/
โ”‚   โ”‚   โ”œโ”€โ”€ base.html          # Base layout
โ”‚   โ”‚   โ””โ”€โ”€ components/        # DaisyUI macros
โ”‚   โ””โ”€โ”€ static/
โ”‚       โ””โ”€โ”€ dist/              # Built assets (gitignored)
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ vite.config.js
โ””โ”€โ”€ app.py

Creating Templates

{% extends "base.html" %}
{% from "components/navbar.html" import navbar %}

{% block content %}
{{ navbar(logo="MyApp") }}

<div class="hero min-h-screen bg-base-200">
  <div class="hero-content text-center">
    <h1 class="text-5xl font-bold">Hello DaisyUI 5!</h1>
    <button class="btn btn-primary">Get Started</button>
  </div>
</div>
{% endblock %}

Development vs Production

Development:

  • Vite dev server on localhost:3001
  • Hot module replacement (HMR)
  • Auto-reload on template changes

Production:

  • Optimized CSS/JS bundles
  • Asset hashing for cache busting
  • Gzip compression

CLI Commands

# Initialize frontend (manual)
uv run myfy frontend init

# Build for production
uv run myfy frontend build

# Start dev server
uv run myfy frontend dev

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myfy_frontend-0.1.2a86.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

myfy_frontend-0.1.2a86-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file myfy_frontend-0.1.2a86.tar.gz.

File metadata

  • Download URL: myfy_frontend-0.1.2a86.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for myfy_frontend-0.1.2a86.tar.gz
Algorithm Hash digest
SHA256 a9896eb0694aef1b928e2449e83a29d05f2dac49bf49d46218f731cf8580ad03
MD5 a62fdb1480d738a2ca50cfe2542b695e
BLAKE2b-256 572ca4925f8adb6b34136eee599cba27965acaa225e6c26a5b5a3441ae126f1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for myfy_frontend-0.1.2a86.tar.gz:

Publisher: publish.yml on psincraian/myfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file myfy_frontend-0.1.2a86-py3-none-any.whl.

File metadata

File hashes

Hashes for myfy_frontend-0.1.2a86-py3-none-any.whl
Algorithm Hash digest
SHA256 6c19163d37312c5aad4b6c516d3a696dbe63f446286cbcc67c38dfce0502a420
MD5 6d2a36427c9b2ba736da90d76e8ff8b5
BLAKE2b-256 9a20036b75f29a1c502a0ba0bdbe9510c1c07cafb05f0b74de597ca37e5147cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for myfy_frontend-0.1.2a86-py3-none-any.whl:

Publisher: publish.yml on psincraian/myfy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page