Code Monkey home page Code Monkey logo

freshsurvey's Introduction

FreshSurvey

A simple survey app that records users answers and ratings

You can find the working demo at https://marigameo.github.io/FreshSurvey/

Features implemented

  1. On opening the site, the use can answer questions one by one.
  2. The user should be able to move from one screen to the other and back.
  3. On the final question, if the user clicks on submit, they are shown a confirmation screen.
  4. The response is sent to an API via POST call. Mocked to this service https://mockapi.io/
  5. On refreshes during a form fillup, user will be redirected to the last question he has seen with all previous answers persisted.
  6. Once a form is submitted successfully, the state is reset and if the page is refreshed, it goes back to the home page.

Extra addon feature:

  • A small analytics dashboards to display the stats of survey in charts
  • Used chart JS
  • Error handling - implemented custom disappearing snackbar component for both success & error scenarios for better UX

Steps to clone and run the application

Tech & API's

  • Vanilla JS, HTML5, CSS3
  • Questions are loaded from a self hosted JSON payload at github pages
  • Local storage to preserve user survey inputs while form manipulation
  • Session cookie to keep track of active session & route to tabs on refresh
  • Mock api to post survey form payload - Mockapi.io
  • Hosted on github pages

Unit tests

  • No testing frameworks like jest /mocha is being used
  • Simple vanilla JS utility/framework to unit test common util methods & component creation utils
  • Not much validations are involved here - as the survey app we're not restricting users to mandatory fill all the fields & most fields would be pre-filled (with some default active options)

How to run the tests?

  • Just open the test.html file in chrome browser (preferrably)/local live server (if installed)
  • And, you can see the test running & results in browser console

Note: Few negative test case validations are commented. Feel free to uncomment & test for wrong inputs

App Screenshosts

screen1

screen2

screen3

screen4

screen5

screen6

backend mock api data

Addon - Dashboard UI

backend mock api data

Contact

Find more projects at my Portfolio

freshsurvey's People

Contributors

marigameo avatar

Stargazers

Roman avatar

Watchers

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