free-framework 4.8.11 → 5.0.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 +20 -9
- package/cli/commands/make.js +21 -12
- package/compiler/generator.js +11 -3
- package/package.json +1 -1
- package/runtime/cluster.js +5 -5
- package/runtime/middleware/firewall.js +38 -0
- package/runtime/server.js +6 -2
- package/templates/app-template/.free/app.js +1555 -0
- package/templates/app-template/app/controllers/ProductController.free +31 -0
- package/templates/app-template/app/models/Product.free +12 -0
- package/templates/app-template/public/free-runtime.js +1 -0
- package/templates/app-template/resources/components/ProductCard.free +16 -0
- package/templates/app-template/resources/views/docs.free +13 -13
- package/templates/app-template/resources/views/home.free +80 -55
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product Controller (v5.0.0 [Convergence])
|
|
3
|
+
* Unified Logic for API and Web
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
action index {
|
|
7
|
+
// Laravel-style Collection logic
|
|
8
|
+
const data = await ORM.all('Product');
|
|
9
|
+
return { success: true, data };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
action show {
|
|
13
|
+
const item = await ORM.find('Product', { id: params.id });
|
|
14
|
+
return { success: !!item, data: item };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
action store {
|
|
18
|
+
// Validation logic here
|
|
19
|
+
const newItem = await ORM.create('Product', body);
|
|
20
|
+
return { success: true, id: newItem.id };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
action update {
|
|
24
|
+
await ORM.update('Product', { id: params.id }, body);
|
|
25
|
+
return { success: true };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
action delete {
|
|
29
|
+
await ORM.delete('Product', { id: params.id });
|
|
30
|
+
return { success: true };
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Free Ultra Enterprise Model: Product
|
|
2
|
+
// Optimized for SQLite / ORM v5.0.0
|
|
3
|
+
|
|
4
|
+
model Product {
|
|
5
|
+
id integer primary_key autoincrement
|
|
6
|
+
uuid string unique
|
|
7
|
+
name string index
|
|
8
|
+
email string unique
|
|
9
|
+
status string default('active')
|
|
10
|
+
created_at timestamp default(now)
|
|
11
|
+
updated_at timestamp default(now)
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var _=(s,i)=>()=>(i||s((i={exports:{}}).exports,i),i.exports);var g=_(()=>{(function(){console.log("\u{1F48E} Free Ultra Engine Activated");let s=document.getElementById("free-app-root"),i=document.createElement("div");i.id="free-loader",Object.assign(i.style,{position:"fixed",top:"0",left:"0",height:"3px",width:"0%",backgroundColor:"#00ff88",zIndex:"10000",transition:"width 0.3s ease, opacity 0.3s ease",boxShadow:"0 0 10px #00ff88"}),document.body.appendChild(i);function f(o){i.style.opacity="1",i.style.width=o+"%",o>=100&&setTimeout(()=>{i.style.opacity="0",setTimeout(()=>i.style.width="0%",300)},300)}async function d(o,t=!0){f(30);try{let e=await fetch(o,{headers:{"X-Free-Partial":"true"}});if(f(70),!e.ok)throw new Error("Navigation failed");let r=await e.json();s.style.opacity="0",s.style.transform="translateY(10px)",s.style.transition="opacity 0.2s ease, transform 0.2s ease",setTimeout(()=>{s.innerHTML=r.content,document.title=r.title,t&&history.pushState({url:o},r.title,o),u(),s.style.opacity="1",s.style.transform="translateY(0)",f(100),window.scrollTo(0,0)},200)}catch(e){console.error("SPA Error:",e),window.location.href=o}}function u(){document.querySelectorAll(".free-component[data-component]").forEach(t=>{if(t.getAttribute("data-hydrated"))return;let e=t.getAttribute("data-component"),r=JSON.parse(t.getAttribute("data-state")||"{}"),a=t.getAttribute("data-free-on-mount"),n=t.getAttribute("data-free-on-destroy");if(a&&window.__free_actions&&window.__free_actions[e]&&window.__free_actions[e][a])try{window.__free_actions[e][a](r)}catch(c){console.error(`[onMount] ${e}:`,c)}if(t.querySelectorAll("*").forEach(c=>{for(let l of c.attributes)if(l.name.startsWith("data-on-")){let w=l.name.replace("data-on-",""),m=l.value;c.addEventListener(w,h=>{let y=l.value;if(window.__free_actions&&window.__free_actions[e]&&window.__free_actions[e][y])try{window.__free_actions[e][y](r,h),t.setAttribute("data-state",JSON.stringify(r))}catch(p){console.error(`[Action] ${e} (${w}):`,p)}else console.warn(`Missing action handler for ${y} on ${w}`)})}}),t.setAttribute("data-hydrated","true"),n){let c=new MutationObserver(l=>{l.forEach(w=>{w.removedNodes.forEach(m=>{if(m===t){if(window.__free_actions&&window.__free_actions[e]&&window.__free_actions[e][n])try{window.__free_actions[e][n](r)}catch(h){console.error(`[onDestroy] ${e}:`,h)}c.disconnect()}})})});c.observe(t.parentNode,{childList:!0})}})}document.addEventListener("click",o=>{let t=o.target.closest("a");if(t&&t.href&&t.href.startsWith(window.location.origin)){let e=new URL(t.href);(e.pathname!==window.location.pathname||e.search!==window.location.search)&&(o.preventDefault(),d(t.href))}}),document.addEventListener("submit",async o=>{let t=o.target;if(t&&t.action&&t.action.startsWith(window.location.origin)){o.preventDefault(),f(30);let e=new FormData(t),r=Object.fromEntries(e.entries());try{let a=await fetch(t.action,{method:t.method||"POST",headers:{"Content-Type":"application/json","X-Free-Partial":"true"},body:JSON.stringify(r),redirect:"follow"});if(f(70),a.redirected){d(a.url);return}if(!a.ok){let n="An error occurred";try{n=(await a.json()).error||n}catch{}t.action.includes("/api/login")?d("/login?error="+encodeURIComponent(n)):d(window.location.pathname+"?error="+encodeURIComponent(n));return}try{let n=await a.json();n&&n.content?(s.style.opacity="0",setTimeout(()=>{s.innerHTML=n.content,n.title&&(document.title=n.title),u(),s.style.opacity="1",f(100)},200)):n&&n.success&&d(window.location.pathname+window.location.search)}catch{window.location.reload()}}catch(a){console.error("Form submit failed:",a),t.submit()}}},!0),window.addEventListener("popstate",o=>{o.state&&o.state.url&&d(o.state.url,!1)}),window.Free={navigate:d,async call(o,t={}){let e=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content");try{let r=await fetch(`/_free/action/${o}`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-Token":e},body:JSON.stringify(t)}),a=await r.json();if(!r.ok)throw new Error(a.error||"Action failed");return a}catch(r){throw console.error(`\u274C Action Error [${o}]:`,r.message),r}}},document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u()})()});g();})();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component: ProductCard
|
|
3
|
+
* High-performance Interactive Island
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
component ProductCard {
|
|
7
|
+
let status = state("idle");
|
|
8
|
+
|
|
9
|
+
div class="p-4 border border-zinc-800 rounded-xl" {
|
|
10
|
+
span { text "Status: " + status }
|
|
11
|
+
button class="ml-4 px-3 py-1 bg-white text-black text-xs font-bold"
|
|
12
|
+
onClick={() => status = "active"} {
|
|
13
|
+
text "Activate"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -40,17 +40,17 @@ component Docs {
|
|
|
40
40
|
li class="flex gap-3" { span class="text-white" { text "•" } text "Unified Syntax: The .free language unifies HTML, CSS, and Logic." }
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
div class="card-pro bg-zinc-900/20" {
|
|
44
|
+
pre {
|
|
45
|
+
code {
|
|
46
|
+
text "// Pure Performance\n"
|
|
47
|
+
text "component Fast \{ \n"
|
|
48
|
+
text " h1 \{ text 'Zero Delay' \}\n"
|
|
49
|
+
text " // Static by default\n"
|
|
50
|
+
text "\}\n"
|
|
51
|
+
}
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -110,10 +110,10 @@ component Docs {
|
|
|
110
110
|
pre {
|
|
111
111
|
code {
|
|
112
112
|
text "get \"/dashboard\" -> Dashboard\n\n"
|
|
113
|
-
text "post \"/api/login\" {\n"
|
|
114
|
-
text " const user = await ORM.find('User', { email: body.email });\n"
|
|
115
|
-
text " return { success: !!user };\n"
|
|
116
|
-
text "}"
|
|
113
|
+
text "post \"/api/login\" \{ \n"
|
|
114
|
+
text " const user = await ORM.find('User', \{ email: body.email \});\n"
|
|
115
|
+
text " return \{ success: !!user \};\n"
|
|
116
|
+
text "\}"
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -1,67 +1,92 @@
|
|
|
1
1
|
component Home {
|
|
2
|
-
main class="
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
h1 class="hero-title" {
|
|
11
|
-
text "The Engine for"
|
|
12
|
-
br { }
|
|
13
|
-
span class="text-zinc-600" { text "High-Performance." }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
p class="text-xl md:text-2xl text-zinc-500 max-w-3xl mx-auto mb-12 leading-relaxed font-medium" {
|
|
17
|
-
text "Experience the future of SSR with Islands Architecture, built-in Reactive state, and Enterprise-grade security. Small footprint, infinite power."
|
|
18
|
-
}
|
|
2
|
+
main class="min-h-screen bg-black text-white selection:bg-primary/30" {
|
|
3
|
+
|
|
4
|
+
// Taskfy-themed Aura Background
|
|
5
|
+
div class="fixed inset-0 pointer-events-none opacity-20 overflow-hidden" {
|
|
6
|
+
div class="absolute -top-1/4 -left-1/4 w-1/2 h-1/2 bg-primary blur-[160px] rounded-full animate-pulse" { }
|
|
7
|
+
div class="absolute -bottom-1/4 -right-1/4 w-1/2 h-1/2 bg-blue-600 blur-[160px] rounded-full" { }
|
|
8
|
+
}
|
|
19
9
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
10
|
+
// Navigation Header
|
|
11
|
+
header class="fixed top-0 w-full z-50 px-8 py-6 backdrop-blur-md border-b border-white/5" {
|
|
12
|
+
div class="max-w-7xl mx-auto flex justify-between items-center" {
|
|
13
|
+
div class="text-xl font-black italic tracking-tighter" {
|
|
14
|
+
text "FREE "
|
|
15
|
+
span class="text-primary" { text "ULTRA" }
|
|
16
|
+
}
|
|
17
|
+
div class="flex gap-8 items-center text-[10px] font-bold uppercase tracking-widest text-zinc-500" {
|
|
18
|
+
a href="#" class="hover:text-white transition-colors" { text "Engine" }
|
|
19
|
+
a href="#" class="hover:text-white transition-colors" { text "Ecosystem" }
|
|
20
|
+
a href="https://omar-fathy.xyz/free-docs/guide.php" class="px-5 py-2 bg-white text-black rounded-lg hover:bg-primary hover:text-white transition-all shadow-xl shadow-white/5" {
|
|
21
|
+
text "Read Encyclopedia"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
29
24
|
}
|
|
30
|
-
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Hero Section: The Taskfy Portal Entrance
|
|
28
|
+
section class="relative pt-48 pb-32 px-8 overflow-hidden" {
|
|
29
|
+
div class="max-w-5xl mx-auto text-center relative z-10" {
|
|
30
|
+
div class="inline-block px-4 py-1 rounded-full bg-primary/20 border border-primary/30 mb-8" {
|
|
31
|
+
span class="text-[9px] font-black tracking-[.4em] uppercase text-primary" { text "Aura v5.0.0 High-Octane" }
|
|
32
|
+
}
|
|
33
|
+
h1 class="text-7xl md:text-9xl font-black tracking-tighter leading-none mb-10" {
|
|
34
|
+
text "The Taskfy"
|
|
35
|
+
br { }
|
|
36
|
+
span class="italic text-transparent bg-clip-text bg-gradient-to-r from-primary to-blue-400" { text "Ecosystem." }
|
|
37
|
+
}
|
|
38
|
+
p class="text-xl md:text-2xl text-zinc-500 max-w-3xl mx-auto mb-16 font-medium leading-relaxed" {
|
|
39
|
+
text "Welcome to the future of high-performance engineering. Free Ultra merges Laravel's elegance, React's reactivity, and Node.js speed into one world-class engine."
|
|
40
|
+
}
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
div class="flex flex-wrap justify-center gap-6" {
|
|
43
|
+
a href="/taskfy" class="px-10 py-5 bg-primary text-white font-black uppercase tracking-widest text-xs rounded-2xl shadow-2xl shadow-primary/40 hover:scale-105 transition-all" {
|
|
44
|
+
text "Enter Portal"
|
|
45
|
+
}
|
|
46
|
+
a href="https://github.com/dev-omartolba" class="px-10 py-5 border border-white/10 text-zinc-500 font-bold uppercase tracking-widest text-xs rounded-2xl hover:bg-white/5 transition-all" {
|
|
47
|
+
text "Signal Terminal"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
36
50
|
}
|
|
37
|
-
}
|
|
38
51
|
}
|
|
39
52
|
|
|
40
|
-
//
|
|
41
|
-
section class="
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
// Infrastructure Visualizer
|
|
54
|
+
section class="py-32 px-8 relative" {
|
|
55
|
+
div class="max-w-7xl mx-auto grid md:grid-cols-3 gap-12" {
|
|
56
|
+
div class="p-10 rounded-3xl bg-zinc-950 border border-white/5 group hover:border-primary/50 transition-all" {
|
|
57
|
+
div class="text-primary text-4xl mb-6" { text "⚙️" }
|
|
58
|
+
h3 class="text-2xl font-black mb-4 italic tracking-tighter" { text "Convergence Core" }
|
|
59
|
+
p class="text-zinc-500 leading-relaxed" {
|
|
60
|
+
text "A unified runtime that automatically optimizes your components using industry-standard patterns from the Big Three."
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
div class="p-10 rounded-3xl bg-zinc-950 border border-white/5 group hover:border-primary/50 transition-all transform md:translate-y-12" {
|
|
64
|
+
div class="text-primary text-4xl mb-6" { text "🛡️" }
|
|
65
|
+
h3 class="text-2xl font-black mb-4 italic tracking-tighter" { text "Aura Firewall" }
|
|
66
|
+
p class="text-zinc-500 leading-relaxed" {
|
|
67
|
+
text "Real-time threat detection and surgical request filtering embedded directly into the framework's heartbeat."
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
div class="p-10 rounded-3xl bg-zinc-950 border border-white/5 group hover:border-primary/50 transition-all" {
|
|
71
|
+
div class="text-primary text-4xl mb-6" { text "🚀" }
|
|
72
|
+
h3 class="text-2xl font-black mb-4 italic tracking-tighter" { text "Hyper Speed" }
|
|
73
|
+
p class="text-zinc-500 leading-relaxed" {
|
|
74
|
+
text "Native Brotli compression and uWebSockets.js integration deliver sub-millisecond response times under heavy load."
|
|
75
|
+
}
|
|
76
|
+
}
|
|
49
77
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
p class="text-base text-zinc-500 leading-relaxed" { text "Partial hydration logic that ships minimal JavaScript for maximum SEO benefits." }
|
|
56
|
-
}
|
|
57
|
-
div class="card-pro" {
|
|
58
|
-
div class="w-10 h-10 rounded-lg bg-zinc-900 border border-border flex items-center justify-center mb-6" {
|
|
59
|
-
text "🛡️"
|
|
60
|
-
}
|
|
61
|
-
h3 class="text-xl font-bold mb-3" { text "Security" }
|
|
62
|
-
p class="text-base text-zinc-500 leading-relaxed" { text "Built-in DDoS protection, CSRF guards, and secure-by-default environment." }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
footer class="py-20 border-t border-white/5 text-center" {
|
|
81
|
+
p class="text-[10px] font-black uppercase tracking-[.6em] text-zinc-700" {
|
|
82
|
+
text "FREE ULTRA © 2026. ALL PROTOCOLS VERIFIED."
|
|
63
83
|
}
|
|
64
|
-
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
style {
|
|
87
|
+
h1 { text-shadow: 0 20px 80px rgba(59, 130, 246, 0.2); }
|
|
88
|
+
.bg-primary { background-color: #3b82f6; }
|
|
89
|
+
.text-primary { color: #3b82f6; }
|
|
65
90
|
}
|
|
66
91
|
}
|
|
67
92
|
}
|