You can edit almost every page by Creating an account. Otherwise, see the FAQ.

StackPuz

From EverybodyWiki Bios & Wiki




Script error: No such module "Draft topics". Script error: No such module "AfC topic".

StackPuz
Developer(s)Prasomsak Khunmuen
Initial release2024,
Written inJavascript
Engine
    Available inEnglish
    TypeCode generation, Scaffold (programming)
    LicenseProprietary
    Websitestackpuz.com

    Search StackPuz on Amazon.

    StackPuz is the Web Application Code Generator that will generate the Source code based on the user-defined database table. StackPuz uses the Model–view–controller (MVC) design pattern to create the user interfaces and control logic.[1] When the user scaffolds the table it will produce the Controller and its Views and let the user customize it later. The scaffolding technique will increase productivity when developing the standard data operations in web application projects.[2]

    When working with StackPuz, the user needs to define the database table first. For example if the user has a product table like this.

    CREATE TABLE Product (
      id INTEGER NOT NULL,
      name VARCHAR(50) NOT NULL,
      price DECIMAL(12,2) NOT NULL,
      active BIT DEFAULT 1 NOT NULL,
      create_date DATETIME,
      PRIMARY KEY (id)
    );
    

    The scaffolding operation will produce the source code of View, Model and Controller like these:

    The View source code.

    <form method="post" asp-action="Create" asp-route-ref="@(System.Net.WebUtility.UrlEncode(ViewData["ref"].ToString()))">
    	<div class="row">
    		<div class="mb-3 col-md-6 col-lg-4">
    			<label class="form-label" for="product_id">Id</label>
    			<input id="product_id" name="Id" class="form-control form-control-sm" asp-for="@product.Id" type="number" required />
    			<span asp-validation-for="Id" class="text-danger"></span>
    		</div>
    		<div class="mb-3 col-md-6 col-lg-4">
    			<label class="form-label" for="product_name">Name</label>
    			<input id="product_name" name="Name" class="form-control form-control-sm" asp-for="@product.Name" required maxlength="50" />
    			<span asp-validation-for="Name" class="text-danger"></span>
    		</div>
    		<div class="mb-3 col-md-6 col-lg-4">
    			<label class="form-label" for="product_price">Price</label>
    			<input id="product_price" name="Price" class="form-control form-control-sm" asp-for="@product.Price" type="number" step="0.1" required />
    			<span asp-validation-for="Price" class="text-danger"></span>
    		</div>
    		<div class="form-check col-md-6 col-lg-4">
    			<input id="product_active" name="Active" class="form-check-input" type="checkbox" value="true" checked=@(product==null ? false : product.Active) />
    			<label class="form-check-label" for="product_active">Active</label>
    			<span asp-validation-for="Active" class="text-danger"></span>
    		</div>
    		<div class="col-12">
    			<a class="btn btn-sm btn-secondary" href="@ViewData["ref"]">Cancel</a>
    			<button class="btn btn-sm btn-primary">Submit</button>
    		</div>
    	</div>
    </form>
    

    The Model source code.

    public partial class Product
    {
    	[Key]
    	[Required]
    	public int Id { get; set; }
    	[Required]
    	[MaxLength(50)]
    	public string Name { get; set; }
    	[Required]
    	public decimal Price { get; set; }
    	[Required]
    	public bool Active { get; set; }
    	public DateTime? CreateDate { get; set; }
    }
    

    The Controller source code.

    [HttpPost("Create")]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Create([Bind("Id, Name, Price, Active")] ViewModel.Create.Product model)
    {
    	if (ModelState.IsValid)
    	{
    		var product = new Product();
    		product.Id = model.Id;
    		product.Name = model.Name;
    		product.Price = model.Price;
    		product.Active = model.Active;
    		product.CreateDate = DateTime.Now;
    		_context.Add(product);
    		await _context.SaveChangesAsync();
    		return Redirect(WebUtility.UrlDecode(Request.Query["ref"].ToString()));
    	}
    	ViewData["ref"] = Util.getRef(Request, "/Product");
    	return View(model);
    }
    

    Not only for CRUD operations, StackPuz also generates the source code for the User Authentication and User Authorization modules. so it can reduce the repetitive tasks when creating a new Web Application project.

    StackPuz supports many Web Application Frameworks like React, Vue, Angular, Express, Laravel, .NET, Spring and also supports the most popular relational databases including MySQL, SQL Server, PostgreSQL and Oracle.

    See also[edit]

    References[edit]

    1. "Definitions of Web-related terms MVC". 20 December 2023.
    2. "ASP.NET Scaffolding Overview". 4 March 2022.

    External links[edit]


    This article "StackPuz" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:StackPuz. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.