A modern, lightweight React framework inspired by Next.js but designed for simplicity and performance. Build fast, scalable applications with file-based routing, service injection, middleware system, and powerful SSR capabilities.
# Install CLI globally
npm install -g @wizecorp/stratusjs
# Create a new project (interactive)
stratusjs create my-app
# Or create with specific template
stratusjs create my-blog --template ssr # Full SSR
stratusjs create my-site --template hybrid # Universal routing
stratusjs create my-mvp --template default # Services + middleware
# Start development
cd my-app
npm install
npm run devOpen http://localhost:5173 to view your application.
- ποΈ File-Based Routing - Automatic routing based on file structure
- βοΈ Service Container - Dependency injection with clean architecture
- π‘οΈ Middleware System - HOC-based middleware for cross-cutting concerns
- π SSR & Hybrid Routing - Full SSR, hybrid rendering, or client-side only
- π¨ TailwindCSS - Modern utility-first styling with dark mode
- π§ TypeScript First - Full TypeScript support with excellent DX
- π¦ Lightweight - Minimal bundle size, maximum performance
- π οΈ Modern Tooling - Vite-powered development and building
- π’ Easy Deployment - One-click deployment to Vercel, Netlify, Docker
src/
βββ app/ # File-based routes
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page (/)
β βββ about/
β βββ page.tsx # About page (/about)
βββ services/ # Service layer with DI
β βββ ApiService.ts # HTTP service example
βββ middleware/ # HOC middleware system
β βββ auth.tsx # Authentication middleware
βββ main.tsx # App entry point with service registration
Routes are automatically created based on file structure:
src/app/page.tsx β /
src/app/about/page.tsx β /about
src/app/products/[id]/page.tsx β /products/:id
src/app/(dashboard)/layout.tsx β Layout for dashboard pages
// src/services/ApiService.ts
export class HttpService {
private baseUrl: string;
constructor(baseUrl: string = 'https://api.example.com') {
this.baseUrl = baseUrl;
}
async get<T>(endpoint: string): Promise<T> {
const response = await fetch(`${this.baseUrl}${endpoint}`);
if (!response.ok) {
throw new Error(`HTTP Error: ${response.status}`);
}
return await response.json();
}
}
// src/main.tsx - Register services
const serviceContainer = new ServiceContainer();
serviceContainer.register('httpService', () => new HttpService());
// Use in components
function UsersPage() {
const httpService = useService<HttpService>('httpService');
const [users, setUsers] = useState([]);
useEffect(() => {
httpService.get('/users').then(setUsers).catch(console.error);
}, [httpService]);
return <div>{/* render users */}</div>;
}Full SSR support with data fetching:
import { GetServerSideProps } from 'stratus';
export const getServerSideProps: GetServerSideProps = async (context) => {
const data = await fetchDataFromAPI();
return {
props: {
data,
serverTimestamp: new Date().toISOString()
}
};
};
export default function Page({ data, serverTimestamp }) {
return (
<div>
<h1>{data.title}</h1>
<p>Generated at: {serverTimestamp}</p>
</div>
);
}Higher-Order Components for cross-cutting concerns:
// src/middleware/auth.tsx
interface AuthOptions {
redirectTo?: string;
requireAuth?: boolean;
}
export function withAuth<P extends {}>(
Component: React.ComponentType<P>,
options: AuthOptions = {}
) {
return function AuthenticatedComponent(props: P) {
if (options.requireAuth && !isAuthenticated()) {
return <LoginPage />;
}
return <Component {...props} />;
};
}
// Usage
export default withAuth(MyProtectedPage, { redirectTo: '/login' });Choose from pre-built templates to kickstart your project:
Perfect for: Most applications, MVPs, client projects
- β Service container with dependency injection
- β Authentication middleware example
- β TailwindCSS with dark mode support
- β TypeScript configuration
- β Modern component architecture
Perfect for: Universal applications with SSR needs
- β HybridRouter with client-side and server-side rendering
- β Automatic hydration support
- β All default template features
- β Optimized for SEO and performance
- β Supports both SSR and CSR pages
Perfect for: Content-heavy sites, blogs, e-commerce
- β
Full server-side rendering with
getServerSideProps - β Demo SSR page with server data fetching
- β Production server configuration
- β Enhanced SEO capabilities
- β All default template features
# Create project
stratusjs create <name> # Interactive project creation
stratusjs create my-app --template ssr --js
# Available templates: default, hybrid, ssr
# Development
stratusjs dev # Start dev server
stratusjs dev --port 8080 # Custom port
# Building
stratusjs build # Production build
stratusjs build --ssr # Build with SSR (ssr template)
# Code Generation
stratusjs generate page about # Create page
stratusjs g service user # Create service
stratusjs g layout dashboard # Create layout
# Deployment
stratusjs deploy # Interactive deployment
stratusjs deploy --platform vercel # Deploy to Vercelstratusjs deploy --platform vercelstratusjs deploy --platform netlifystratusjs deploy --platform dockerstratusjs deploy --platform nodesrc/
app/
page.tsx # β /
about/
page.tsx # β /about
layout.tsx # Layout for /about
users/
[id]/
page.tsx # β /users/:id
blog/
[...slug]/
page.tsx # β /blog/*slug
layouts/
main.tsx # Reusable layouts
services/
userService.ts # Business logic services
- CLI Documentation - Complete CLI reference
Configure your project in stratus.config.json:
{
"name": "my-app",
"template": "default",
"features": {
"ssr": false,
"hybrid": false,
"typescript": true,
"services": true,
"middleware": true,
"tailwindcss": true
},
"routing": {
"routesDir": "src/app",
"layoutsDir": "src/layouts",
"pageExtensions": ["tsx", "ts", "jsx", "js"]
},
"build": {
"outDir": "dist",
"assetsDir": "assets",
"ssr": false
},
"dev": {
"port": 5173,
"open": true,
"host": "localhost"
}
}- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
MIT License - see LICENSE for details.
| Feature | Stratus | Next.js | Create React App |
|---|---|---|---|
| Bundle Size | β‘ Minimal | π¦ Large | π¦ Medium |
| Learning Curve | π Easy | π Moderate | π Easy |
| SSR Support | β 3 Options | β Built-in | β No |
| File Routing | β Yes | β Yes | β No |
| Services DI | β Built-in | β Manual | β Manual |
| Middleware | β HOC System | β No | |
| TailwindCSS | β Pre-configured | ||
| CLI Tools | β Rich | β Rich | |
| TypeScript | β First-class | β Good |
- Startups building MVPs quickly
- Agencies delivering client projects
- Developers who want Next.js simplicity without complexity
- Teams needing clean architecture with services
- Projects requiring lightweight, fast applications
Built with β€οΈ for the React community. Start building amazing applications today!