UNPKG

baraqex

Version:

A powerful full-stack framework for modern web development

167 lines (119 loc) • 4.28 kB
# 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! šŸš€**