Go to file
Julien Nahum 0adce5a2ff
Migrate front-end to Nuxt app (#284)
* wip

* Managed to load a page

* Stuck at changing routes

* Fixed the router, and editable div

* WIP

* Fix app loader

* WIP

* Fix check-auth middleware

* Started to refactor input components

* WIP

* Added select input, v-click-outside for vselect

* update vselect & phone input

* Fixed the mixin

* input component updates

* Fix signature input import

* input component updates in vue3

* image input in vue3

* small fixes

* fix useFormInput watcher

* scale input in vue3

* Vue3: migrating from vuex to Pinia (#249)

* Vue3: migrating from vuex to Pinia

* toggle input fixes

* update configureCompat

---------

Co-authored-by: Forms Dev <chirag+new@notionforms.io>

* support vue3 query builder

* Refactor inpus

* fix: Vue3 Query Builder - Logic Editor (#251)

* support vue3 query builder

* upgrade

* remove local from middleware

* Submission table pagination & migrate chart to vue3 (#254)

* Submission table Pagination in background

* migrate chart to vue3

* Form submissions pagination

* Form submissions

* Fix form starts

* Fix openSelect key issue

---------

Co-authored-by: Forms Dev <chirag+new@notionforms.io>
Co-authored-by: Julien Nahum <julien@nahum.net>

* Vue 3 better animation (#257)

* vue-3-better-animation

* Working on migration to vueuse/motion

* Form sidebar animations

* Clean code

* Added animations for modal

* Finished implementing better animations

---------

Co-authored-by: Forms Dev <chirag+new@notionforms.io>

* Work in progress

* Migrating amplitude and crisp plugin/composable

* Started to refactor pages

* WIP

* vue3-scroll-shadow-fixes (#260)

* WIP

* WIP

* WIP

* Figured out auth & middlewares

* WI

* Refactoring stores and templates pages to comp. api

* Finishing the templates pages

* fix collapsible

* Finish reworking most templates pages

* Reworked workspaces store

* Working on home page and modal

* Fix dropdown

* Fix modal

* Fixed form creation

* Fixed most of the form/show pages

* Updated cors dependency

* fix custom domain warning

* NuxtLink migration (#262)

Co-authored-by: Forms Dev <chirag+new@notionforms.io>

* Tiny fixes + start pre-rendering

* migrate-to-nuxt-useappconfig (#263)

* migrate-to-nuxt-useappconfig

* defineAppConfig

---------

Co-authored-by: Forms Dev <chirag+new@notionforms.io>

* Working on form/show and editor

* Globally import form inputs to fix resolve

* Remove vform - working on form public page

* Remove initform mixin

* Work in progress for form create guess user

* Nuxt Migration notifications (#265)

* Nuxt Migration notifications

* @input to @update:model-value

* change field type fixes

* @update:model-value

* Enable form-block-logic-editor

* vue-confetti migration

* PR request changes

* useAlert in setup

* Migrate to nuxt settings page AND remove axios (#266)

* Settings pages migration

* remove axios and use opnFetch

* Make created form reactive (#267)

* Remove verify pages and axios lib

---------

Co-authored-by: Julien Nahum <julien@nahum.net>

* Fix alert styling + bug fixes and cleaning

* Refactor notifications + add shadow

* Fix vselect issue

* Working on page pre-rendering

* Created NotionPages store

* Added sitemap on nuxt side

* Sitemap done, working on aws amplify

* Adding missing module

* Remove axios and commit backend changes to sitemap

* Fix notifications

* fix guestpage editor (#269)

Co-authored-by: Julien Nahum <julien@nahum.net>

* Remove appconfig in favor of runtimeconfig

* Fixed amplitude bugs, and added staging environment

* Added amplify file

* Change basdirectory amplify

* Fix loading bar position

* Fix custom redirect (#273)

* Dirty form handling - nuxt migration (#272)

* SEO meta nuxt migration (#274)

* SEO meta nuxt migration

* Polish seo metas, add defaults for OG and twitter

---------

Co-authored-by: Julien Nahum <julien@nahum.net>

* migrate to nuxt useClipboard (#268)

* Set middleware on pages (#278)

* Se middleware on pages

* Se middleware on account page

* add robots.txt (#276)

* 404 page migration (#277)

* Templates pages migration (#275)

* NuxtImg Migration (#279)

Co-authored-by: Julien Nahum <julien@nahum.net>

* Update package json

* Fix build script

* Add loglevel param

* Disable page pre-rendering

* Attempt to allow svgs

* Fix SVGs with NuxtImage

* Add .env file at AWS build time

* tRGIGGER deploy

* Fix issue

* ANother attrempt

* Fix typo

* Fix env?

* Attempt to simplify build

* Enable swr caching instead of prerenderign

* Better image compression

* Last attempt at nuxt images efficiency

* Improve image optimization again

* Remove NuxtImg for non asset files

* Restore templates pages cache

* Remove useless images + fix templates show page

* image optimization caching + fix hydratation issue form template page

* URL generation (front&back) + fixed authJWT for SSR

* Fix composable issue

* Fix form share page

* Embeddable form as a nuxt middleware

* Fix URL for embeddable middleware

* Debugging embeddable on amplify

* Add custom domain support

* No follow for non-production env

* Fix sentry nuxt and custom domain redirect

* remove api prefix from routes (#280)

* remove api prefix from routes

* PR changes

---------

Co-authored-by: Julien Nahum <julien@nahum.net>

* nuxt migration -file upload - WIP (#271)

Co-authored-by: Julien Nahum <julien@nahum.net>

* Fix local file upload

* Fix file submissions preview

* API redirect to back-end from nuxt

* API redirect to back-end from nuxt

* Remove old JS app, update deploy script

* Fix tests, added gh action nuxt step

* Updated package-lock.json

* Setup node in GH Nuxt action

* Setup client directory for GH workflow

---------

Co-authored-by: Forms Dev <chirag+new@notionforms.io>
Co-authored-by: Chirag Chhatrala <60499540+chiragchhatrala@users.noreply.github.com>
Co-authored-by: Rishi Raj Jain <rishi18304@iiitd.ac.in>
Co-authored-by: formsdev <136701234+formsdev@users.noreply.github.com>
2024-01-15 12:14:47 +01:00
.github/workflows Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
app Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
bootstrap Initial commit 2022-09-20 21:59:52 +02:00
client Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
config Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
database Enabled null for some form jsonb fields 2023-12-02 15:23:57 +01:00
docker Fix docker 2023-09-14 15:06:45 +02:00
public Appsumo (#232) 2023-11-01 16:58:10 +01:00
resources Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
routes Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
storage Block Temporary mail addresses (#116) 2023-04-28 11:37:39 +02:00
tests Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
.babelrc Initial commit 2022-09-20 21:59:52 +02:00
.dockerignore (#146) Re-wrote the docker code to generate a single self-contained d… (#153) 2023-07-27 11:34:19 +02:00
.editorconfig Initial commit 2022-09-20 21:59:52 +02:00
.env.docker Remove stripe keys from docker file 2023-11-07 12:31:35 +01:00
.env.example Fix typo in .env.example 2023-12-05 12:18:49 +01:00
.gitattributes Initial commit 2022-09-20 21:59:52 +02:00
.gitignore Add docker compose setup (#73) 2023-02-22 19:13:32 +01:00
.styleci.yml Initial commit 2022-09-20 21:59:52 +02:00
Dockerfile Fix dockerfile + polish landing copy 2023-09-09 13:10:49 +02:00
LICENSE Changing license to AGPL 2022-09-20 22:03:59 +02:00
README.md Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
_ide_helper_models.php Adding Custom domains (#247) 2023-11-29 14:53:08 +01:00
amplify.yml Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
artisan Initial commit 2022-09-20 21:59:52 +02:00
composer.json Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
composer.lock Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00
phpunit.xml Fix JS middlewares ⚒️ 2023-01-27 18:55:02 +01:00
server.php Initial commit 2022-09-20 21:59:52 +02:00
vapor.yml Migrate front-end to Nuxt app (#284) 2024-01-15 12:14:47 +01:00

README.md

OpnForm

Github Stars Commits per month License Report a bug 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 🐳

⚠️ Warning: the Docker setup is currently not working as we're migrating the front-end to Nuxt. Track progress here.

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.

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 a custom .env file

If you have a custom env file you can use this like so:

docker run --name opnform -v $PWD/my-custom-env-file.env:/app/.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.