Metadata-Version: 2.4
Name: fymo
Version: 0.1.0
Summary: Python SSR framework for Svelte 5 — esbuild pipeline, Node sidecar, SvelteKit-style remote functions
Project-URL: Homepage, https://github.com/Bishwas-py/fymo
Project-URL: Repository, https://github.com/Bishwas-py/fymo
Project-URL: Issues, https://github.com/Bishwas-py/fymo/issues
Author-email: Bishwas Bhandari <bishwasbh@gmail.com>
License: MIT
License-File: LICENSE
Keywords: esbuild,framework,python,ssr,svelte,wsgi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.11
Requires-Dist: click>=8.0.0
Requires-Dist: gunicorn>=23.0.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: pydantic
Requires-Dist: pydantic>=2.5; extra == 'pydantic'
Description-Content-Type: text/markdown

# Fymo Framework

<div align="center">
  <h3>Production-ready Python SSR Framework for Svelte 5</h3>
  <p>Build modern web applications with Python backend and Svelte 5 frontend</p>
</div>

## Features

- **Build-time esbuild pipeline** — components compiled to hashed `dist/client/*.js` once, served as cacheable static assets.
- **Cross-route shared chunks** — packages imported by multiple pages (e.g. `date-fns`) are bundled once and shared.
- **Persistent Node sidecar SSR** — Python WSGI app talks to a long-lived Node process over stdio JSON; the sidecar imports prebuilt SSR modules and renders per request in microseconds.
- **Minimal HTML response** — typical page is < 10 KB; bundles loaded via `<link rel="modulepreload">` + `<script type="module" src=...>`.
- **`fymo dev` watcher** — incremental rebuilds on save with SSE-driven browser reload.
- **Any npm library** — Node SSR has full Node API surface (`fs`, `fetch`, `Buffer`, streams).
- **Svelte 5 runes** — full `$state`, `$derived`, `$effect`, `$props` support.

## Quick Start

### Installation

```bash
pip install fymo
```

### Create a New Project

```bash
fymo new my-app
cd my-app
```

### Install Dependencies

```bash
pip install -r requirements.txt
npm install
```

### Build and Serve

```bash
fymo build      # produces dist/ with hashed JS/CSS bundles
fymo serve      # production-style WSGI server

# or, for development:
fymo dev        # incremental rebuild + browser auto-reload
```

Visit `http://127.0.0.1:8000`.

## Project Structure

```
my-app/
├── app/
│   ├── controllers/     # Python controllers
│   ├── templates/       # Svelte components
│   ├── models/         # Data models
│   └── static/         # Static assets
├── dist/               # Built output (generated by fymo build)
├── config/             # Configuration
├── fymo.yml           # Project configuration
├── server.py          # Entry point
└── requirements.txt   # Python dependencies
```

## Example Component

```svelte
<!-- app/templates/home/index.svelte -->
<script>
  let { title, message } = $props();
  let count = $state(0);
  
  function increment() {
    count++;
  }
</script>

<div>
  <h1>{title}</h1>
  <p>{message}</p>
  <button onclick={increment}>
    Count: {count}
  </button>
</div>
```

```python
# app/controllers/home.py
def getContext():
    return {
        'title': 'Welcome to Fymo',
        'message': 'Build amazing apps with Python and Svelte 5!'
    }
```

## CLI Commands

- `fymo new <project>` — Create a new project
- `fymo build` — Build for production (produces `dist/`)
- `fymo serve` — Serve a built project
- `fymo dev` — Dev server with file watcher and live reload
- `fymo generate <type> <name>` — Generate components/controllers

## Configuration

Configure your project in `fymo.yml`:

```yaml
name: my-app
version: 1.0.0

routes:
  root: home.index
  resources:
    - posts
    - users

server:
  host: 127.0.0.1
  port: 8000
  reload: true
```

## Architecture

Fymo combines:
- **Python** for server-side logic and routing (WSGI)
- **Svelte 5** for reactive UI components
- **esbuild** for fast, incremental JS/CSS bundling at build time
- **Node.js sidecar** for server-side rendering via stdio JSON protocol

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

MIT License - see LICENSE file for details

## Acknowledgments

- Built with [Svelte 5](https://svelte.dev)
- Bundled with [esbuild](https://esbuild.github.io)
- Inspired by modern web frameworks

---

<div align="center">
  <strong>Built with love by the Fymo Team</strong>
</div>
