Git Product home page Git Product logo

dynamic-forms's Introduction

Acre Tech Task

To run the development server:

npm run dev

Open http://localhost:3000 to view it in the browser.

Also you can find a deployed version here: https://dynamic-forms-nine.vercel.app/

See the teck task in the "Acre Frontend ... .pdf" file.

Implementatino Notes

(According to the tech task description)

  1. In the data folder you will find form Schema.json with the required structure. To view form data after submission, you need to open the console.

  2. To add input validation I modified the json field and added this logic to the components (see Input.tsx, RadioGroup.tsx)

  3. In the FormGenerator.tsx file I added a map to keep such depndencies and then I added theonChange function for the function to display channges accroding to the validation rules

  4. To solve the problem with dynamic journeys, I would create custom forms for each user based on their profile information. So the process will be as follows:

    1. Collect all the necessary information about the user during the registration process
    1. Send this data to the database
    1. When a user opens any form, the application should make a request and ask the backend to provide a customized JSON form based on the user's responses, which are stored in the database.

Visible improvements

There are of course a lot of things to improve in this project, such as:

  1. Fix current bugs (especially, with the handleSubmit function in the FormGenerator), add types to events
  2. Add Redux to make filling out and storing form data easier.
  3. Add tests
  4. Add additional form libraries to make them easier (For example, Formik)
  5. Rewrite Field.tsx using the Builder design pattern instead of Switch.
  6. Create a custom React library for all components and simply reuse them in this project.
  7. Add scripts for CI/CD to run tests during the build process.

dynamic-forms's People

Stargazers

Ivan Skadorva avatar

Watchers

James Cloos avatar Ivan Skadorva 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.