baraqex
Version:
A powerful full-stack framework for modern web development
167 lines (119 loc) ⢠4.28 kB
Markdown
# Baraqex Basic App Template
A comprehensive demonstration of the Baraqex framework featuring all major capabilities and beautiful Tailwind CSS styling.
## š What's Included
This template showcases:
- **State Management**: useState, useEffect, useMemo, useRef hooks
- **Error Boundaries**: useErrorBoundary for graceful error handling
- **Context API**: createContext and useContext for state sharing
- **Interactive Components**: Counter, Todo List, Error Testing
- **Responsive Design**: Tailwind CSS with dark/light mode
- **Performance Optimizations**: Memoization and efficient re-rendering
## šÆ Features Demo
### Counter Component
- State management with useState
- Effect tracking with useEffect
- Performance optimization with useMemo
- Render counting with useRef
### Todo List Component
- Complex state operations (add, toggle, delete)
- Form handling and validation
- Progress tracking
- List rendering optimization
### Error Boundary Test
- Error boundary implementation
- Graceful error recovery
- User-friendly error messages
### Context API Demo
- Theme switching across components
- Global state management
- Provider/Consumer pattern
## šØ Styling
- **Tailwind CSS**: Utility-first CSS framework
- **Custom Components**: Reusable button, card, and input styles
- **Responsive Design**: Mobile-first approach
- **Dark Mode**: Full theme switching support
- **Animations**: Smooth transitions and hover effects
## š Project Structure
```
src/
āāā main.tsx # Main application component
āāā main.css # Tailwind CSS imports and custom styles
āāā App.jsx # Alternative app component structure
public/
āāā logo.png # Baraqex logo (add your own)
āāā index.html # HTML template
dist/
āāā bundle.js # Compiled JavaScript
āāā main.css # Compiled CSS
```
## š ļø Development
```bash
# Install dependencies
npm install
# Start development server with hot reload
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
```
## š About Baraqex
Baraqex is a powerful full-stack framework built on Frontend Hamroun that provides:
- ā” **Reactive State Management**: Intuitive hooks API
- š **Server-Side Rendering**: SEO-friendly and fast loading
- š **WebAssembly Support**: High-performance computing
- š”ļø **Built-in Security**: Authentication and validation
- š¦ **Zero Configuration**: Works out of the box
- šÆ **TypeScript Ready**: Full type safety support
## š§ Customization
### Adding Components
Create new components following the established pattern:
```tsx
import { jsx, useState } from 'baraqex';
function MyComponent() {
const [state, setState] = useState('initial');
return (
<div className="card">
<h3>My Component</h3>
<p>State: {state}</p>
</div>
);
}
```
### Styling Guidelines
Use the established Tailwind classes and custom components:
```tsx
// Buttons
<button className="btn btn-primary">Primary Action</button>
<button className="btn btn-secondary">Secondary Action</button>
// Cards
<div className="card">Content here</div>
// Inputs
<input className="input" placeholder="Enter text..." />
```
### Adding New Features
1. Create component in `src/`
2. Import and use in `main.tsx`
3. Add to navigation if needed
4. Test error boundaries
5. Ensure responsive design
## š Deployment
The built application can be deployed to any static hosting service:
```bash
# Build production files
npm run build
# Deploy the dist/ folder contents
```
**Deployment Options:**
- Vercel: `vercel --prod`
- Netlify: Drag & drop the project folder
- GitHub Pages: Push to `gh-pages` branch
- Any static host: Upload `dist/` contents
## š Learn More
- [Baraqex Documentation](https://www.baraqex.tech/docs)
- [Frontend Hamroun Hooks](https://frontend-hamroun.com/hooks)
- [Tailwind CSS Docs](https://tailwindcss.com/docs)
## š¤ Contributing
This template is part of the Baraqex framework. Contributions welcome!
---
**Happy coding with Baraqex! š**