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
- Detects missing
frontend/directory - Copies template files and configurations
- Installs Node.js dependencies (Tailwind 4, DaisyUI 5, Vite)
- Starts Vite dev server
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file myfy_frontend-0.1.2.tar.gz.
File metadata
- Download URL: myfy_frontend-0.1.2.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95bc00b9ad8fcdc201ab179f388be47f82e85ab46511208d9141db36fc40469f
|
|
| MD5 |
d7dec4a0113ed46f158066c6640bd8f8
|
|
| BLAKE2b-256 |
f3a78cd4657f6f2e051bee053ee94a3e10a46a579103c92034c821f90b8be6b8
|
Provenance
The following attestation bundles were made for myfy_frontend-0.1.2.tar.gz:
Publisher:
publish.yml on psincraian/myfy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myfy_frontend-0.1.2.tar.gz -
Subject digest:
95bc00b9ad8fcdc201ab179f388be47f82e85ab46511208d9141db36fc40469f - Sigstore transparency entry: 702457481
- Sigstore integration time:
-
Permalink:
psincraian/myfy@bc6189ab521e4961d3c273637964e0dc7e8dbac8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/psincraian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc6189ab521e4961d3c273637964e0dc7e8dbac8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file myfy_frontend-0.1.2-py3-none-any.whl.
File metadata
- Download URL: myfy_frontend-0.1.2-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9e73eb17574cab9130f2977868fe026e407a0f944713142b9562d5ab9685757
|
|
| MD5 |
5ffbe4962f72bcfb7d5643b3ba36223c
|
|
| BLAKE2b-256 |
af470b6d2e5919f31460960e9477e8aa048cf47bc7be6bfd7549b4c74b28aa51
|
Provenance
The following attestation bundles were made for myfy_frontend-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on psincraian/myfy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myfy_frontend-0.1.2-py3-none-any.whl -
Subject digest:
a9e73eb17574cab9130f2977868fe026e407a0f944713142b9562d5ab9685757 - Sigstore transparency entry: 702457495
- Sigstore integration time:
-
Permalink:
psincraian/myfy@bc6189ab521e4961d3c273637964e0dc7e8dbac8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/psincraian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bc6189ab521e4961d3c273637964e0dc7e8dbac8 -
Trigger Event:
workflow_dispatch
-
Statement type: