Skip to content

Repository files navigation

πŸ—ƒ Forma

Data Collector as a Service β€” your personal server for HTML forms.

BuildTemplate

Roadmap

Motivation

  • We need better integration with static sites built with 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 18.06.0-ce or above
  • Docker Compose 1.22.0 or above
  • Go 1.9.2 or above
  • GNU Make 3.81 or above
$ make up demo status
Name Command State Ports
---------------------------------------------------------------------------------------------------------------
forma_db_1 docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
forma_server_1 /bin/sh -c echo$BASIC_USE ... Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
forma_service_1 service run --with-profili ... Up 0.0.0.0:8080->80/tcp, 0.0.0.0:8090->8090/tcp,
0.0.0.0:8091->8091/tcp, 0.0.0.0:8092->8092/tcp
$ open http://127.0.0.1.xip.io/api/v1/10000000-2000-4000-8000-160000000004
$ make help
GET curl /api/v1/UUID
$ curl http://127.0.0.1.xip.io/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># <input type="submit"># </form>
POST /api/v1/UUID
$ curl -v -H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "email=test@my.email" \
http://127.0.0.1.xip.io/api/v1/10000000-2000-4000-8000-160000000004
# > POST /api/v1/10000000-2000-4000-8000-160000000004 HTTP/1.1# > Host: 127.0.0.1.xip.io# > User-Agent: curl/7.54.0# > Accept: */*# > Content-Type: application/x-www-form-urlencoded# > Content-Length: 21# ># < HTTP/1.1 302 Found# < Location: http://localhost/api/v1/10000000-2000-4000-8000-160000000004#eyJpbnB1dCI6ImJmM2MyYWIwLWVkYjQtNDFiZi1iNDlkLWY3ZjNiMmI5ZDViMiIsImlkIjoiMTAwMDAwMDAtMjAwMC00MDAwLTgwMDAtMTYwMDAwMDAwMDA0IiwicmVzdWx0Ijoic3VjY2VzcyJ9# < 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. Or you can choose Postman - its import data is here and here.

CLI

You can use CLI not only to start the HTTP server but also to execute CRUD operations.

Service command-line interface
$ make install
$ form-api help
Forma
Usage:
form-api [command]
Available Commands:
completion Print Bash or Zsh completion
ctl Forma Service Control
help Help about any command
migrate Apply database migration
run Start HTTP server
version Show application version
Flags:
-h, --help helpfor 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 REQ_VER=2.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 forma.tar.gz
$ curl -sL -o forma.tar.gz \
https://github.com/kamilsk/form-api/releases/download/"${REQ_VER}/form-api_${REQ_VER}_${REQ_OS}-${REQ_ARCH}".tar.gz
$ tar xf forma.tar.gz -C "${GOPATH}"/bin/ && rm forma.tar.gz

Docker Hub

$ docker pull kamilsk/form-api:2.x
# or use mirror
$ docker pull quay.io/kamilsk/form-api:2.x

From source code

$ egg github.com/kamilsk/form-api@^2.0.0 -- make test install
# or use mirror
$ egg bitbucket.org/kamilsk/form-api@^2.0.0 -- make test install

egg1 is an extended go get.

1 The project is still in prototyping.↩


made with ❀️ for everyone

About

πŸ“‡ Data Collector as a Service.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

21 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages