Go HTML Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github check checklist May 4, 2018
cmd issue #165: integrate executor and test current API Aug 15, 2018
docs rename Form API to Forma Jul 21, 2018
env update protobuf, add possibility to provide ID (for demo purpose) Aug 17, 2018
pkg fix #81: add Input method for Schema Aug 17, 2018
vendor update dependencies and add gopkg.in/DATA-DOG/go-sqlmock.v1 Aug 14, 2018
.gitattributes little improvements of error.html Feb 2, 2018
.gitignore update .gitignore May 4, 2018
.goreleaser.yml fix #73: add Go 1.10; fix #72: add postgres config; update dependencies Feb 19, 2018
.scrutinizer.yml exclude protobuf generated files Jul 14, 2018
.travis.yml strict rules for go version in travis config Jul 31, 2018
Gopkg.lock update dependencies and add gopkg.in/DATA-DOG/go-sqlmock.v1 Aug 14, 2018
Gopkg.toml update dependencies and add gopkg.in/DATA-DOG/go-sqlmock.v1 Aug 14, 2018
LICENSE fix #11: add API specification link Jan 23, 2018
Makefile
README.md issue #151: change Recover logic Aug 15, 2018
main.go fix #81: add Input method for Schema Aug 17, 2018
main_test.go fix #152: add interface convergence test Aug 1, 2018

README.md

Forma Tweet

Analytics Data Collector as a Service — your personal server for HTML forms.

Patreon Build Status Code Quality Go version Code Coverage Research License

Roadmap

Motivation

  • We need better integration with static site generators like Hugo.
  • We want cheaper products than Formata or FormKeep.
  • We have to full control over our users' data and protect it from third parties.

Quick start

Requirements:

  • Docker 17.09.0-ce or above
  • Docker Compose 1.16.1 or above
  • Go 1.9.2 or above
  • GNU Make 3.81 or above
$ make up demo status

       Name                     Command               State                                  Ports
------------------------------------------------------------------------------------------------------------------------
form-api_db_1        docker-entrypoint.sh postgres    Up      0.0.0.0:5432->5432/tcp
form-api_server_1    /bin/sh -c envsubst '$SERV ...   Up      80/tcp, 0.0.0.0:80->8080/tcp
form-api_service_1   form-api run --with-profil ...   Up      0.0.0.0:8080->80/tcp, 0.0.0.0:8090->8090/tcp, 0.0.0.0:8091

$ curl http://localhost:8080/api/v1/10000000-2000-4000-8000-160000000004
# <form id="10000000-2000-4000-8000-160000000004" lang="en" title="Email subscription"
#       action="http://localhost/api/v1/10000000-2000-4000-8000-160000000004" method="post"
#       enctype="application/x-www-form-urlencoded">
#       <input id="10000000-2000-4000-8000-160000000004_email" name="email" type="email" title="Email"
#              maxlength="64" required="true"></input>
# </form>
$ curl -v -H "Content-Type: application/x-www-form-urlencoded" \
       --data-urlencode "email=test@my.email" \
       http://localhost:8080/api/v1/10000000-2000-4000-8000-160000000004
# > POST /api/v1/10000000-2000-4000-8000-160000000004 HTTP/1.1
# > Host: localhost:8080
# > User-Agent: curl/7.54.0
# > Accept: */*
# > Content-Type: application/x-www-form-urlencoded
# > Content-Length: 21
# >
# < HTTP/1.1 302 Found
# < Location: https://kamil.samigullin.info/#eyJpZCI6IjEwMDAwMDAwLTIwMDAtNDAwMC04MDAwLTE2MDAwMDAwMDAwNCIsInJlc3VsdCI6InN1Y2Nlc3MifQ==
# < Date: Sat, 05 May 2018 09:34:47 GMT
# < Content-Length: 0
# <

Specification

API

You can find API specification here. Also, we recommend using Insomnia HTTP client to work with the API - you can import data for it from the file.

CLI

$ form-api --help
Forma

Usage:
  form-api [command]

Available Commands:
  completion  Print Bash or Zsh completion
  help        Help about any command
  migrate     Apply database migration
  run         Start HTTP server
  version     Show application version

Flags:
  -h, --help   help for form-api

Use "form-api [command] --help" for more information about a command.

Bash and Zsh completions

You can find completion files here or build your own using these commands

$ form-api completion -f bash > /path/to/bash_completion.d/form-api.sh
$ form-api completion -f zsh  > /path/to/zsh-completions/_form-api.zsh

Installation

Brew

$ brew install kamilsk/tap/form-api

Binary

$ export VER=1.0.0      # all available versions are on https://github.com/kamilsk/form-api/releases/
$ export REQ_OS=Linux   # macOS and Windows are also available
$ export REQ_ARCH=64bit # 32bit is also available
$ wget -q -O form-api.tar.gz \
       https://github.com/kamilsk/form-api/releases/download/"${VER}/form-api_${VER}_${REQ_OS}-${REQ_ARCH}".tar.gz
$ tar xf form-api.tar.gz -C "${GOPATH}"/bin/ && rm form-api.tar.gz

Docker Hub

$ docker pull kamilsk/form-api:1.x

From source code

$ egg github.com/kamilsk/form-api@^1.0.0 -- make test install

Mirror

$ egg bitbucket.org/kamilsk/form-api@^1.0.0 -- make test install

egg is an extended go get.

Update

This application is in a state of MVP and under active development. SemVer is used for releases, and you can easily be updated within minor versions, but major versions can be not BC-safe.


Gitter @kamilsk @octolab

made with ❤️ by OctoLab