goradd

command module
v0.13.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 2 Imported by: 0

README

GoRADD

A rapid Web application development framework for Go.

GoRADD is a monolithic web development framework for rapidly creating a web application from a concept in your mind and then allowing you to as easily as possible maintain that application through all the twists and turns of the change process. It is ideal for prototyping, intranet websites, websites that are very data intensive with many forms to gather information from users, websites that require the security and speed of a compiled language, websites with thousands of simultaneous users, and websites being maintained by one or a small group of developers. It is particularly good for developers new to GO and/or new to web development.

Installation

See the Quick Start guide to get started.

Requirements

  • A supported database up and running on your local development computer. Current supported databases are:
    • Mysql
For Developing GoRADD itself
  • Sass (to build the css files from the scss source)

Goals

  1. 80-20 rule, where out of the box GoRADD will do most of the hard work of building a website, and will quickly get you a working website, but not necessarily one that you will want to ship. GoRADD is architected to allow you to make changes and plug in other open-source software as you need.
  2. Incremental changes. Most development processes go through a lengthy requirement analysis process, followed by a design process, and a lengthy build process, only to find out that what you built wasn't really what was needed. Instead, GoRADD gets you a working website quickly, and then lets you build out your application incrementally. It tries to make it easy to restructure your website, even at the data structure level, and have your changes filter through your application quickly without requiring a complete rewrite.
  3. Layered development. GoRADD has its code, you have your code, and then there is an in-between interface that changes over time. GoRADD uses code generation to create this interface, and clearly delineates the code that you can change to modify the interface, vs. code that it will generate as you change your data model. The result is a product that is easy to change as your world and requirements change.
  4. Most development happens in GO. What the user does in the browser is mirrored on the server, which allows you to work in a way that feels like you are building a desktop application. This makes your developers more productive and it allows you to build your app using common GO tools like the built-in unit test environment and documentation server. You can still work in javascript if you want to or need to do custom UI work, but often you don't have to.
  5. Stability. We want to build applications that real people use, and that means reliance on tried and true technologies that work on a broad range of browsers and servers, rather than technologies that require lots of Polyfills for emerging standards. JQuery is currently required, and partly because we want to make it easy to create Bootstrap based applications. However, Bootstrap has announced that they are removing reliance on JQuery, and we will attempt to do so as well.
  6. Progressive enhancement. If you use the provided widgets, you can create a website that works even if the client turns off Javascript. All major browsers are currently supported, but we hope to support Opera Mini as well.
  7. Rich libraries of widgets. GoRADD provides standard widgets corresponding to basic html controls, and also provides Bootstrap widgets. If you have a particular css or javascript widget library you want to support, building the GoRADD interface is fairly easy to do, and the Bootstrap library included gives you a model to follow.
  8. Scalability. GoRADD is architected for scalability. All user state information is serializable to key-value stores. You might need to build the interface to the particular key-value store you are interested in, but that is not difficult. Some specific issues to consider:
    1. GoRADD requires a MySQL database at this point for your main data store. SQL is great for creating most common data structures, is great when you need to change your structure without destroying data, and is fast enough for most applications. However, all data access is done through a common API, so switching an application that is already written to another SQL database like Postgresql, Oracle, or any other database is very straight-forward and is just a matter of implementing the database layer. In fact, the database layer is generic enough that you could switch to a NoSQL implementation as your product matures and you need scalability at speed.
    2. GoRADD maintains the state of each user of the website in something we call the pagestate. The pagestate is serializable to any key-value store. Currently, only an in-memory store is provided, but writing an interface to any common key-value store is easy.
    3. Live updates work through a pub/sub mechanism. Goradd provides a single-server in-memory system out of the box, but its easy to switch to any other pub/sub mechanism, including distributed systems like pubnub, ally, google cloud messaging, etc. There are no payloads with the messages and traffic is minimal.
Future Goals
  • WebComponents. WebComponent architecture fits particularly well with goradd's architecture. However, WebComponents are not fully supported by all major browsers. As WebComponents gain traction, we hope to use them for future browser widgets. In the mean-time, we support many JQuery based widgets.
  • Matching GraphQL or GraphQL like interface. The ORM architecture has many similarities to GraphQL, and could potentially auto-generate a GraphQL interface to make it easy to integrate a mobile app interface.
Anti-patterns
  1. GoRADD's html server is not microservice based. While you can create microservices that serve parts of your application, at its core goradd is a monolithic framework that includes an ORM, an MVC architecture, and a basic control and form management library.
  2. Object-oriented. Some of goradd uses a code pattern that mirrors traditional object-oriented inheritance and gets around some of GO's limitations in this area, including implementing virtual functions. We have found this particularly useful in the control library. If you hate inheritance, goradd is not for you. If you don't mind it, but you still like object composition too, this is your place.
  3. Code generation. GoRADD relies heavily on code generation, and in particular uses the related github.com/goradd/got template engine to generate code.

Acknowledgements

GoRADD is a port of the PHP framework QCubed. QCubed itself was a fork of the PHP framework written by Mike Ho called QCodo. Mike is the original mastermind of many of the concepts in GoRADD, like:

  • A code-generated ORM
  • The use of "nodes" to describe database entities AND the relationships between them.
  • Code-generated CRUD forms to get you started.
  • Scaffolding that separates code-generated code from developer code so that code-generation can continue throughout the life of the project.
  • A lightweight javascript layer for processing events and actions through ajax.
  • The formstate engine to mirror the state of html and javascript widgets on the server-side so that the server-side engineer has complete control over what is happening in the html without needing to write javascript.

GoRADD relies on a number of other open-source projects, including:

GoRADD was created and is maintained by Shannon Pekary

Thanks To

JetBrains for use of the GoLand Go Editor

BrowserStack BrowserStack for automated browser testing tools

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
codegen
The ideas package contains code that is not being used, but that we might use some day and include, but right now we don't want to support it.
The ideas package contains code that is not being used, but that we might use some day and include, but right now we don't want to support it.
internal
install/goradd-project/auth
This auth package is an example of how to do authentication and authorization in goradd.
This auth package is an example of how to do authentication and authorization in goradd.
install/goradd-project/tmp/template
The template package contains generated templates from the pre-generation process for codegen.
The template package contains generated templates from the pre-generation process for codegen.
install/goradd-project/web/app
The app package contains your local application object.
The app package contains your local application object.
install/goradd-project/web/form
This form package is a place for you to put your application's forms.
This form package is a place for you to put your application's forms.
travis/goradd-test
This application puts the browser tests into an application that will launch a server, run the tests and then exit with the results of the tests.
This application puts the browser tests into an application that will launch a server, run the tests and then exit with the results of the tests.
pkg
auth
package auth provides a default authentication framework based on user name and password.
package auth provides a default authentication framework based on user name and password.
bootstrap
The bootstrap package is an example of an add-on module to goradd.
The bootstrap package is an example of an add-on module to goradd.
datetime
The datetime package contains utilities for time and date related functions.
The datetime package contains utilities for time and date related functions.
html
The HTML package includes general functions for manipulating html tags, comments and the like.
The HTML package includes general functions for manipulating html tags, comments and the like.
i18n
The i18n package provides support services for translation of goradd web pages and widgets.
The i18n package provides support services for translation of goradd web pages and widgets.
javascript
Package javascript converts go objects and types to javascript code, suitable for embedding in html or sending to the browser via a specialized ajax call.
Package javascript converts go objects and types to javascript code, suitable for embedding in html or sending to the browser via a specialized ajax call.
log
Package log provides logging support for the application and framework developers
Package log provides logging support for the application and framework developers
math
This math package contains number utlities that are not included in the Go math library, but that are still very useful.
This math package contains number utlities that are not included in the Go math library, but that are still very useful.
messageServer
The messageServer package implements a general purpose messaging platform based on the gorilla websocket implementation.
The messageServer package implements a general purpose messaging platform based on the gorilla websocket implementation.
orm/db
The db package works with the rest of the orm to interface between a database and the ORM abstraction of reading and querying a database.
The db package works with the rest of the orm to interface between a database and the ORM abstraction of reading and querying a database.
orm/op
The op package contains operation and aggregation nodes that can be added to a QueryBuilder.
The op package contains operation and aggregation nodes that can be added to a QueryBuilder.
orm/query
The query package primarily contains code used internally by the framework to build queries.
The query package primarily contains code used internally by the framework to build queries.
page
Package page is the user-interface layer of goradd, and implements state management and rendering of an html page, as well as the framework for rendering controls.
Package page is the user-interface layer of goradd, and implements state management and rendering of an html page, as well as the framework for rendering controls.
page/action
Package action defines actions that you can trigger using events.
Package action defines actions that you can trigger using events.
page/control
Package control contains the implementations of the standard controls in goradd.
Package control contains the implementations of the standard controls in goradd.
page/widget
The widget package contains supported composite and special purpose controls that are not part of the html standard
The widget package contains supported composite and special purpose controls that are not part of the html standard
resource
package resource manages http resources that you serve based on a static path to the resource.
package resource manages http resources that you serve based on a static path to the resource.
session/location
The location package implements a location queue built on top of the session service.
The location package implements a location queue built on top of the session service.
stringmap
package stringmap contains utilities to handle common map operations
package stringmap contains utilities to handle common map operations
sys
url
package url contains url utilities beyond what is available in the net/url package
package url contains url utilities beyond what is available in the net/url package
test
browsertest
Package test contains the test harness, which controls browser based tests.
Package test contains the test harness, which controls browser based tests.
web
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL