baraqex 1.0.49 → 1.0.51
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 +189 -251
- package/dist/index.js.map +4 -4
- package/dist/server.js +849 -1282
- package/dist/server.js.map +4 -4
- package/package.json +1 -1
- package/templates/basic-app/.eslintignore +5 -0
- package/templates/basic-app/.eslintrc.json +25 -0
- package/templates/basic-app/README.md +166 -0
- package/templates/basic-app/esbuild.config.js +37 -0
- package/templates/basic-app/favicon.ico +0 -0
- package/templates/basic-app/index.html +13 -0
- package/templates/basic-app/main.css +3 -0
- package/templates/basic-app/package-lock.json +6856 -0
- package/templates/basic-app/package.json +31 -20
- package/templates/basic-app/postcss.config.js +6 -0
- package/templates/basic-app/public/logo.png +0 -0
- package/templates/basic-app/src/main.css +77 -0
- package/templates/basic-app/src/main.tsx +465 -0
- package/templates/basic-app/tailwind.config.js +38 -0
- package/templates/basic-app/tsconfig.json +13 -0
- package/templates/basic-app/vite.config.ts +8 -0
- package/templates/fullstack-template/package.json +5 -23
- package/templates/fullstack-template/server.js +11 -572
- package/templates/basic-app/public/index.html +0 -13
- package/templates/basic-app/public/styles.css +0 -158
- package/templates/basic-app/server.js +0 -15
- package/templates/basic-app/src/App.jsx +0 -68
- package/templates/basic-template/README.md +0 -24
- package/templates/basic-template/package.json +0 -13
- package/templates/basic-template/server.js +0 -36
- package/templates/fullstack-template/package-lock.json +0 -1895
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Baraqex Basic App Template
|
|
2
|
+
|
|
3
|
+
A comprehensive demonstration of the Baraqex framework featuring all major capabilities and beautiful Tailwind CSS styling.
|
|
4
|
+
|
|
5
|
+
## 🚀 What's Included
|
|
6
|
+
|
|
7
|
+
This template showcases:
|
|
8
|
+
|
|
9
|
+
- **State Management**: useState, useEffect, useMemo, useRef hooks
|
|
10
|
+
- **Error Boundaries**: useErrorBoundary for graceful error handling
|
|
11
|
+
- **Context API**: createContext and useContext for state sharing
|
|
12
|
+
- **Interactive Components**: Counter, Todo List, Error Testing
|
|
13
|
+
- **Responsive Design**: Tailwind CSS with dark/light mode
|
|
14
|
+
- **Performance Optimizations**: Memoization and efficient re-rendering
|
|
15
|
+
|
|
16
|
+
## 🎯 Features Demo
|
|
17
|
+
|
|
18
|
+
### Counter Component
|
|
19
|
+
- State management with useState
|
|
20
|
+
- Effect tracking with useEffect
|
|
21
|
+
- Performance optimization with useMemo
|
|
22
|
+
- Render counting with useRef
|
|
23
|
+
|
|
24
|
+
### Todo List Component
|
|
25
|
+
- Complex state operations (add, toggle, delete)
|
|
26
|
+
- Form handling and validation
|
|
27
|
+
- Progress tracking
|
|
28
|
+
- List rendering optimization
|
|
29
|
+
|
|
30
|
+
### Error Boundary Test
|
|
31
|
+
- Error boundary implementation
|
|
32
|
+
- Graceful error recovery
|
|
33
|
+
- User-friendly error messages
|
|
34
|
+
|
|
35
|
+
### Context API Demo
|
|
36
|
+
- Theme switching across components
|
|
37
|
+
- Global state management
|
|
38
|
+
- Provider/Consumer pattern
|
|
39
|
+
|
|
40
|
+
## 🎨 Styling
|
|
41
|
+
|
|
42
|
+
- **Tailwind CSS**: Utility-first CSS framework
|
|
43
|
+
- **Custom Components**: Reusable button, card, and input styles
|
|
44
|
+
- **Responsive Design**: Mobile-first approach
|
|
45
|
+
- **Dark Mode**: Full theme switching support
|
|
46
|
+
- **Animations**: Smooth transitions and hover effects
|
|
47
|
+
|
|
48
|
+
## 📁 Project Structure
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
src/
|
|
52
|
+
├── main.tsx # Main application component
|
|
53
|
+
├── main.css # Tailwind CSS imports and custom styles
|
|
54
|
+
└── App.jsx # Alternative app component structure
|
|
55
|
+
|
|
56
|
+
public/
|
|
57
|
+
├── logo.png # Baraqex logo (add your own)
|
|
58
|
+
└── index.html # HTML template
|
|
59
|
+
|
|
60
|
+
dist/
|
|
61
|
+
├── bundle.js # Compiled JavaScript
|
|
62
|
+
└── main.css # Compiled CSS
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 🛠️ Development
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Install dependencies
|
|
69
|
+
npm install
|
|
70
|
+
|
|
71
|
+
# Start development server with hot reload
|
|
72
|
+
npm run dev
|
|
73
|
+
|
|
74
|
+
# Build for production
|
|
75
|
+
npm run build
|
|
76
|
+
|
|
77
|
+
# Preview production build
|
|
78
|
+
npm run preview
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 📖 About Baraqex
|
|
82
|
+
|
|
83
|
+
Baraqex is a powerful full-stack framework built on Frontend Hamroun that provides:
|
|
84
|
+
|
|
85
|
+
- ⚡ **Reactive State Management**: Intuitive hooks API
|
|
86
|
+
- 🌐 **Server-Side Rendering**: SEO-friendly and fast loading
|
|
87
|
+
- 🔄 **WebAssembly Support**: High-performance computing
|
|
88
|
+
- 🛡️ **Built-in Security**: Authentication and validation
|
|
89
|
+
- 📦 **Zero Configuration**: Works out of the box
|
|
90
|
+
- 🎯 **TypeScript Ready**: Full type safety support
|
|
91
|
+
|
|
92
|
+
## 🔧 Customization
|
|
93
|
+
|
|
94
|
+
### Adding Components
|
|
95
|
+
|
|
96
|
+
Create new components following the established pattern:
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
import { jsx, useState } from 'baraqex';
|
|
100
|
+
|
|
101
|
+
function MyComponent() {
|
|
102
|
+
const [state, setState] = useState('initial');
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div className="card">
|
|
106
|
+
<h3>My Component</h3>
|
|
107
|
+
<p>State: {state}</p>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Styling Guidelines
|
|
114
|
+
|
|
115
|
+
Use the established Tailwind classes and custom components:
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
// Buttons
|
|
119
|
+
<button className="btn btn-primary">Primary Action</button>
|
|
120
|
+
<button className="btn btn-secondary">Secondary Action</button>
|
|
121
|
+
|
|
122
|
+
// Cards
|
|
123
|
+
<div className="card">Content here</div>
|
|
124
|
+
|
|
125
|
+
// Inputs
|
|
126
|
+
<input className="input" placeholder="Enter text..." />
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Adding New Features
|
|
130
|
+
|
|
131
|
+
1. Create component in `src/`
|
|
132
|
+
2. Import and use in `main.tsx`
|
|
133
|
+
3. Add to navigation if needed
|
|
134
|
+
4. Test error boundaries
|
|
135
|
+
5. Ensure responsive design
|
|
136
|
+
|
|
137
|
+
## 🚀 Deployment
|
|
138
|
+
|
|
139
|
+
The built application can be deployed to any static hosting service:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Build production files
|
|
143
|
+
npm run build
|
|
144
|
+
|
|
145
|
+
# Deploy the dist/ folder contents
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Deployment Options:**
|
|
149
|
+
- Vercel: `vercel --prod`
|
|
150
|
+
- Netlify: Drag & drop the project folder
|
|
151
|
+
- GitHub Pages: Push to `gh-pages` branch
|
|
152
|
+
- Any static host: Upload `dist/` contents
|
|
153
|
+
|
|
154
|
+
## 📚 Learn More
|
|
155
|
+
|
|
156
|
+
- [Baraqex Documentation](https://www.baraqex.tech/docs)
|
|
157
|
+
- [Frontend Hamroun Hooks](https://frontend-hamroun.com/hooks)
|
|
158
|
+
- [Tailwind CSS Docs](https://tailwindcss.com/docs)
|
|
159
|
+
|
|
160
|
+
## 🤝 Contributing
|
|
161
|
+
|
|
162
|
+
This template is part of the Baraqex framework. Contributions welcome!
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
**Happy coding with Baraqex! 🚀**
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
|
|
3
|
+
const isWatch = process.argv.includes('--watch');
|
|
4
|
+
|
|
5
|
+
const config = {
|
|
6
|
+
entryPoints: ['src/main.tsx'],
|
|
7
|
+
bundle: true,
|
|
8
|
+
outfile: 'dist/bundle.js',
|
|
9
|
+
format: 'esm',
|
|
10
|
+
platform: 'browser',
|
|
11
|
+
target: 'es2020',
|
|
12
|
+
minify: !isWatch,
|
|
13
|
+
sourcemap: isWatch,
|
|
14
|
+
define: {
|
|
15
|
+
'process.env.NODE_ENV': isWatch ? '"development"' : '"production"'
|
|
16
|
+
},
|
|
17
|
+
external: [],
|
|
18
|
+
loader: {
|
|
19
|
+
'.tsx': 'tsx',
|
|
20
|
+
'.ts': 'tsx',
|
|
21
|
+
'.jsx': 'jsx',
|
|
22
|
+
'.js': 'jsx',
|
|
23
|
+
'.css': 'css'
|
|
24
|
+
},
|
|
25
|
+
// Don't transform JSX since we're using jsx() function calls
|
|
26
|
+
jsx: 'preserve'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
if (isWatch) {
|
|
30
|
+
const ctx = await esbuild.context(config);
|
|
31
|
+
await ctx.watch();
|
|
32
|
+
console.log('👀 Watching for changes...');
|
|
33
|
+
console.log('📦 Bundle will be rebuilt automatically');
|
|
34
|
+
} else {
|
|
35
|
+
await esbuild.build(config);
|
|
36
|
+
console.log('✅ Build complete');
|
|
37
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
7
|
+
<title>My Frontend App</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body class="bg-gray-100 min-h-screen">
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|