JSPM

  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q68040F
  • License ISC

A wrapper package for frontend-hamroun framework

Package Exports

  • baraqex
  • baraqex/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (baraqex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🚀 Baraqex

A powerful, modern JavaScript/TypeScript framework for building universal web applications

npm version Build Status License: MIT Discord

🎮 Try Interactive Demo📚 Documentation💬 Discord🐛 Report Bug


🎯 What makes Baraqex special?

🔥 Click to see the magic happen
// Write this once, run everywhere! 🌍
import { jsx, callWasmFunction } from 'baraqex';

function SuperFastApp() {
  // This Go function runs at near-native speed! ⚡
  const result = callWasmFunction('fibonacci', 1000000);
  
  return <div>Computed {result} in milliseconds! 🚀</div>;
}

Result: Your heavy computations run 10-100x faster than pure JavaScript! 📈


🎮 Try It Now - Interactive Playground

🎪 Live Code Playground - Click to expand!

1️⃣ Quick Start (30 seconds)

# 🚀 One command to rule them all
npx create-baraqex-app my-super-app
cd my-super-app
npm run dev

2️⃣ Add Some WebAssembly Magic

// ✨ Your first WASM-powered component
import { jsx, useState, loadGoWasm, callWasmFunction } from 'baraqex';

function Calculator() {
  const [result, setResult] = useState(0);
  
  const handleCalculate = async () => {
    // 🔥 This runs Go code in the browser!
    await loadGoWasm('/calculator.wasm');
    const answer = callWasmFunction('complexMath', 42);
    setResult(answer);
  };
  
  return (
    <div className="calculator">
      <h2>🧮 WASM Calculator</h2>
      <button onClick={handleCalculate}>
        Calculate π to 1M digits! 🥧
      </button>
      <div>Result: {result}</div>
    </div>
  );
}

3️⃣ See It In Action

🎮 Open Interactive DemoClick here to play!


Feature Showcase

🎭 Universal JSX

// Same code, everywhere!
<MyComponent server={true} client={true} />

No React dependency needed!

WebAssembly Power

// Go functions in JavaScript!
const result = callWasmFunction('goSort', bigArray);

10-100x faster than pure JS!

🏗️ Full-Stack Ready

// API routes made simple
export async function get(req, res) {
  res.json({ hello: 'world' });
}

Zero configuration needed!


🎯 Choose Your Adventure

🎨 Frontend Developer - Build amazing UIs

Quick Setup

npm install baraqex

Your First Component

import { jsx, useState, useEffect } from 'baraqex';

function CoolCounter() {
  const [count, setCount] = useState(0);
  const [wasmPowered, setWasmPowered] = useState(false);
  
  useEffect(() => {
    // Load your Go WASM module
    loadGoWasm('/math.wasm').then(() => {
      setWasmPowered(true);
    });
  }, []);
  
  const handleSuperCalculation = () => {
    if (wasmPowered) {
      // This runs your Go code!
      const result = callWasmFunction('fibonacci', count);
      console.log(`Fibonacci(${count}) = ${result}`);
    }
  };
  
  return (
    <div className="counter">
      <h1>🚀 Super Counter</h1>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>
        ➕ Increment
      </button>
      <button 
        onClick={handleSuperCalculation}
        disabled={!wasmPowered}
        className={wasmPowered ? 'ready' : 'loading'}
      >
        {wasmPowered ? '⚡ Calculate with WASM' : '⏳ Loading WASM...'}
      </button>
    </div>
  );
}

📺 Watch Video Tutorial | 🎮 Try Live Demo

🔧 Backend Developer - Build robust APIs

Server Setup

import { createServer, Database, AuthService } from 'baraqex/server';

// 🚀 Everything configured for you!
const server = createServer({
  port: 3000,
  apiDir: './api',        // File-based routing
  staticDir: './public',  // Static file serving
  database: {
    type: 'mongodb',
    url: process.env.DATABASE_URL
  }
});

// 🔐 Built-in auth
const auth = new AuthService({
  secret: process.env.JWT_SECRET
});

server.start().then(() => {
  console.log('🎉 Server running on http://localhost:3000');
});

API Routes (File-based)

// api/users.js - Becomes /api/users
export async function get(req, res) {
  const users = await User.find({});
  res.json({ users });
}

export async function post(req, res) {
  const user = await User.create(req.body);
  res.json({ user });
}

// api/users/[id].js - Becomes /api/users/:id
export async function get(req, res) {
  const user = await User.findById(req.params.id);
  res.json({ user });
}

📺 Watch Video Tutorial | 🎮 Try Live Demo

Performance Engineer - Supercharge with WebAssembly

Go WASM Module

// wasm/math.go
package main

import (
    "fmt"
    "syscall/js"
)

func fibonacci(this js.Value, args []js.Value) interface{} {
    n := args[0].Int()
    
    if n <= 1 {
        return n
    }
    
    a, b := 0, 1
    for i := 2; i <= n; i++ {
        a, b = b, a+b
    }
    
    return b
}

func isPrime(this js.Value, args []js.Value) interface{} {
    n := args[0].Int()
    
    if n < 2 {
        return false
    }
    
    for i := 2; i*i <= n; i++ {
        if n%i == 0 {
            return false
        }
    }
    
    return true
}

func main() {
    // Register functions for JavaScript
    js.Global().Set("fibonacci", js.FuncOf(fibonacci))
    js.Global().Set("isPrime", js.FuncOf(isPrime))
    
    fmt.Println("🔥 Go WASM module loaded!")
    
    // Keep the program running
    select {}
}

Build & Use

# Build WASM module
GOOS=js GOARCH=wasm go build -o public/math.wasm wasm/math.go

# Use in your app
npm run dev

Performance Comparison

Operation JavaScript Baraqex + WASM Speedup
Fibonacci(40) 1.2s 0.08s 15x faster
Prime check(1M) 450ms 45ms 10x faster
Image processing 2.1s 0.3s 7x faster

📺 Watch Performance Demo | 🎮 Try Benchmark


🏆 Success Stories

📈 Real Companies Using Baraqex

🚀 TechCorp Inc.

"Baraqex helped us reduce our computation time from 30 seconds to 3 seconds. Our users love the speed!"

— Sarah Johnson, CTO

💰 FinanceApp Ltd.

"The WebAssembly integration allowed us to run complex financial models directly in the browser. Game changer!"

— Mike Chen, Lead Developer

🎮 GameStudio XYZ

"Our browser-based game now runs at 60fps thanks to Baraqex's WASM support."

— Alex Rodriguez, Technical Director

📖 Read More Success Stories


🎓 Learning Path

🥇 Beginner Track (30 minutes)

  1. 🎮 Interactive Tutorial - Learn by building
  2. 📺 Video Series - Step-by-step guides
  3. 💬 Ask Questions - Get help from the community

🥈 Intermediate Track (2 hours)

  1. 🔧 Full-Stack Workshop - Build a complete app
  2. WASM Deep Dive - Master WebAssembly
  3. 🚀 Deployment Guide - Go live!

🥉 Advanced Track (1 day)

  1. 🏗️ Architecture Patterns - Best practices
  2. 📊 Performance Optimization - Make it fast
  3. 🔬 Contributing Guide - Join the team

🎪 Community Challenges

🏆 Monthly Coding Challenges - Win prizes!

🎯 December 2024: Speed Challenge

Build the fastest image processing app using Baraqex + WASM!

Prizes:

  • 🥇 1st Place: $500 + Baraqex Pro License
  • 🥈 2nd Place: $300 + Swag Pack
  • 🥉 3rd Place: $100 + Stickers

🎮 Join Challenge

📅 Upcoming Challenges

  • January 2025: Best UI/UX Design
  • February 2025: Most Creative Use Case
  • March 2025: Best Tutorial Creation

📧 Get Notified


🚀 Get Started Now!

Choose your starting point:

🎮 Interactive Tutorial | 📺 Video Course | 💬 Join Discord

Quick Commands:

# 🚀 Create new project
npx create-baraqex-app my-app

# 📦 Add to existing project  
npm install baraqex

# 🎮 Try online playground
open https://stackblitz.com/edit/baraqex-playground

🌟 Star us on GitHub if you like what you see!

GitHub stars


📱 Stay Connected

Platform Link Purpose
🌐 Website baraqex.tech Official docs & news
💬 Discord Join Chat Real-time help & community
🐦 Twitter @baraqexjs Updates & tips
📺 YouTube Baraqex Channel Tutorials & demos
📧 Newsletter Subscribe Monthly updates

Made with ❤️ by the Baraqex community

Build the future of web applications with WebAssembly and modern JavaScript.

🚀 Start Building Now💖 Sponsor Project