create-fiyuu-app 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,194 @@
1
+ # Fiyuu
2
+
3
+ Fiyuu is an **AI-native fullstack framework** built on GEA.
4
+ It makes app structure deterministic and exports machine-readable artifacts so both developers and AI tools can work with the same reliable context.
5
+
6
+ ## What problem does Fiyuu solve?
7
+
8
+ Routing and rendering are already solved by strong frameworks.
9
+ Fiyuu focuses on a different bottleneck: **AI and humans often misread intent in large, fast-changing codebases**.
10
+
11
+ Fiyuu enforces fixed route contracts (`page.tsx`, `query.ts`, `action.ts`, `schema.ts`, `meta.ts`) and generates `.fiyuu/graph.json` plus AI docs (`PROJECT.md`, `PATHS.md`, `EXECUTION.md`, and more). This reduces guesswork in generation, refactors, and review flows.
12
+
13
+ ## Why Fiyuu?
14
+
15
+ - **AI-native project context** — `fiyuu sync` exports graph + AI docs from real app structure
16
+ - **Deterministic fullstack contracts** — fixed file conventions reduce hidden behavior and drift
17
+ - **GEA-first runtime** — app route code stays React-free at the framework layer
18
+ - **Built-in diagnostics** — `fiyuu doctor` validates structure and common anti-patterns
19
+ - **AI assistant bridge** — `fiyuu ai "<prompt>"` prints route-aware context for external LLM workflows
20
+
21
+ ## Measurable differentiation
22
+
23
+ Fiyuu tracks performance and DX scorecards by release.
24
+
25
+ | Metric | How to measure | Current (v0.1.x) | Target (v0.2) |
26
+ | --- | --- | --- | --- |
27
+ | Cold build time | `time npm run build` | Baseline pending | >= 20% better on reference app profile |
28
+ | SSR latency (avg/p95) | `npm run benchmark:gea` | Baseline pending | >= 15% lower p95 on reference profile |
29
+ | Client JS bundle size | `npm run benchmark:gea` (bundle output) | Baseline pending | >= 20% smaller on reference profile |
30
+ | AI context readiness time | `time fiyuu sync` | Baseline pending | <= 1s for 100-route reference app |
31
+
32
+ Until public scorecards are published, treat Fiyuu as an early-stage framework.
33
+
34
+ ## Performance and benchmark tooling
35
+
36
+ Fiyuu uses Node.js native HTTP server (no Express). Client assets are bundled with esbuild. SSG routes are cached in memory with optional `meta.revalidate` (ISR-style TTL). Query results support TTL caching with in-flight de-duplication. Navigation responses and HTML support ETag/304, and client navigation prefetches links on hover/focus/viewport.
37
+
38
+ For app-layer UI performance, `fiyuu/client` also provides `optimizedImage`, `optimizedVideo`, and responsive helpers (`responsiveStyle`, `mediaUp`, `fluid`, etc.) so teams can ship faster pages without adding heavy UI runtime dependencies.
39
+
40
+ ## Built-in Database (FiyuuDB)
41
+
42
+ Fiyuu includes a lightweight, always-in-memory database with SQL-like query support:
43
+
44
+ ```typescript
45
+ // In query.ts or action.ts
46
+ import { db } from "@fiyuu/db";
47
+
48
+ // SQL-like queries
49
+ const users = await db.query("SELECT * FROM users WHERE age > ? AND status = ?", [18, "active"]);
50
+ await db.query("INSERT INTO users (name, email) VALUES (?, ?)", ["Ali", "ali@test.com"]);
51
+ await db.query("UPDATE users SET status = ? WHERE id = ?", ["inactive", "u_123"]);
52
+
53
+ // Table API
54
+ const table = db.table("users");
55
+ const admins = table.find({ role: "admin" });
56
+ const one = table.findOne({ email: "a@b.com" });
57
+ table.insert({ name: "Ahmet", email: "ahmet@test.com" });
58
+ ```
59
+
60
+ ## Real-time Channels
61
+
62
+ Fiyuu provides built-in real-time communication via WebSocket and NATS:
63
+
64
+ ```typescript
65
+ // Server-side (app/services/realtime-sync.ts)
66
+ import { defineService } from "@fiyuu/runtime";
67
+ import { realtime } from "@fiyuu/realtime";
68
+
69
+ export default defineService({
70
+ name: "realtime-sync",
71
+ start({ realtime, db }) {
72
+ const chat = realtime.channel("chat");
73
+ chat.on("message", async (data, socket) => {
74
+ chat.broadcast("new-message", { text: data.text, user: socket.userId });
75
+ await db.query("INSERT INTO messages (text, user) VALUES (?, ?)", [data.text, socket.userId]);
76
+ });
77
+ },
78
+ });
79
+ ```
80
+
81
+ ```html
82
+ <!-- Client-side -->
83
+ <script>
84
+ const chat = fiyuu.channel("chat");
85
+ chat.on("new-message", (data) => console.log(data));
86
+ chat.emit("message", { text: "Hello!" });
87
+ </script>
88
+ ```
89
+
90
+ ## Service-based Lifecycle (Always-Alive App)
91
+
92
+ Unlike Next.js (request-driven), Fiyuu apps stay alive continuously with background services:
93
+
94
+ ```typescript
95
+ // app/services/data-sync.ts
96
+ import { defineService } from "@fiyuu/runtime";
97
+
98
+ export default defineService({
99
+ name: "data-sync",
100
+ async start({ db, realtime, config, log }) {
101
+ // Runs on boot, continuously in background
102
+ setInterval(async () => {
103
+ const stats = await db.query("SELECT COUNT(*) as c FROM users WHERE active = 1");
104
+ realtime.channel("stats").emit("update", stats[0]);
105
+ }, 30000);
106
+ },
107
+ async stop({ log }) {
108
+ // Cleanup on shutdown
109
+ },
110
+ });
111
+ ```
112
+
113
+ Run benchmark:
114
+
115
+ ```bash
116
+ npm run benchmark:gea
117
+ npm run benchmark:scorecard
118
+ ```
119
+
120
+ This reports per-route latency (`avg`, `p50`, `p95`, `min`, `max`) and total client bundle size.
121
+ The scorecard command also records build/sync/doctor outputs into `docs/benchmarks/latest-scorecard.md`.
122
+
123
+ ## Current scope (v2 direction)
124
+
125
+ - Primary: **AI-first routing framework** with deterministic contracts
126
+ - Shipping priority: graph tooling, diagnostics, and SSR + cache primitives
127
+ - Secondary: broader adapters, plugin ecosystem depth, CSR/SSG parity
128
+
129
+ ## Competitive snapshot
130
+
131
+ Fiyuu is not positioned as a full replacement for Next.js, Nuxt, or Astro today.
132
+ It is positioned as an AI-native framework workflow where deterministic graph context is a first-class feature.
133
+
134
+ - Ecosystem breadth: behind mature frameworks (current reality)
135
+ - AI-readable architecture context: core investment area
136
+ - Public benchmark scorecards: in progress (`docs/benchmark-matrix.md`)
137
+
138
+ ## Use cases
139
+
140
+ - **AI-assisted teams** using Copilot, Cursor, or local LLM pipelines
141
+ - **React-free app layer** teams that prefer explicit route contracts
142
+ - **Internal tools and dashboards** where deterministic structure matters more than maximal abstraction
143
+
144
+ ## Quick Start
145
+
146
+ ```bash
147
+ npm create fiyuu-app@latest my-app
148
+ cd my-app
149
+ npm install
150
+ npm run dev
151
+ ```
152
+
153
+ ## Useful commands
154
+
155
+ ```bash
156
+ fiyuu dev
157
+ fiyuu build
158
+ fiyuu start
159
+ fiyuu deploy
160
+ fiyuu cloud help
161
+ fiyuu cloud login <token> --endpoint https://api.fiyuu.work
162
+ fiyuu cloud project create mysite
163
+ fiyuu cloud deploy mysite
164
+ fiyuu sync
165
+ fiyuu doctor
166
+ fiyuu doctor --fix
167
+ fiyuu graph stats
168
+ fiyuu graph export --format markdown --out docs/graph.md
169
+ fiyuu ai "explain route dependencies for /requests"
170
+ fiyuu skill list
171
+ fiyuu skill run seo-baseline
172
+ fiyuu feat list
173
+ fiyuu feat socket on
174
+ fiyuu feat socket off
175
+ ```
176
+
177
+ ## Default starter
178
+
179
+ - One-page home layout
180
+ - Optional feature selection during setup (interactive multi-select)
181
+ - Optional light/dark theme toggle with localStorage persistence
182
+ - Built-in `app/not-found.tsx` and `app/error.tsx`
183
+
184
+ ## Documentation
185
+
186
+ - English: `docs/en.md`
187
+ - Turkish: `docs/tr.md`
188
+ - Skills (EN): `docs/skills.md`
189
+ - Skills (TR): `docs/skills.tr.md`
190
+ - v2 Product Spec (TR): `docs/v2-product-spec.tr.md`
191
+ - Benchmark Matrix: `docs/benchmark-matrix.md`
192
+ - Benchmarks Folder: `docs/benchmarks/README.md`
193
+ - AI Demo Walkthrough: `docs/ai-demo.md`
194
+ - AI-for-Framework Guide: `docs/ai-for-framework.md`