Go to file
gilesb a52fae9ef9 ... 2024-03-09 21:47:21 +00:00
.github/workflows Lint PHP code psr-12, add GH action 2024-02-23 11:54:12 +01:00
app ... 2024-03-09 21:27:15 +00:00
bootstrap Initial commit 2022-09-20 21:59:52 +02:00
client ... 2024-03-09 21:47:21 +00:00
config Lint PHP code psr-12, add GH action 2024-02-23 11:54:12 +01:00
database Lint PHP code psr-12, add GH action 2024-02-23 11:54:12 +01:00
docker Optimize template images + disable image optim docker (#313) 2024-02-06 19:56:14 +01:00
public Appsumo (#232) 2023-11-01 16:58:10 +01:00
resources Change form created email 2024-02-27 09:54:06 +01:00
routes try again 2024-03-09 15:32:32 +00:00
storage Block Temporary mail addresses (#116) 2023-04-28 11:37:39 +02:00
tests Fix file type case sensitive validation 2024-02-29 10:49:55 +01:00
.babelrc Initial commit 2022-09-20 21:59:52 +02:00
.dockerignore Reworked docker scripts for new nuxt infrastructure (#285) 2024-01-18 16:35:45 +01:00
.editorconfig Initial commit 2022-09-20 21:59:52 +02:00
.env.docker Reworked docker scripts for new nuxt infrastructure (#285) 2024-01-18 16:35:45 +01:00
.env.example Improve .env.example - Add codemirror dependency 2024-01-18 16:07:19 +01:00
.gitattributes Initial commit 2022-09-20 21:59:52 +02:00
.gitignore Cleaning up 2024-01-15 12:26:22 +01:00
.styleci.yml Initial commit 2022-09-20 21:59:52 +02:00
Dockerfile path to widgets 2024-03-09 17:00:44 +00:00
LICENSE Changing license to AGPL 2022-09-20 22:03:59 +02:00
README.md Add .env docker explanation in readme 2024-02-29 13:25:49 +01:00
_ide_helper_models.php Adding Custom domains (#247) 2023-11-29 14:53:08 +01:00
amplify.yml Attempt to simplify build 2024-01-08 22:30:58 +01:00
artisan Initial commit 2022-09-20 21:59:52 +02:00
composer.json Lint PHP code psr-12, add GH action 2024-02-23 11:54:12 +01:00
composer.lock Lint PHP code psr-12, add GH action 2024-02-23 11:54:12 +01:00
phpunit.xml Fix JS middlewares ⚒️ 2023-01-27 18:55:02 +01:00
pint.json Lint PHP code psr-12, add GH action 2024-02-23 11:54:12 +01:00
server.php Initial commit 2022-09-20 21:59:52 +02:00
vapor.yml Increase lambda memory in production 2024-02-11 12:20:38 +01:00

README.md

OpnForm

Github Stars Commits per month License Report a bug Ask a question Ask a question Ask a question Open Bounties Rewarded Bounties

An open-source form builder. It's an alternative to products like Typeform, JotForm, Tally etc.

Features

  • No-code form builder, with infinite number of fields & submissions
  • Text inputs, Date inputs, URL inputs, Phone inputs, Email inputs, Checkboxes, Select and Multi-Select inputs, Number Inputs, Star-ratings, File uploads & more
  • Embed anywhere (on your website, in your Notion page, etc)
  • Email notifications (for both form owner & form respondents)
  • Hidden fields
  • Form passwords
  • URL form pre-fill
  • Slack integration
  • Webhooks
  • Form logic
  • Customize colors, add images or even some custom code
  • Captcha form protection
  • Form closing date
  • Limit the number of submissions allowed

And much more!

Bounties

Get paid for contributing to OpnForm! Here are our open bounties:

Bounties of OpnForm

Getting started with OpnForm

The easiest way to get started with OpnForm is with the official managed service in the Cloud.

It takes 1 minute to try out the builder for free. You'll have high availability, backups, security, and maintenance all managed for you.

Requirements

  • PHP >= 8.0
  • MySQL/MariaDB or PostgreSQL
  • Node.js and NPM/Yarn/... to compile assets

Installation

Docker installation 🐳

This can be built and run locally but is also hosted publicly on docker hub at jhumanj/opnform and is generally best run directly from there.

Running from docker hub

docker run --name opnform -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform

You should now be able to access the application by visiting http://localhost in a web browser.

👀 Server Deployment: If you are deploying OpnForm on a server (not locally), then you will need to use 2 .env files to configure the app URLs (APP_URL in .env and both NUXT_PUBLIC_APP_URL & NUXT_PUBLIC_API_BASE in client/.env).

The -v argument creates a local directory called my-opnform-data which will store your database and files so that your work is not lost when you restart the container.

The --name argument names the running container so that you can refer back to it later, with e.g. docker stop opnform. You can use any name you'd like.

Using custom .env files

If you have custom env file you can use them like so:

Custom Laravel .env file:

docker run --name opnform -v $PWD/custom-laravel-env-file.env:/app/.env -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform

Custom Nuxt .env file:

docker run --name opnform -v $PWD/custom-nuxt-env-file.env:/app/client/.env -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform

This would load load in the env file located at my-custom-env-file.env, note that if you are creating a .env file for use like this it's best to start from the .docker.env example file as there are slightly different defaults for the dockerized setup.

Using a custom HTTP port

To run on port 8080

docker run --name opnform -v $PWD/my-opnform-data:/persist -p 8080:80 jhumanj/opnform

Building a custom docker image

To build a custom docker image from your local source code use this command from the root of the source repository:

docker build . -t my-docker-image-name

This should create a new docker image tagged my-docker-image-name which can be run as follows:

docker run --name opnform -v $PWD/my-opnform-data:/persist -p 80:80 my-docker-image-name

Upgrading docker installations

Please consult the upgrade instructions for the latest opnform version, e.g. if upgrading from v1 to v2 please check the v2 instructions as the process may change in future releases.

Normal upgrade procedure would be to stop the running container, back up your data directory (you will need this backup if you want to rollback to the old version) and then start a container running the new image with the same arguments.

e.g. if you're running from a specific opnform version with

docker run --name opnform -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform:1.0.0

You could run:

# stop the running container
docker stop opnform
# backup the data directory
cp -r my-opnform-data my-opnform-backup
# start the new container
docker run --name opnform-2 -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform:2.0.0

Then if everything is running smoothly you can delete the old container with:

docker rm opnform

If you haven't specified a version e.g. if you are using the image jhumanj/opnform or jhumanj/opnform:latest you will need to run docker pull jhumanj/opnform or docker pull jhumanj/opnform:latest before starting the new container.

Using Laravel Valet

This section explains how to get started locally with the project. It's most likely relevant if you're trying to work on the project. First, let's work with the codebase and its dependencies.

# Get the code!
git clone git@github.com:JhumanJ/OpnForm.git && cd OpnForm

# Install PHP dependencies
composer install 
 
 # Install JS dependencies
cd client && npm install

# Compile assets (see the scripts section in package.json)
npm run dev # or build

Now, we can configure Laravel. We just need to prepare some vars in our .env file, just create it with cp .env.example .env then open it!

Configure the desired database in the DATABASE_ section. You can fine tune your installation on the laravel documentation.

Run these artisan commands:

# Generate needed secrets 🙈
php artisan key:generate
php artisan jwt:secret # and select yes!

# Creates DB schemas
php artisan migrate

Now, create an S3 bucket (or equivalent). Create an IAM user with access to this bucket, fill the environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION, AWS_BUCKET. In your AWS bucket permissions, add the following under "Cross-origin resource sharing (CORS)":

[ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "PUT", "POST", "GET", "DELETE" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [] } ]

🎉 Done! Enjoy your personal OpnForm instance at: http://opnform.test.

Tech Stack

OpnForm is a standard web application built with:

Contribute

You're more than welcome to contribute to this project. We don't have guidelines on this yet, but we will soon. In the meantime, feel free to ask any question here.

License

OpnForm is open-source under the GNU Affero General Public License Version 3 (AGPLv3) or any later version. You can find it here.