Survey System

Survey System

This is an inhouse survey system and dashboard.Produced surveys used in other application

Technical Aspects

Used Stack :

  • Pure Javascript & jquery
  • Html
  • CSS
  • Parcel for bundler
  • Bakcend : .Net Core EF

This dashboard created with pure javascript.😣One of my oldest projects.It was challenging for me. Cause as you know , i had to implement all things from scratch.

For example , i implemented an API requester even for easy api requests

const baseApi = "http://18.192.-----:90";
export const apiInfos = {

    routes: {
        "postSurvey": baseApi + '/api/Surveys',
        "getAllSurveys": baseApi + '/api/Surveys/getAll',
        "getSingleSurvey": baseApi + '/api/Surveys/', // :ID
        "deleteSurvey": baseApi + '/api/Surveys/', // : ID
        "changeCurrentSurvey": baseApi + '/api/Surveys/',// :ID 
        "publishSurvey": baseApi + '/api/Surveys/Publish/',// :ID
        "unpublishSurvey": baseApi + '/api/Surveys/UnPublish/',// :ID
        "getSurveyAnswers": baseApi + '/api/SurveyAnswers/Counts/',// :ID
        "accountLogin": baseApi + '/api/Account/Login'
    }
}


export const apiRequester = (function () {

    // ERROR HANDLER
    function handleError(errTitle, errText) {
        swal({
            type: 'error',
            title: 'Service Error',
            text: 'Error occured .Seems that service is unavaliable right now.Please wait and try again'
        })
        preloaderModule.removePreloader();
    }

    function beforeFetch() { preloaderModule.createPreloader() }
    var bearer_token = localStorage.tritailToken ? JSON.parse(localStorage.tritailToken) : '';
    var bearer = 'Bearer ' + bearer_token;

    // HEADERS
    var myHeaders = new Headers();
    myHeaders.append("client", localStorage.client);
    myHeaders.append('Authorization', bearer);
    myHeaders.append("Content-Type", "application/json");
    //myHeaders.append("Authorization", "test");

    var getOptions = {
        method: 'GET',
        headers: myHeaders,
        withCredentials: true,
    }

    return {

        'get': (url) => {
            beforeFetch()
            return fetch(url, getOptions)
                .then(e => e.json())
                .catch(err => handleError(err, err))

        },

        'post': (url, body) => {
            beforeFetch()
            return fetch(url, {
                method: 'POST',
                headers: myHeaders,
                body: JSON.stringify(body)
            })
                .then(e => e.json())
                .catch(err => handleError(err, err))
        },

        'patch': (url, body) => {
            beforeFetch()
            return fetch(url, {
                method: 'PATCH',
                headers: myHeaders,
                body: JSON.stringify(body),
            })
                .then(e => e.json())
                .catch(err => handleError(err, err))
        },

        'put': (url, body) => {
            beforeFetch()
            return fetch(url, {
                method: 'PUT',
                headers: myHeaders,
                body: JSON.stringify(body),
                redirect: 'follow'
            })
                .then(e => e.json())
                .catch(err => handleError(err, err))
        },

        'delete': (url, id) => {
            beforeFetch()
            return fetch(url + id, {
                method: 'DELETE',
                headers: myHeaders,
            })
                .then(e => e.json())
                .catch(err => handleError(err, err))
        },
    }
})()

I planned backend models & controllers.And integrated survey.js to the dashboard. The final product was a fully functional and scalable survey system. I used this system to create surveys for inhouse projects and for other applications.

Here are some screens :

survey
survey
survey
survey