create-s6-app
v1.2.3
Published
Zero-dependency Laravel installer with React, TypeScript, Tailwind & full-stack type safety (PHP ↔ TypeScript)
Downloads
15
Maintainers
Readme
create-s6-app
Zero-dependency Laravel installer with hybrid type safety (PHP ↔ TypeScript). Run Laravel projects anywhere without installing PHP or Composer system-wide.
Getting Started
Standard Installation (Type-Safe by Default)
npm create s6-app@latest my-appWithout Type Safety (Not Recommended)
npm create s6-app@latest my-app --no-typesafeAccess your app at:
- Laravel API: http://127.0.0.1:8000
- Vite Dev Server: http://localhost:5173
Features
✨ Zero System Dependencies: No need for system PHP or Composer
🔒 Hybrid Type Safety: PHP DTOs automatically converted to TypeScript + Zod schemas
🚀 Auto-generated API Client: Type-safe fetch wrappers from Laravel routes
⚡ Watch Mode: Auto-regenerate types on DTO changes
🎯 Runtime Validation: Zod-powered validation for all API responses
📦 Batteries Included: TypeScript, Vite, and all tooling pre-configured
🛠️ Unified Commands: Use npm run for everything - no need to remember PHP/Composer paths
Table of Contents
- create-s6-app
Type Safety System
Type safety is enabled by default in all new projects. This gives you a fully configured hybrid type safety system inspired by create-t3-app.
Note: Use
--no-typesafeto skip type safety setup (not recommended for production projects).
How It Works
- Define DTOs in PHP:
#[TypeScript]
class UserDto {
public function __construct(
public int $id,
public string $name,
public string $email,
) {}
}- Use DTOs in Controllers:
public function index(): JsonResponse {
$users = User::all()->map(fn($u) => new UserDto(...));
return response()->json($users);
}- Generate Types:
npm run gen:types- Use Type-Safe API Client:
import { api } from '@/api/client';
const users = await api.getUsers();
// ✅ Fully typed as UserDto[]
// ✅ Runtime validated with Zod
// ✅ Autocomplete and type checkingExample Workflow
# Start watch mode (auto-regenerates on DTO changes)
npm run watch:types
# In another terminal, start dev server
npm run dev
# Now edit any DTO in app/DTO/
# Types regenerate automatically
# TypeScript errors appear instantly in VSCodeAvailable Commands:
npm run dev- Start Laravel + Vite dev serversnpm run serve- Start Laravel server onlynpm run migrate- Run database migrationsnpm run gen:types- Generate TypeScript types from PHPnpm run type-check- TypeScript type checkingnpm run watch:types- Watch mode for auto-regeneration
For advanced usage, you can still use:
npx artisan <command>- Run any Laravel Artisan commandnpx composer <command>- Run any Composer command
Generated Files:
resources/js/types/UserDto.ts- Zod schema + TypeScript interfaceresources/js/api/client.ts- Type-safe API clientresources/js/types/generated.d.ts- Additional type definitions
See the TYPE_SAFETY.md guide (generated in your project) for complete documentation.
The S6 Vision
Inspired by the T3 Stack, we're reimagining Laravel development with modern tooling to make PHP development more robust and enjoyable. Our goals include:
- Run Anywhere/Everywhere: Pure npm-based installation (no curl commands needed)
- Single Command Setup: Install everything with one command
- Type Safety: Full TypeScript integration for better developer experience
- Linting: Built-in code quality tools
- Modern Database Layer: Prisma-like database management with type safety
- SPA Integration: Seamless single-page application support
- Validation: Zod-powered schema validation
- Type-Safe APIs: tRPC-style communication between PHP backend and frontend (detect changes in controllers and get errors in Blade/frontend)
These enhancements aim to bring PHP development into the modern era, combining Laravel's power with cutting-edge tools.
S6 Principles
1. Solve Real Problems
We focus on adding features that address genuine pain points in Laravel development. Everything included should provide clear value without unnecessary complexity.
2. Modernize Responsibly
We embrace modern tools and practices while maintaining Laravel's reliability. We prioritize stability for core functionality while experimenting with innovative features.
3. Type Safety Isn't Optional
Full-stack type safety is our north star. Any feature that compromises type safety should be implemented elsewhere.
This creates a fully functional Laravel project with bundled PHP and Composer binaries.
Contributing
We welcome contributions! This project is in active development, and we need help implementing the vision above.
How to Contribute
- Fork and Clone: Fork the repo and clone it locally
- Install Dependencies:
npm install - Test Locally:
npm test - Make Changes: Implement features or fix issues
- Submit PR: Create a pull request with a clear description
Areas for Contribution
- TypeScript Integration: Add TS support to the CLI and generated projects
- Database Tools: Integrate Prisma or similar for Laravel
- Frontend Integration: Add SPA frameworks and tRPC-like type safety
- Validation: Implement Zod schemas for Laravel validation
- Linting: Add ESLint/Prettier configurations
- Documentation: Improve docs and add examples
- Testing: Add comprehensive test coverage
Development Setup
git clone https://github.com/souravdutt/create-laravel-app.git
cd create-laravel-app
npm install
npm testCheck out our issues for specific tasks or propose new ideas!
Community
For help, discussion about best practices, or any other conversation:
Join our GitHub Discussions
Contributors
We 💖 contributors! Feel free to contribute to this project.
Made with contrib.rocks
License
MIT
