โก InitraJS - JavaScript CLI Toolkit | Lightning-fast scaffolding for React, Next.js, Node.js with TypeScript | The future of JavaScript development | 10x faster than create-react-app | Ultimate developer productivity tool
npm install initrajsbash
From zero to running app in under 60 seconds
npm install -g initrajs
npx initrajs init my-app
cd my-app && npm start
`
$3
- Clean Architecture: MVC + Service Layer pattern with dependency injection
- Type Safety: Full TypeScript support with intelligent type generation
- Security First: JWT authentication, CORS, rate limiting, and security headers
- Testing Ready: Jest, React Testing Library, and E2E tests configured
- Production Optimized: Bundle splitting, lazy loading, and performance monitoring
---
๐ Introduction
InitraJS is a powerful zero-config CLI that scaffolds production-ready fullstack applications and generates components with lightning speed. Featuring cutting-edge architecture, comprehensive code generation, and battle-tested best practices โ get from idea to deployment in minutes, not hours.
๐ฏ Perfect for:
- ๐ Startups needing rapid prototyping
- ๐ข Enterprise teams requiring consistent architecture
- ๐จโ๐ป Solo developers wanting best practices built-in
- ๐ Learning modern fullstack development patterns
---
๐ Table of Contents
- ๐ Features
- ๐ฏ What Makes InitraJS Special
- ๐ฆ Installation & Quick Start
- โก Quick Demo
- ๐ฏ Code Generation
- ๐งฐ Supported Templates
- ๐ Project Structure
- โ๏ธ Backend Architecture
- ๐ ๏ธ Advanced Usage
- ๐ Success Stories
- ๐ฃ๏ธ Roadmap
- ๐ Troubleshooting
- ๐จโ๐ป Contributing
- ๐ License
---
๐ Features
$3
- ๐งฉ Smart Components: Generate React components with TypeScript, CSS, tests, and Storybook stories
- ๐ Page Generation: Create React pages or Next.js app router pages with full folder structure
- ๐ง Backend Scaffolding: Generate complete APIs with controllers, services, models, DTOs, and routes
- ๐จ Style Integration: Automatic CSS/SCSS generation with BEM methodology
- ๐งช Test Coverage: Jest + React Testing Library setup out of the box
$3
- โ๏ธ Full TypeScript Support with intelligent type generation
- ๐จ Integrated MUI v5 with global theme customization
- ๐ง Configured Redux Toolkit for scalable state management
- ๐ AuthContext + AuthGuard for protected routing
- ๐งพ Class-based API Services for clean, DRY code
- ๐ Modular App Directory Structure using Next.js App Router
- ๐พ Session-based token handling, synced with AuthContext
- ๐ฑ Responsive Design with mobile-first approach
$3
- ๐๏ธ Structured MVC + Service Layer architecture
- ๐ JWT authentication with middleware protection
- โ
DTOs and Validators using express-validator
- ๐ Modular route handling with auto-registration
- ๐ฅ Global error middleware with consistent responses
- ๐ฆ TypeScript-first with modern conventions
- ๐ Auto-generated CRUD operations
---
๐ฆ Installation & Quick Start
$3
`bash
npm install -g initrajs
`
$3
`bash
Create a full-stack app in seconds
npx initrajs init my-awesome-app
cd my-awesome-app
Generate a component with everything
initrajs c ProductCard --css --test --story --props "title,price,image"
Create a protected dashboard page
initrajs page Dashboard --next --css --test
Generate a complete API endpoint
initrajs api User --ts
Start developing
npm run dev
`
$3
`bash
1. Initialize project (30 seconds)
npx initrajs init ecommerce-app --template nextjs
2. Generate components (2 minutes)
initrajs c ProductGrid --css --test --props "products,loading"
initrajs c ShoppingCart --css --test --props "items,onUpdate"
3. Create pages (1 minute)
initrajs page Products --next --css --test
initrajs page Checkout --next --css --test
4. Build API (2 minutes)
initrajs api Product --ts
initrajs api Order --ts
5. Deploy (1 minute)
npm run build && npm run deploy
`
๐ Result: Production-ready e-commerce app in under 10 minutes!
---
๐ฏ Code Generation
$3
`bash
Basic component (defaults to TypeScript)
initrajs c Header
Component with all the bells and whistles
initrajs c ProductCard --css --test --story --props "title,price,image"
Layout component with TypeScript
initrajs c AppLayout --layout --ts --css
Server-side component for Next.js
initrajs c UserProfile --server --css --test
`
Generated Structure:
`
src/components/ProductCard/
โโโ ProductCard.tsx # Main component with TypeScript
โโโ ProductCard.scss # BEM-style CSS (if --css)
โโโ ProductCard.test.tsx # Jest tests (if --test)
โโโ ProductCard.stories.tsx # Storybook story (if --story)
โโโ index.ts # Barrel export
`
$3
`bash
React page for standard React apps
initrajs page Home --react --css --test
Next.js page with app router structure
initrajs page Dashboard --next --ts --css --test
Custom path for organization
initrajs page UserProfile --next --path "app/user" --css
`
Next.js Page Structure:
`
app/dashboard/
โโโ page.tsx # Main page component
โโโ loading.tsx # Loading UI
โโโ error.tsx # Error boundary
โโโ dashboard.scss # Page styles (if --css)
โโโ page.test.tsx # Page tests (if --test)
`
$3
`bash
Complete API with all files
initrajs api Product --ts
Individual backend components
initrajs route User --ts
initrajs controller Order --ts
initrajs service PaymentService --ts
initrajs model ProductModel --ts
initrajs middleware AuthMiddleware --jwt --ts
`
---
๐งฐ Supported Templates
| Template | Tech Stack | TypeScript | Features |
|----------|------------|------------|----------|
| React | Vite + MUI + Redux | โ
| Theme, State Management, AuthContext |
| Next.js | App Router + MUI + Redux | โ
| AuthGuard, Layouts, Sessions, SEO |
| Node.js | Express MVC + TypeScript | โ
| DTOs, Middleware, Services, JWT |
$3
#### React Template
- โก Vite for blazing fast development
- ๐จ Material-UI v5 with custom theming
- ๐๏ธ Redux Toolkit with configured store
- ๐ Authentication context and guards
- ๐ฑ Responsive design system
#### Next.js Template
- ๐ App Router for modern routing
- ๐ก๏ธ Middleware-based authentication
- ๐ SEO optimized with metadata API
- ๐ฏ Server Components support
- ๐ฆ Bundle optimization
#### Node.js Template
- ๐๏ธ Clean Architecture with layers
- ๐ Security middlewares included
- ๐ API Documentation ready
- ๐งช Testing setup with Jest
- ๐ณ Docker configuration
---
๐ Project Structure
$3
`
app/
โโโ layout.tsx # Root layout (Providers, Theme)
โโโ globals.css # Global styles
โโโ auth/
โ โโโ layout.tsx # Auth pages layout
โ โโโ login/page.tsx # Login page
โ โโโ register/page.tsx # Register page
โโโ (dashboard)/ # Route groups
โ โโโ layout.tsx # Protected layout with AuthGuard
โ โโโ dashboard/page.tsx # Dashboard page
โ โโโ settings/page.tsx # Settings page
โ โโโ profile/page.tsx # Profile page
โโโ api/ # API routes
โโโ components/ # Reusable components
โโโ lib/ # Utilities and configurations
`
$3
`
src/
โโโ controllers/ # Request handlers
โโโ services/ # Business logic
โโโ models/ # Data models
โโโ routes/ # Route definitions
โโโ middleware/ # Custom middleware
โ โโโ auth.middleware.ts
โ โโโ error.middleware.ts
โ โโโ validation.middleware.ts
โโโ dto/ # Data Transfer Objects
โโโ validators/ # Input validation
โโโ utils/ # Helper functions
โโโ types/ # TypeScript types
โโโ server.ts # Application entry point
`
---
โ๏ธ Backend Architecture
$3
`typescript
// Controller Layer
export class UserController {
async createUser(req: Request, res: Response) {
const result = await this.userService.create(req.body);
res.json(result);
}
}
// Service Layer
export class UserService {
async create(userData: CreateUserDTO): Promise {
// Business logic here
return this.userModel.create(userData);
}
}
// Model Layer
export class UserModel {
async create(data: CreateUserDTO): Promise {
// Database operations
}
}
`
$3
1. Token Storage: Secure sessionStorage implementation
2. Context Sync: AuthContext manages global auth state
3. Route Protection: AuthGuard automatically protects routes
4. Middleware: JWT validation on backend routes
5. Auto-refresh: Token refresh handling
---
๐ ๏ธ Advanced Usage
$3
| Option | Description | Usage |
|--------|-------------|-------|
| --ts | Generate TypeScript files | initrajs c Button --ts |
| --js | Generate JavaScript files | initrajs c Button --js |
| --css | Include CSS/SCSS files | initrajs c Button --css |
| --test | Generate test files | initrajs c Button --test |
| --story | Generate Storybook stories | initrajs c Button --story |
| --path | Custom file path | initrajs c Button --path "src/ui" |
| --props | Component props | initrajs c Button --props "text,onClick" |
| --server | Server-side component | initrajs c Button --server |
| --client | Client-side component | initrajs c Button --client |
| --layout | Layout component | initrajs c Header --layout |
| --next | Next.js page structure | initrajs page Home --next |
| --react | Standard React page | initrajs page Home --react |
$3
- TypeScript First: Defaults to .tsx unless --js specified
- Modern Patterns: Uses latest React patterns and hooks
- Best Practices: Follows industry standards for file organization
- Performance: Optimized bundle splitting and lazy loading
- Accessibility: WCAG compliant components
$3
`bash
Custom component with all options
initrajs c DataTable \
--ts \
--css \
--test \
--story \
--props "data,columns,onSort,loading" \
--path "src/components/tables"
Next.js page with custom route
initrajs page UserDashboard \
--next \
--css \
--test \
--path "app/(dashboard)/users"
`
๐ฃ๏ธ Roadmap
$3
- โ
React, Next.js, Node.js Templates
- โ
TypeScript-first scaffolding
- โ
MUI with theme configuration
- โ
AuthContext + Redux integration
- โ
Class-based API services
- โ
MVC backend with DTO, validation, error handling
- โ
Component & page generators
- โ
CSS/SCSS generation with BEM
- โ
Test file generation (Jest + RTL)
- โ
Storybook story generation
$3
- ๐ง Database integration templates (Prisma, MongoDB)
- ๐ง Docker containerization
- ๐ง GitHub Actions CI/CD templates
- ๐ง Interactive CLI with project wizard
$3
- ๐ Custom template overrides
- ๐ CLI plugins ecosystem
- ๐ Monorepo & microservice support
- ๐ GraphQL API generation
- ๐ E2E testing setup (Playwright)
- ๐ PWA configuration
- ๐ Mobile app templates (React Native)
- ๐ VS Code extension
---
๐ Troubleshooting
$3
#### ๐ Upgrade CLI
`bash
npm install -g initrajs@latest
`
#### ๐งน Clear NPX Cache
`bash
npx clear-npx-cache
npm cache clean --force
`
#### ๐ฆ Node Version
Ensure you're using Node.js 16+ for optimal compatibility.
#### ๐ง Permission Issues
`bash
On macOS/Linux
sudo npm install -g initrajs
On Windows (Run as Administrator)
npm install -g initrajs
`
#### ๐ Development Mode
`bash
git clone https://github.com/blessedrajp/initrajs.git
cd initrajs
npm install
npm run dev
npm link # Use local version
`
---
๐จโ๐ป Contributing
We welcome contributions! Here's how to get started:
`bash
Fork and clone the repository
git clone https://github.com/blessedrajp/initrajs.git
cd initrajs
Install dependencies
npm install
Start development mode
npm run dev
Run tests
npm test
Build the project
npm run build
`
$3
1. Fork the repository
2. Create a feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)