📖 README

SchemaCraft

A modern, visual database schema designer for Laravel — build your database visually, generate production-ready code.

SchemaCraft replaces the now-defunct LaravelSD with a modern, open-source visual schema designer built natively for the Laravel ecosystem. Design your database with drag-and-drop, define Eloquent relationships visually, and export production-ready migration files.


What It Does

  • Visual Canvas — Drag-and-drop table design on an infinite SVG canvas with zoom and pan
  • Column Editor — Define columns with all 30+ Laravel migration types, modifiers, and indexes
  • Relationship Drawing — Click-to-connect tables with automatic FK column creation and cardinality indicators
  • Complete Code Generation — Export production-ready Laravel code:
    • Migrations — All column types, foreign keys, pivot tables
    • Models — Eloquent models with relationships, $fillable, casts(), traits
    • Factories — Intelligent Faker methods, state management, foreign key handling
    • Seeders — Dependency-ordered seeding with realistic data
  • Category-Based Preview — Browse generated code by type (Migrations, Models, Factories, Seeders)
  • Package-First — Installable as a Composer package in any Laravel project, or use the hosted SaaS version

Quick Start (Package)

composer require schemacraft/schemacraft
php artisan schemacraft:install
php artisan migrate

Then visit /schemacraft in your browser.


Quick Start (Development)

git clone <repo-url> SchemaCraft
cd SchemaCraft
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
npm install && npm run dev
php artisan serve

Visit http://localhost:8000/schemacraft to start designing.


Tech Stack

Layer Technology
Backend Laravel 12
UI Components Livewire 4
Canvas Interactivity Alpine.js + SVG
Styling Tailwind CSS 4
Testing Pest PHP

Project Structure

SchemaCraft/
├── packages/schemacraft/     <- Open-source Laravel package (core)
│   ├── src/                  <- PHP: models, components, generators
│   ├── resources/views/      <- Blade + Alpine.js views
│   ├── config/               <- Package configuration
│   ├── database/migrations/  <- Schema tables
│   └── routes/               <- Package routes
├── app/                      <- Host Laravel app (SaaS layer)
├── docs/                     <- Project documentation
└── README.md

Documentation

Document Description
Project Overview Vision, problem statement, and competitive landscape
Architecture Tech stack, package-first design, canvas & generator architecture
Database Design All tables, ERD diagram, column types, design decisions
Phase 1 Implementation MVP build plan — Visual canvas + migration export
Roadmap Phase 2-4 plans and feature distribution
Contributing Team conventions, coding standards, workflow
Phase 2 Implementation Code generation — Models, Factories, Seeders ✨ NEW
Build Log Step-by-step record of every build action and decision

Current Status

Phase 2 (Code Generation) — ✅ Complete

SchemaCraft now generates complete, production-ready Laravel codebases from visual designs:

  • ✅ Phase 1: Visual canvas + migration export
  • ✅ Phase 2: Model, Factory, and Seeder generators with intelligent code generation

See Phase 2 Implementation for details.

What's Next: Phase 3 will add database import, canvas improvements, and UX polish.


License

MIT

Loading...