Skip to content
/ forms Public

A form management library and web service written in Golang

License

Notifications You must be signed in to change notification settings

coopgo/forms

Repository files navigation

coopgo/forms

made-with-Go GitHub go.mod Go version of a Go module go.dev reference

coopgo/forms is a web service written in Golang to handle forms data using différent data formats, protocols and backends

Communication protocols (transports) :

  • HTTP API (REST)
  • gRPC

Multiple transports can be run at the same time.

Different data backends / storages can be set :

  • Memory (temporary storage, for development/testing purpose)
  • PostgreSQL database (might also work with CockroachDB but not tested yet as we use the pgx driver compatible with both PostgreSQL and CockroachDB). PostgreSQL backend relies heavily on database tables/schemas generated on the fly (each table stores data from one form, even for unstructured forms, without defined schemas), so that we can easily plug another tool to visualize data like Apache Superset, Metabase or NocoDB.
  • Kantree (one way) (TODO : add some documentation about this)
  • Email with SMTP (one way)
  • Webhooks (one way)

"One way" backends do not store the form states. They could be better considered as "connectors" to other services, but are designed as the other backends in the code (they implement the same interface Backend).

At least one storage has to be set at the service level globally. These global storages cannot be "one way". Supported "global" storages are at the moment : Memory (temporary storage : only for development) and PostgreSQL

Multiple additional storages can be set for each form individually.

Our priority is to support memory (for easy development purpose), PostgreSQL, Kantree and Email (because that's our internal needs at COOPGO), but feel free to contribute something else (other databases, connectors to other services like chat apps, webhooks, etc...) if you want it first.

We have different types of forms :

  • Structured forms : forms with a defined schema. Every response must match the given schema. Structured forms schemas are defined using the JSON Type Definition standard.
  • Unstructured forms : forms accepting any input

Project Status

This project is still in development. It should be kind of functional using the PostgreSQL backend for simple use cases. Efforts still need to be made to support more complex forms with PostgreSQL and to implement other backends.

gRPC implementation and development considerations

This project uses protoc and protoc-gen-go-grpc to handle gRPC transport. You need to install and run them to build the project of changing anything on the gRPC side.

See https://grpc.io/docs/languages/go/quickstart/ for more details on how it works.

If you already know basics on this and have everything installed correctly, here is the command line to generate GRPC/Protocol buffers code inside the grpc package :

$ protoc -I grpc/ grpc/*.proto --go-grpc_out=./ --go_out=./

Contributing

We welcome any contributions following theses guidelines :

  • Any change to the code of the library must not break any transport or backend. Any new feature should be implemented for all if applicable.
  • Write simple, clear and maintainable code and avoid technical debt.
  • Leave the code cleaner than when you started.
  • Refactoring existing code for better performance, better readability or better testing wins over creating a new feature.

If you want to contribute, you can fork the repository and create a pull request.

Bug report

For reporting a bug, you can open an issue using the Bug Report template. Try to write a bug report that is easy to understand and explain how to reproduce the bug. Do not duplicate an existing issue and keep each issue specific to an individual bug.

License

coopgo/forms is under the Apache 2.0 license. Please refer to the LICENSE file for details.

About

A form management library and web service written in Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published