baraqex 1.0.47 โ 1.0.49
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/dist/index.js +236 -189
- package/dist/index.js.map +4 -4
- package/dist/server.js +1282 -864
- package/dist/server.js.map +4 -4
- package/package.json +1 -1
- package/templates/fullstack-template/package-lock.json +931 -4
- package/templates/fullstack-template/package.json +7 -5
- package/templates/fullstack-template/server.js +548 -15
- package/templates/fullstack-template/src/api/hello.js +9 -11
- package/templates/fullstack-template/src/pages/index.js +196 -114
- package/templates/fullstack-app/package-lock.json +0 -3683
- package/templates/fullstack-app/package.json +0 -26
- package/templates/fullstack-app/public/client.js +0 -139
- package/templates/fullstack-app/public/fullstack-styles.css +0 -445
- package/templates/fullstack-app/server.js +0 -32
- package/templates/fullstack-app/src/api/auth.js +0 -48
- package/templates/fullstack-app/src/api/users.js +0 -85
- package/templates/fullstack-app/src/pages/index.js +0 -0
- package/templates/fullstack-app/src/pages/index.jsx +0 -181
- package/templates/fullstack-app/src/pages/login.js +0 -139
- package/templates/fullstack-app/src/pages/login.jsx +0 -150
- package/templates/fullstack-template/public/client.js +0 -17
- package/templates/fullstack-template/src/api/users/index.js +0 -43
- package/templates/go-wasm-app/package.json +0 -24
- package/templates/go-wasm-app/public/wasm-styles.css +0 -184
- package/templates/go-wasm-app/server.js +0 -36
- package/templates/go-wasm-app/src/pages/index.jsx +0 -161
- package/templates/go-wasm-app/src/wasm/main.go +0 -164
|
@@ -1,124 +1,206 @@
|
|
|
1
|
-
import { jsx } from '
|
|
1
|
+
import { jsx, useState } from 'frontend-hamroun';
|
|
2
2
|
|
|
3
3
|
export default function HomePage(props) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const [count, setCount] = useState(0);
|
|
5
|
+
|
|
6
|
+
return jsx('div', {
|
|
7
|
+
style: {
|
|
8
|
+
padding: '2rem',
|
|
9
|
+
textAlign: 'center',
|
|
10
|
+
fontFamily: 'system-ui',
|
|
7
11
|
maxWidth: '800px',
|
|
8
|
-
margin: '0 auto'
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
margin: '0 auto'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
jsx('h1', {
|
|
16
|
+
style: {
|
|
17
|
+
color: '#2c3e50',
|
|
18
|
+
marginBottom: '1rem',
|
|
19
|
+
fontSize: '2.5rem'
|
|
20
|
+
}
|
|
21
|
+
}, 'Welcome to Your Baraqex Full-Stack App! ๐'),
|
|
22
|
+
|
|
23
|
+
jsx('div', {
|
|
24
|
+
style: {
|
|
25
|
+
background: '#f8f9fa',
|
|
26
|
+
padding: '2rem',
|
|
27
|
+
borderRadius: '12px',
|
|
28
|
+
margin: '2rem 0',
|
|
29
|
+
border: '1px solid #dee2e6'
|
|
30
|
+
}
|
|
11
31
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
jsx('p', {
|
|
33
|
+
style: {
|
|
34
|
+
fontSize: '1.5rem',
|
|
35
|
+
fontWeight: 'bold',
|
|
36
|
+
color: '#495057',
|
|
37
|
+
margin: '0 0 1rem 0'
|
|
38
|
+
}
|
|
39
|
+
}, `Counter: ${count}`),
|
|
17
40
|
|
|
18
|
-
jsx('
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
jsx('div', { style: { margin: '1rem 0' } },
|
|
42
|
+
jsx('button', {
|
|
43
|
+
onclick: () => setCount(count + 1),
|
|
44
|
+
style: {
|
|
45
|
+
padding: '0.75rem 1.5rem',
|
|
46
|
+
margin: '0.5rem',
|
|
47
|
+
background: '#007acc',
|
|
48
|
+
color: 'white',
|
|
49
|
+
border: 'none',
|
|
50
|
+
borderRadius: '6px',
|
|
51
|
+
cursor: 'pointer',
|
|
52
|
+
fontSize: '1rem',
|
|
53
|
+
fontWeight: '500',
|
|
54
|
+
transition: 'all 0.2s ease'
|
|
55
|
+
}
|
|
56
|
+
}, 'Increment'),
|
|
57
|
+
jsx('button', {
|
|
58
|
+
onclick: () => setCount(count - 1),
|
|
59
|
+
style: {
|
|
60
|
+
padding: '0.75rem 1.5rem',
|
|
61
|
+
margin: '0.5rem',
|
|
62
|
+
background: '#e74c3c',
|
|
63
|
+
color: 'white',
|
|
64
|
+
border: 'none',
|
|
65
|
+
borderRadius: '6px',
|
|
66
|
+
cursor: 'pointer',
|
|
67
|
+
fontSize: '1rem',
|
|
68
|
+
fontWeight: '500',
|
|
69
|
+
transition: 'all 0.2s ease'
|
|
70
|
+
}
|
|
71
|
+
}, 'Decrement'),
|
|
72
|
+
jsx('button', {
|
|
73
|
+
onclick: () => setCount(0),
|
|
74
|
+
style: {
|
|
75
|
+
padding: '0.75rem 1.5rem',
|
|
76
|
+
margin: '0.5rem',
|
|
77
|
+
background: '#95a5a6',
|
|
78
|
+
color: 'white',
|
|
79
|
+
border: 'none',
|
|
80
|
+
borderRadius: '6px',
|
|
81
|
+
cursor: 'pointer',
|
|
82
|
+
fontSize: '1rem',
|
|
83
|
+
fontWeight: '500',
|
|
84
|
+
transition: 'all 0.2s ease'
|
|
85
|
+
}
|
|
86
|
+
}, 'Reset')
|
|
87
|
+
)
|
|
88
|
+
),
|
|
89
|
+
|
|
90
|
+
jsx('div', {
|
|
91
|
+
style: {
|
|
92
|
+
marginTop: '2rem',
|
|
93
|
+
padding: '1.5rem',
|
|
94
|
+
background: '#e8f5e8',
|
|
95
|
+
borderRadius: '8px',
|
|
96
|
+
border: '1px solid #c3e6c3'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
jsx('h3', {
|
|
100
|
+
style: {
|
|
101
|
+
margin: '0 0 1rem 0',
|
|
102
|
+
color: '#155724'
|
|
103
|
+
}
|
|
104
|
+
}, '๐ฏ Features Included:'),
|
|
105
|
+
jsx('ul', {
|
|
106
|
+
style: {
|
|
107
|
+
textAlign: 'left',
|
|
108
|
+
maxWidth: '500px',
|
|
109
|
+
margin: '0 auto',
|
|
110
|
+
listStyle: 'none',
|
|
111
|
+
padding: 0
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
jsx('li', {
|
|
115
|
+
style: {
|
|
116
|
+
padding: '0.5rem 0',
|
|
117
|
+
borderBottom: '1px solid rgba(0,0,0,0.1)'
|
|
118
|
+
}
|
|
119
|
+
}, 'โ
Server-side rendering with ESBuild'),
|
|
120
|
+
jsx('li', {
|
|
121
|
+
style: {
|
|
122
|
+
padding: '0.5rem 0',
|
|
123
|
+
borderBottom: '1px solid rgba(0,0,0,0.1)'
|
|
124
|
+
}
|
|
125
|
+
}, 'โ
API routes in src/api/'),
|
|
126
|
+
jsx('li', {
|
|
127
|
+
style: {
|
|
128
|
+
padding: '0.5rem 0',
|
|
129
|
+
borderBottom: '1px solid rgba(0,0,0,0.1)'
|
|
130
|
+
}
|
|
131
|
+
}, 'โ
Page-based routing'),
|
|
132
|
+
jsx('li', {
|
|
133
|
+
style: {
|
|
134
|
+
padding: '0.5rem 0',
|
|
135
|
+
borderBottom: '1px solid rgba(0,0,0,0.1)'
|
|
136
|
+
}
|
|
137
|
+
}, 'โ
Client-side hydration'),
|
|
138
|
+
jsx('li', {
|
|
139
|
+
style: {
|
|
140
|
+
padding: '0.5rem 0'
|
|
141
|
+
}
|
|
142
|
+
}, 'โ
Frontend Hamroun hooks')
|
|
143
|
+
)
|
|
144
|
+
),
|
|
145
|
+
|
|
146
|
+
jsx('div', {
|
|
147
|
+
style: {
|
|
148
|
+
marginTop: '2rem',
|
|
149
|
+
padding: '1.5rem',
|
|
150
|
+
background: '#fff3cd',
|
|
151
|
+
borderRadius: '8px',
|
|
152
|
+
border: '1px solid #ffeaa7'
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
jsx('h3', {
|
|
24
156
|
style: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
children: [
|
|
31
|
-
jsx('div', {
|
|
32
|
-
style: {
|
|
33
|
-
border: '1px solid #ddd',
|
|
34
|
-
borderRadius: '8px',
|
|
35
|
-
padding: '20px',
|
|
36
|
-
backgroundColor: '#f9f9f9'
|
|
37
|
-
},
|
|
38
|
-
children: [
|
|
39
|
-
jsx('h3', { children: '๐ก API Routes' }),
|
|
40
|
-
jsx('p', { children: 'Your API endpoints are ready:' }),
|
|
41
|
-
jsx('ul', {
|
|
42
|
-
children: [
|
|
43
|
-
jsx('li', { children: jsx('code', { children: 'GET /api/hello' }) }),
|
|
44
|
-
jsx('li', { children: jsx('code', { children: 'POST /api/hello' }) }),
|
|
45
|
-
jsx('li', { children: jsx('code', { children: 'GET /api/users' }) }),
|
|
46
|
-
jsx('li', { children: jsx('code', { children: 'POST /api/users' }) })
|
|
47
|
-
]
|
|
48
|
-
})
|
|
49
|
-
]
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
jsx('div', {
|
|
53
|
-
style: {
|
|
54
|
-
border: '1px solid #ddd',
|
|
55
|
-
borderRadius: '8px',
|
|
56
|
-
padding: '20px',
|
|
57
|
-
backgroundColor: '#f9f9f9'
|
|
58
|
-
},
|
|
59
|
-
children: [
|
|
60
|
-
jsx('h3', { children: '๐ Server-Side Rendering' }),
|
|
61
|
-
jsx('p', { children: 'This page is rendered on the server!' }),
|
|
62
|
-
jsx('p', {
|
|
63
|
-
children: `Server time: ${props.api?.serverTime || 'N/A'}`
|
|
64
|
-
})
|
|
65
|
-
]
|
|
66
|
-
}),
|
|
67
|
-
|
|
68
|
-
jsx('div', {
|
|
69
|
-
style: {
|
|
70
|
-
border: '1px solid #ddd',
|
|
71
|
-
borderRadius: '8px',
|
|
72
|
-
padding: '20px',
|
|
73
|
-
backgroundColor: '#f9f9f9'
|
|
74
|
-
},
|
|
75
|
-
children: [
|
|
76
|
-
jsx('h3', { children: '๐ ๏ธ Features' }),
|
|
77
|
-
jsx('ul', {
|
|
78
|
-
children: [
|
|
79
|
-
jsx('li', { children: 'Express.js backend' }),
|
|
80
|
-
jsx('li', { children: 'File-based API routing' }),
|
|
81
|
-
jsx('li', { children: 'Server-side rendering' }),
|
|
82
|
-
jsx('li', { children: 'Static file serving' }),
|
|
83
|
-
jsx('li', { children: 'CORS enabled' })
|
|
84
|
-
]
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
})
|
|
88
|
-
]
|
|
89
|
-
}),
|
|
90
|
-
|
|
157
|
+
margin: '0 0 1rem 0',
|
|
158
|
+
color: '#856404'
|
|
159
|
+
}
|
|
160
|
+
}, '๐ Quick Links:'),
|
|
91
161
|
jsx('div', {
|
|
92
162
|
style: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
163
|
+
display: 'flex',
|
|
164
|
+
gap: '1rem',
|
|
165
|
+
justifyContent: 'center',
|
|
166
|
+
flexWrap: 'wrap'
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
jsx('a', {
|
|
170
|
+
href: '/api/hello',
|
|
171
|
+
style: {
|
|
172
|
+
padding: '0.5rem 1rem',
|
|
173
|
+
background: '#17a2b8',
|
|
174
|
+
color: 'white',
|
|
175
|
+
textDecoration: 'none',
|
|
176
|
+
borderRadius: '4px',
|
|
177
|
+
fontSize: '0.9rem'
|
|
178
|
+
}
|
|
179
|
+
}, 'API Hello'),
|
|
180
|
+
jsx('a', {
|
|
181
|
+
href: '/api-docs',
|
|
182
|
+
style: {
|
|
183
|
+
padding: '0.5rem 1rem',
|
|
184
|
+
background: '#6f42c1',
|
|
185
|
+
color: 'white',
|
|
186
|
+
textDecoration: 'none',
|
|
187
|
+
borderRadius: '4px',
|
|
188
|
+
fontSize: '0.9rem'
|
|
189
|
+
}
|
|
190
|
+
}, 'API Docs')
|
|
191
|
+
)
|
|
192
|
+
),
|
|
193
|
+
|
|
194
|
+
jsx('p', {
|
|
195
|
+
style: {
|
|
196
|
+
marginTop: '2rem',
|
|
197
|
+
color: '#6c757d',
|
|
198
|
+
fontSize: '0.9rem'
|
|
199
|
+
}
|
|
200
|
+
}, 'Edit src/pages/index.js to customize this page')
|
|
201
|
+
);
|
|
120
202
|
}
|
|
121
203
|
|
|
122
|
-
// Optional: Add metadata for
|
|
123
|
-
HomePage.
|
|
124
|
-
HomePage.
|
|
204
|
+
// Optional: Add metadata for SEO
|
|
205
|
+
HomePage.title = 'Baraqex Full-Stack App';
|
|
206
|
+
HomePage.description = 'A complete full-stack application built with Baraqex framework';
|