free-framework 4.4.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/LICENSE +21 -0
- package/README.md +198 -0
- package/bin/free.js +118 -0
- package/cli/commands/build.js +124 -0
- package/cli/commands/deploy.js +143 -0
- package/cli/commands/devtools.js +210 -0
- package/cli/commands/doctor.js +72 -0
- package/cli/commands/install.js +28 -0
- package/cli/commands/make.js +74 -0
- package/cli/commands/migrate.js +67 -0
- package/cli/commands/new.js +54 -0
- package/cli/commands/serve.js +73 -0
- package/cli/commands/test.js +57 -0
- package/compiler/analyzer.js +102 -0
- package/compiler/generator.js +386 -0
- package/compiler/lexer.js +166 -0
- package/compiler/parser.js +410 -0
- package/database/model.js +6 -0
- package/database/orm.js +379 -0
- package/database/query-builder.js +179 -0
- package/index.js +51 -0
- package/package.json +80 -0
- package/plugins/auth.js +212 -0
- package/plugins/cache.js +85 -0
- package/plugins/chat.js +32 -0
- package/plugins/mail.js +53 -0
- package/plugins/metrics.js +126 -0
- package/plugins/payments.js +59 -0
- package/plugins/queue.js +139 -0
- package/plugins/search.js +51 -0
- package/plugins/storage.js +123 -0
- package/plugins/upload.js +62 -0
- package/router/router.js +57 -0
- package/runtime/app.js +14 -0
- package/runtime/client.js +254 -0
- package/runtime/cluster.js +35 -0
- package/runtime/edge.js +62 -0
- package/runtime/middleware/maintenance.js +54 -0
- package/runtime/middleware/security.js +30 -0
- package/runtime/server.js +130 -0
- package/runtime/validator.js +102 -0
- package/runtime/views/error.free +104 -0
- package/runtime/views/maintenance.free +0 -0
- package/template-engine/renderer.js +24 -0
- package/templates/app-template/.env +23 -0
- package/templates/app-template/app/Exceptions/Handler.js +65 -0
- package/templates/app-template/app/Http/Controllers/AuthController.free +91 -0
- package/templates/app-template/app/Http/Middleware/AuthGuard.js +46 -0
- package/templates/app-template/app/Services/Storage.js +75 -0
- package/templates/app-template/app/Services/Validator.js +91 -0
- package/templates/app-template/app/controllers/AuthController.free +42 -0
- package/templates/app-template/app/middleware/auth.js +25 -0
- package/templates/app-template/app/models/User.free +32 -0
- package/templates/app-template/app/routes.free +12 -0
- package/templates/app-template/app/styles.css +23 -0
- package/templates/app-template/app/views/counter.free +23 -0
- package/templates/app-template/app/views/header.free +13 -0
- package/templates/app-template/config/app.js +32 -0
- package/templates/app-template/config/auth.js +39 -0
- package/templates/app-template/config/database.js +54 -0
- package/templates/app-template/package.json +28 -0
- package/templates/app-template/resources/css/app.css +11 -0
- package/templates/app-template/resources/views/dashboard.free +25 -0
- package/templates/app-template/resources/views/home.free +26 -0
- package/templates/app-template/routes/api.free +22 -0
- package/templates/app-template/routes/web.free +25 -0
- package/templates/app-template/tailwind.config.js +21 -0
- package/templates/app-template/views/about.ejs +47 -0
- package/templates/app-template/views/home.ejs +52 -0
- package/templates/auth/login.html +144 -0
- package/templates/auth/register.html +146 -0
- package/utils/logger.js +20 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<title>Register</title>
|
|
7
|
+
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&display=swap" rel="stylesheet">
|
|
8
|
+
<style>
|
|
9
|
+
* {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
min-height: 100vh;
|
|
17
|
+
background: #050505;
|
|
18
|
+
color: white;
|
|
19
|
+
font-family: 'Outfit', sans-serif;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.card {
|
|
27
|
+
background: #111;
|
|
28
|
+
border: 1px solid #222;
|
|
29
|
+
border-radius: 20px;
|
|
30
|
+
padding: 3rem;
|
|
31
|
+
width: 100%;
|
|
32
|
+
max-width: 400px
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h1 {
|
|
36
|
+
font-size: 2rem;
|
|
37
|
+
font-weight: 900;
|
|
38
|
+
margin-bottom: 0.5rem;
|
|
39
|
+
background: linear-gradient(90deg, #00bdff, #00ff88);
|
|
40
|
+
-webkit-background-clip: text;
|
|
41
|
+
-webkit-text-fill-color: transparent
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
p {
|
|
45
|
+
color: #666;
|
|
46
|
+
margin-bottom: 2rem;
|
|
47
|
+
font-size: 0.9rem
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
input {
|
|
51
|
+
width: 100%;
|
|
52
|
+
padding: 1rem;
|
|
53
|
+
border-radius: 10px;
|
|
54
|
+
background: #000;
|
|
55
|
+
border: 1px solid #333;
|
|
56
|
+
color: white;
|
|
57
|
+
margin-bottom: 1rem;
|
|
58
|
+
font-size: 1rem;
|
|
59
|
+
outline: none;
|
|
60
|
+
transition: 0.2s
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
input:focus {
|
|
64
|
+
border-color: #00bdff
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
button {
|
|
68
|
+
width: 100%;
|
|
69
|
+
padding: 1rem;
|
|
70
|
+
background: #00bdff;
|
|
71
|
+
color: #fff;
|
|
72
|
+
font-weight: 900;
|
|
73
|
+
border: none;
|
|
74
|
+
border-radius: 10px;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
font-size: 1rem;
|
|
77
|
+
transition: 0.2s
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
button:hover {
|
|
81
|
+
background: #00aaee
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.footer {
|
|
85
|
+
margin-top: 1.5rem;
|
|
86
|
+
text-align: center;
|
|
87
|
+
color: #555;
|
|
88
|
+
font-size: 0.9rem
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
a {
|
|
92
|
+
color: #00bdff;
|
|
93
|
+
text-decoration: none
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.err {
|
|
97
|
+
background: #ff336622;
|
|
98
|
+
border: 1px solid #ff3366;
|
|
99
|
+
color: #ff3366;
|
|
100
|
+
padding: 0.8rem;
|
|
101
|
+
border-radius: 8px;
|
|
102
|
+
margin-bottom: 1rem;
|
|
103
|
+
font-size: 0.9rem;
|
|
104
|
+
display: none
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
107
|
+
</head>
|
|
108
|
+
|
|
109
|
+
<body>
|
|
110
|
+
<div class="card">
|
|
111
|
+
<h1>Create account</h1>
|
|
112
|
+
<p>Join today and start managing your notes</p>
|
|
113
|
+
<div class="err" id="err"></div>
|
|
114
|
+
<form onsubmit="doRegister(event)">
|
|
115
|
+
<input type="text" id="name" placeholder="Full Name" required>
|
|
116
|
+
<input type="email" id="email" placeholder="Email" required>
|
|
117
|
+
<input type="password" id="password" placeholder="Password" required>
|
|
118
|
+
<button type="submit">Create Account</button>
|
|
119
|
+
</form>
|
|
120
|
+
<div class="footer">Already have an account? <a href="{{loginPath}}">Login →</a></div>
|
|
121
|
+
</div>
|
|
122
|
+
<script>
|
|
123
|
+
async function doRegister(e) {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
const r = await fetch('/_free/auth/register', {
|
|
126
|
+
method: 'POST',
|
|
127
|
+
headers: { 'Content-Type': 'application/json' },
|
|
128
|
+
body: JSON.stringify({
|
|
129
|
+
name: document.getElementById('name').value,
|
|
130
|
+
email: document.getElementById('email').value,
|
|
131
|
+
password: document.getElementById('password').value
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
const d = await r.json();
|
|
135
|
+
if (d.success) {
|
|
136
|
+
window.location = '/dashboard';
|
|
137
|
+
} else {
|
|
138
|
+
const el = document.getElementById('err');
|
|
139
|
+
el.textContent = d.error || 'Registration failed';
|
|
140
|
+
el.style.display = 'block';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</script>
|
|
144
|
+
</body>
|
|
145
|
+
|
|
146
|
+
</html>
|
package/utils/logger.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* utils/logger.js
|
|
3
|
+
* Professional structured logger for Free Framework using Pino.
|
|
4
|
+
*/
|
|
5
|
+
const pino = require('pino');
|
|
6
|
+
|
|
7
|
+
const isDev = process.env.APP_ENV !== 'production' && process.env.NODE_ENV !== 'production';
|
|
8
|
+
|
|
9
|
+
const logger = pino({
|
|
10
|
+
level: process.env.LOG_LEVEL || 'info',
|
|
11
|
+
transport: isDev ? {
|
|
12
|
+
target: 'pino-pretty',
|
|
13
|
+
options: {
|
|
14
|
+
colorize: true,
|
|
15
|
+
translateTime: 'SYS:standard'
|
|
16
|
+
}
|
|
17
|
+
} : undefined // In production, we use structured JSON logging
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
module.exports = { logger };
|