Data Collector as a Service β your personal server for HTML forms.
- v1: MVP
- May 31, 2018
- Main concepts and working prototype.
- v2: Accounts and CLI CRUD
- August 31, 2018
- Command line interface for create, read, update and delete operations above gRPC.
- v3: Templating and RESTful API
- Someday, 20xx
- Template system and Edge Side Includes/Server Side Includes support.
- Integrate gRPC gateway.
- Improve gRPC layer.
- v4: DSL for validation and CSI
- Sometime, 20xx
- Domain-specific language to define validation rules.
- Client-side integration.
- Graphical user interface and admin panel to perform create, read, update and delete operations.
- 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.
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 protected]" \
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
# <
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.
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 help for form-api
Use "form-api [command] --help" for more information about a command.
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
$ brew install kamilsk/tap/form-api
$ 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 pull kamilsk/form-api:2.x
# or use mirror
$ docker pull quay.io/kamilsk/form-api:2.x
$ 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
1 The project is still in prototyping.β©
made with β€οΈ for everyone