
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
reactorjs-framework-cli
Advanced tools
A comprehensive JavaScript framework CLI for building web and native applications
ReactorJS is a comprehensive JavaScript framework that combines the best features from React, Next.js, Vue.js, and Angular with built-in support for Tailwind CSS, shadcn/ui components, and React Native compatibility. Build powerful web and mobile applications with a unified, elegant API.
getInitialProps# Install the CLI globally
npm install -g reactorjs-cli
# Create a new project
reactorjs create my-app
# Navigate to the project directory
cd my-app
# Install dependencies
npm install
# Start the development server
npm run dev
my-app/
├── src/
│ ├── app/
│ │ ├── components/ # Reusable components
│ │ ├── layouts/ # Page layouts
│ │ └── pages/ # Page components
│ ├── native/ # Native application
│ │ ├── components/ # Native components
│ │ └── screens/ # Native screens
│ └── styles/ # Global styles
├── public/ # Static assets
├── reactorjs.config.js # Framework configuration
├── tailwind.config.js # Tailwind CSS configuration
└── package.json # Project dependencies
import ReactorJS from 'reactorjs';
// Class Component
class Counter extends ReactorJS.Component {
constructor(props) {
super(props);
this.state = { count: 0 };
}
increment = () => {
this.setState({ count: this.state.count + 1 });
}
render() {
return (
<div className="p-4 bg-white rounded shadow">
<h2 className="text-xl font-bold mb-2">Counter: {this.state.count}</h2>
<button
className="px-4 py-2 bg-primary text-white rounded"
onClick={this.increment}
>
Increment
</button>
</div>
);
}
}
// Functional Component with Hooks
function CounterWithHooks() {
const [count, setCount] = ReactorJS.useState(0);
ReactorJS.useEffect(() => {
document.title = `Count: ${count}`;
}, [count]);
return (
<div className="p-4 bg-white rounded shadow">
<h2 className="text-xl font-bold mb-2">Counter: {count}</h2>
<button
className="px-4 py-2 bg-primary text-white rounded"
onClick={() => setCount(count + 1)}
>
Increment
</button>
</div>
);
}
import ReactorJS from 'reactorjs';
import RouterComponents from 'reactorjs-router';
const { Link } = RouterComponents;
function Navigation() {
return (
<nav className="p-4 bg-primary text-white">
<ul className="flex space-x-4">
<li><Link href="/" className="hover:underline">Home</Link></li>
<li><Link href="/about" className="hover:underline">About</Link></li>
<li><Link href="/users/123" className="hover:underline">User Profile</Link></li>
</ul>
</nav>
);
}
// Dynamic route page (in src/app/pages/users/[id].jsx)
function UserProfile({ params }) {
return (
<div className="p-4">
<h1 className="text-2xl font-bold mb-4">User Profile</h1>
<p>User ID: {params.id}</p>
</div>
);
}
// Server-side data fetching
UserProfile.getInitialProps = async ({ params }) => {
// Fetch user data from API
const response = await fetch(`https://api.example.com/users/${params.id}`);
const userData = await response.json();
return { userData };
};
import ReactorJS from 'reactorjs';
import { ui } from 'reactorjs-styling';
function LoginForm() {
const [email, setEmail] = ReactorJS.useState('');
const [password, setPassword] = ReactorJS.useState('');
const handleSubmit = (e) => {
e.preventDefault();
// Handle login logic
};
return (
<ui.Card className="w-full max-w-md mx-auto">
<ui.CardHeader>
<ui.CardTitle>Login</ui.CardTitle>
<ui.CardDescription>
Enter your credentials to access your account
</ui.CardDescription>
</ui.CardHeader>
<ui.CardContent>
<form onSubmit={handleSubmit} className="space-y-4">
<div className="space-y-2">
<label htmlFor="email" className="text-sm font-medium">
Email
</label>
<ui.Input
id="email"
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="your.email@example.com"
required
/>
</div>
<div className="space-y-2">
<label htmlFor="password" className="text-sm font-medium">
Password
</label>
<ui.Input
id="password"
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
required
/>
</div>
</form>
</ui.CardContent>
<ui.CardFooter>
<ui.Button type="submit" className="w-full">
Sign In
</ui.Button>
</ui.CardFooter>
</ui.Card>
);
}
import ReactorJS from 'reactorjs';
import { reactorNative } from 'reactorjs-styling';
const { View, Text, TouchableOpacity, ScrollView } = reactorNative;
function HomeScreen() {
const [count, setCount] = ReactorJS.useState(0);
return (
<ScrollView className="flex-1 bg-white p-4">
<Text className="text-2xl font-bold mb-6">ReactorJS Native</Text>
<View className="bg-gray-100 rounded-lg p-6 mb-6">
<Text className="text-lg mb-4">Count: {count}</Text>
<View className="flex-row space-x-4">
<TouchableOpacity
className="bg-primary px-4 py-2 rounded"
onPress={() => setCount(count + 1)}
>
<Text className="text-white font-medium">Increment</Text>
</TouchableOpacity>
<TouchableOpacity
className="bg-gray-500 px-4 py-2 rounded"
onPress={() => setCount(0)}
>
<Text className="text-white font-medium">Reset</Text>
</TouchableOpacity>
</View>
</View>
<Text className="text-xl font-semibold mb-4">Features</Text>
<View className="space-y-2 mb-6">
<View className="flex-row items-center">
<View className="w-2 h-2 rounded-full bg-primary mr-2" />
<Text>Unified API for web and native</Text>
</View>
<View className="flex-row items-center">
<View className="w-2 h-2 rounded-full bg-primary mr-2" />
<Text>Tailwind CSS support</Text>
</View>
<View className="flex-row items-center">
<View className="w-2 h-2 rounded-full bg-primary mr-2" />
<Text>Native performance</Text>
</View>
<View className="flex-row items-center">
<View className="w-2 h-2 rounded-full bg-primary mr-2" />
<Text>Reusable business logic</Text>
</View>
<View className="flex-row items-center">
<View className="w-2 h-2 rounded-full bg-primary mr-2" />
<Text>Cross-platform components</Text>
</View>
</View>
</ScrollView>
);
}
ReactorJS is composed of several packages that work together:
ReactorJS uses a configuration file (reactorjs.config.js) to customize various aspects of your application:
// reactorjs.config.js
module.exports = {
// General settings
appName: 'My ReactorJS App',
// Platforms to build for
platforms: ['web', 'native'],
// Web configuration
web: {
devPort: 3000,
buildDir: 'dist',
publicDir: 'public',
ssr: true,
ssg: {
enabled: true,
paths: ['/about', '/contact']
}
},
// Native configuration
native: {
appId: 'com.example.myapp',
platforms: ['ios', 'android'],
},
// Styling options
styling: {
tailwind: true,
shadcn: true,
theme: {
colors: {
primary: '#3b82f6',
secondary: '#6b7280',
}
}
}
};
ReactorJS offers multiple ways to manage state:
// Class component
class Counter extends ReactorJS.Component {
constructor(props) {
super(props);
this.state = { count: 0 };
}
increment = () => {
this.setState({ count: this.state.count + 1 });
}
render() {
return (
<div>
<p>Count: {this.state.count}</p>
<button onClick={this.increment}>Increment</button>
</div>
);
}
}
// Functional component with hooks
function HookCounter() {
const [count, setCount] = ReactorJS.useState(0);
return (
<div>
<p>Count: {count}</p>
<button onClick={() => setCount(count + 1)}>Increment</button>
</div>
);
}
// Create a context
const ThemeContext = ReactorJS.createContext({ theme: 'light' });
// Provider component
function ThemeProvider({ children }) {
const [theme, setTheme] = ReactorJS.useState('light');
const toggleTheme = () => {
setTheme(theme === 'light' ? 'dark' : 'light');
};
return (
<ThemeContext.Provider value={{ theme, toggleTheme }}>
{children}
</ThemeContext.Provider>
);
}
// Consumer component
function ThemedButton() {
const { theme, toggleTheme } = ReactorJS.useContext(ThemeContext);
return (
<button
className={`px-4 py-2 rounded ${theme === 'light' ? 'bg-primary text-white' : 'bg-gray-800 text-white'}`}
onClick={toggleTheme}
>
Toggle Theme (Current: {theme})
</button>
);
}
// Create a store
const store = ReactorJS.createStore({
state: {
count: 0,
user: null
},
reducers: {
INCREMENT: (state) => ({ ...state, count: state.count + 1 }),
DECREMENT: (state) => ({ ...state, count: state.count - 1 }),
SET_USER: (state, user) => ({ ...state, user })
}
});
// Connect component to store
function ConnectedCounter() {
const { state, dispatch } = store.useStore();
return (
<div>
<p>Count: {state.count}</p>
<button onClick={() => dispatch({ type: 'INCREMENT' })}>Increment</button>
<button onClick={() => dispatch({ type: 'DECREMENT' })}>Decrement</button>
</div>
);
}
// Create reactive state
const state = ReactorJS.reactive({
count: 0,
user: null
});
// Component using reactive state
function ReactiveCounter() {
// This component will automatically re-render when state.count changes
ReactorJS.watchEffect(() => {
console.log('Count changed:', state.count);
});
return (
<div>
<p>Count: {state.count}</p>
<button onClick={() => state.count++}>Increment</button>
<button onClick={() => state.count--}>Decrement</button>
</div>
);
}
ReactorJS supports server-side rendering for improved performance and SEO:
// Server entry point (server.js)
import { createServerApp } from 'reactorjs-router';
import express from 'express';
// Import pages and layouts
import HomePage from './src/app/pages/home';
import AboutPage from './src/app/pages/about';
import MainLayout from './src/app/layouts/main';
const app = express();
// Define routes
const pages = {
'/': HomePage,
'/about': AboutPage
};
// Define layouts
const layouts = {
'/': MainLayout
};
// Create server app
const reactorApp = createServerApp({
pages,
layouts,
title: 'My ReactorJS App',
styles: tailwindStyles // Pre-generated Tailwind CSS
});
// Handle all routes
app.get('*', async (req, res) => {
try {
const { html, statusCode } = await reactorApp.renderPath(req.path);
res.status(statusCode).send(html);
} catch (error) {
console.error('Rendering error:', error);
res.status(500).send('Server Error');
}
});
app.listen(3000, () => {
console.log('Server running on http://localhost:3000');
});
// my-plugin.js
module.exports = function myPlugin(options) {
return {
name: 'my-plugin',
// Hook into the ReactorJS lifecycle
beforeBuild() {
console.log('Before build');
},
afterBuild() {
console.log('After build');
},
// Extend the component API
extendComponent(Component) {
Component.prototype.myCustomMethod = function() {
console.log('Custom method called');
};
return Component;
}
};
};
// In reactorjs.config.js
module.exports = {
// ...other config
plugins: [
require('./my-plugin')({ /* options */ })
]
};
ReactorJS seamlessly integrates with React Native to build cross-platform applications:
// src/native/index.jsx
import ReactorJS from 'reactorjs';
import { AppRegistry } from 'reactorjs-native';
import { reactorNative, TailwindProvider } from 'reactorjs-styling';
import HomeScreen from './screens/home';
import SettingsScreen from './screens/settings';
const { View, Text } = reactorNative;
// Navigation state
const [currentScreen, setCurrentScreen] = ReactorJS.useState('home');
// Simple tab navigator
const App = () => {
return (
<TailwindProvider>
<View className="flex-1">
{/* Content area */}
<View className="flex-1">
{currentScreen === 'home' && <HomeScreen />}
{currentScreen === 'settings' && <SettingsScreen />}
</View>
{/* Tab bar */}
<View className="flex-row border-t border-gray-200">
<View
className={`flex-1 py-4 items-center ${currentScreen === 'home' ? 'bg-primary' : 'bg-white'}`}
onPress={() => setCurrentScreen('home')}
>
<Text className={currentScreen === 'home' ? 'text-white' : 'text-gray-700'}>
Home
</Text>
</View>
<View
className={`flex-1 py-4 items-center ${currentScreen === 'settings' ? 'bg-primary' : 'bg-white'}`}
onPress={() => setCurrentScreen('settings')}
>
<Text className={currentScreen === 'settings' ? 'text-white' : 'text-gray-700'}>
Settings
</Text>
</View>
</View>
</View>
</TailwindProvider>
);
};
// Register the app
AppRegistry.registerComponent('MyApp', () => App);
ReactorJS CLI provides various commands to streamline development:
# Create a new project
reactorjs create my-app
# Start development server
reactorjs dev
# Build for production
reactorjs build
# Build for specific platform
reactorjs build web
reactorjs build native
# Generate component
reactorjs generate component Button
# Generate page
reactorjs generate page About
# Generate layout
reactorjs generate layout Main
ReactorJS includes several features for optimal performance:
For comprehensive documentation, visit reactorjs.dev.
Contributions are welcome! Please read our contributing guide to get started.
ReactorJS is MIT licensed.
FAQs
A comprehensive JavaScript framework CLI for building web and native applications
We found that reactorjs-framework-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.