Giter Site home page Giter Site logo

odixon / formify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from basharath/formify

0.0 0.0 0.0 1.84 MB

An open source application to create, manage and embed contact forms on static/dynamic sites with no code

Home Page: https://formify.vercel.app

License: MIT License

Shell 0.21% JavaScript 8.11% TypeScript 87.52% CSS 4.15%

formify's Introduction

Formify

Formify licence Formify forks Formify stars Formify issues Formify pull-requests

Formify is an open source application that lets you create, manage and embed contact forms on any site without writing code.

This project is done as a part of PlanetScale and HashNode hackathon.

How formify works?

  1. Visit formify.vercel.app
  2. Create an account by signing up
  3. Create a form and copy the script
  4. Embed the script on any site
  5. Whenever somebody submits the form you can see the data in the submissions of Formify dashboard

Sample script that get's copied on clicking the code icon

<script src="https://formify.vercel.app/script.min.js"></script>
<script>
  const fields = 'name,email,message'.split(',').filter((f) => f);
  const formURL = 'https://formify.vercel.app/api/forms/submissions?id=<ID-of-the-form>';
  const heading = 'Contact/feedback';
  formifyInit(fields, formURL, heading);
</script>

To embed forms as components on react based sites, use formify-form npm library

import { Form } from 'formify-form';

const App = () => {
  return (
    <div>
      <Form
        formFields={['name', 'email', 'message']}
        formURL="https://formify.vercel.app/api/forms/submissions?id=<ID from formify>"
        formTitle="Share your feedback"
      />
    </div>
  );
};

Video demo

To see all the above instructions lively, check this demo video below.

FormEasy video demo

Tech stack used in formify

  • NextJS
  • TypeScript
  • PlanetScale MySQL database
  • Prisma ORM
  • Tailwind CSS

To get started with formify setup locally

  1. Clone the repo
git clone https://github.com/Basharath/Formify.git
  1. Install the dependencies
cd Formify
npm install
  1. Set the environment variables as given in .env.example and rename the file to .env
PLANETSCALE_PRISMA_DATABASE_URL=mysql://<USERNAME>:<PLAIN_TEXT_PASSWORD>@<ACCESS_HOST_URL>/<DATABASE_NAME>?sslaccept=strict
JWT_PRIVATE=<Secret key>
SERVER=<URL of the site>
NEXT_PUBLIC_GOOGLE_CLIENT_ID=<Google auth client ID>
  • To get PLANETSCALE_PRISMA_DATABASE_URL sign up and create a database on planetscale.com and get the connection URL for Prisma.
  • Put any secret text for JWT_PRIVATE which is used to sign JWT tokens
  • SERVER is the URL of the site you will be creating. This is used to give the location for the script source.
  • To get NEXT_PUBLIC_GOOGLE_CLIENT_ID visit Google cloud credentials and create a new credentials for the website and get the client ID.
  1. After all the above environment variables are set, run the below command(s).
npx prisma db push
npx prisma generate # This runs automatically in the previous command

This pushes the Prisma schema to the database and generates schema types to use with the Prisma client

  1. Once all the above steps are done, start the dev server by running the following command
npm run dev

Formify app starts running locally with your set database and other details

License

Formify is distributed using the MIT License. Check the License details.

formify's People

Contributors

basharath avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.