Skip to content

πŸ”₯ Build web apps without coding! YAML β†’ Full-stack application with REST APIs, forms, validation, authentication, and responsive UI. One binary, zero setup required.

Notifications You must be signed in to change notification settings

jaswdr/yamlforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

yamlforge

yamlforge is a single-binary tool that generates and serves complete web applications from YAML configuration files. Define your data models, validation rules, and UI preferences in YAML, and yamlforge instantly creates a working application with both backend API and frontend interface.

⚠️ Note: YamlForge is in active development. Expect breaking changes and evolving APIs until v1.0.0 release.

Features

  • Single YAML file: Create functional web applications without writing code just a single YAML file
  • Single Binary: No dependencies or runtime requirements
  • Instant Preview: Live development server with hot reload
  • Auto-generated API: RESTful endpoints with pagination, filtering, and sorting
  • Built-in UI: Responsive web interface with list, form, and detail views
  • SQLite Support: Embedded database with automatic schema generation
  • Validation: Server-side validation with customizable rules
  • Field Types: Support for text, number, boolean, email, datetime, enum, and more

Quick Start

Installation

go get github.com/yamlforge/yamlforge
go build -o yamlforge cmd/yamlforge/main.go

Usage

  1. Create a YAML configuration file:
app:
  name: "My App"
  version: "1.0.0"

database:
  type: sqlite
  path: "./data.db"

models:
  Task:
    fields:
      id:
        type: id
        primary: true
      title:
        type: text
        required: true
      completed:
        type: boolean
        default: false
  1. Start the development server:
./yamlforge serve myapp.yaml
  1. Open your browser to http://localhost:8080

Command Line Usage

# Start development server
yamlforge serve <config.yaml> [options]

# Validate configuration
yamlforge validate <config.yaml>

# Options
  -port int      Server port (default 8080)
  -host string   Server host (default "0.0.0.0")

Configuration Reference

App Configuration

app:
  name: "Application Name"
  version: "1.0.0"
  description: "Application description"

Database Configuration

database:
  type: sqlite
  path: "./data.db"

Server Configuration

server:
  port: 8080
  host: "0.0.0.0"
  cors:
    enabled: true
    origins: ["*"]
  auth:
    type: jwt
    secret: "your-secret-key"
    expires: "24h"

UI Configuration

ui:
  theme: "light" # light | dark | auto
  title: "My App"
  logo: "./logo.png"
  layout: "sidebar" # sidebar | topbar

Model Definition

models:
  ModelName:
    fields:
      fieldName:
        type: text
        required: true
        # ... other validations

    ui:
      list:
        columns: ["field1", "field2"]
        sortable: ["field1"]
        searchable: ["field1"]
      form:
        fields: ["field1", "field2"]

    permissions:
      create: "authenticated"
      read: "all"
      update: "owner"
      delete: "admin"

Field Types

Basic Types

  • text: String field with min/max length
  • number: Integer with min/max value
  • boolean: True/false checkbox
  • datetime: Date and time picker
  • date: Date only
  • time: Time only

Special Types

  • id: Auto-generated unique identifier
  • email: Email with validation
  • password: Secure password field
  • enum: Select from options
  • relation: Foreign key reference
  • array: List of items
  • markdown: Rich text editor

Validations

  • required: Field must have a value
  • unique: Value must be unique
  • min/max: Length or value limits
  • pattern: Regex validation
  • default: Default value

API Endpoints

For each model, the following endpoints are automatically generated:

  • GET /api/{model} - List with pagination
  • GET /api/{model}/{id} - Get single record
  • POST /api/{model} - Create new record
  • PUT /api/{model}/{id} - Update record
  • DELETE /api/{model}/{id} - Delete record
  • POST /api/{model}/bulk - Bulk operations

Query Parameters

  • page: Page number (default: 1)
  • page_size: Items per page (default: 20)
  • sort: Sort fields (prefix with - for DESC)
  • search: Search in searchable fields
  • filter.{field}: Filter by field value

Example: /api/tasks?page=2&sort=-created_at&filter.status=todo

Examples

See the examples/ directory for complete examples:

  • blog.yaml - Simple blog application
  • tasks.yaml - Task management system
  • users.yaml - User management with relationships

Development

Project Structure

yamlforge/
β”œβ”€β”€ cmd/yamlforge/      # Main entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ parser/         # YAML parsing
β”‚   β”œβ”€β”€ database/       # Database layer
β”‚   β”œβ”€β”€ api/           # API handlers
β”‚   β”œβ”€β”€ server/        # HTTP server
β”‚   β”œβ”€β”€ ui/            # Frontend assets
β”‚   └── validation/    # Validation logic
└── examples/          # Example configurations

Building from Source

# Install dependencies
go mod download

# Build binary
go build -o yamlforge cmd/yamlforge/main.go

# Run tests
go test ./...

License

MIT License - see LICENSE file for details

About

πŸ”₯ Build web apps without coding! YAML β†’ Full-stack application with REST APIs, forms, validation, authentication, and responsive UI. One binary, zero setup required.

Topics

Resources

Stars

Watchers

Forks