Deploy Now for free!
Surveyo is a sample app that provides users with a survey tool that they can use to quickly create and respond to surveys. Advanced users can use Surveyo’s GraphQL endpoint to run complex queries on survey results. This app demonstrates how to use React hooks with Apollo client to create surveys, collect responses, visualize responses with charts, export responses into CSV, and delete surveys. Deploying this app on Slash GraphQL deploys both the back-end database service and a front-end React app in a single click, no credit card required. To learn about this sample app, see: Building a Survey Forms App with GraphQL.
- Supports Short Answer, Multiple-Choice Question, Date Query and Rating type of questions
- Visualize responses collected as Pie Chart, Word Cloud and Bar chart
- Provides inline GraphiQL IDE to make GraphQL queries to chart data directly
- Export survey responses into CSV.
- React (3.4.1)—a JavaScript library for building user interfaces.
- Apollo Client (3.1.1)—a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL.
- Auth0 React—Auth0 SDK for React Single Page Applications (SPA).
- AntDesign—a design system for enterprise-level products.
- Chart.js—a simple yet flexible JavaScript charting for designers & developers
- TypeScript—extends JavaScript by adding types.
- GraphiQL—a graphical interactive in-browser GraphQL IDE
- Dgraph Cloud—a fully managed GraphQL backend service.
- Using Auth0—how to use auth0.
- Auth0—Secure access for everyone.
- Copy the entire contents of the
schema_noauth.graphql
file located in the root folder of the application. - Open your
Graphql Client
, you can check some GraphQL clients here or open aterminal
and run the following command:curl -X POST localhost:8080/admin/schema --data-binary <@SCHEMA_NOAUTH.GRAPHQL>
, which contains the code copied in step 1. - To run the application locally, locate the
ApolloConfig.js
file in the applicationsrc
folder and locate thecreateApolloClient
function. Change the value of the constantGRAPHQL ENDPOINT
tohttp://localhost:8080/graphql
. - In the root folder of the application, open a terminal and run the following commands:
npm install
followed bynpm start
.
- Copy the entire contents of the
schema_auth.graphql
file located in the root folder of the application. - Open your
Graphql Client
, you can check some GraphQL clients here or open aterminal
and run the following command:curl -X POST localhost:8080/admin/schema --data-binary <@SCHEMA.GRAPHQL>
, which contains the code copied in step 1. - Create an authentication service account on: Auth0.
- After creating your Auth0 account, follow the instructions provided here to set up Auth0 authentication.
- In the root folder of the application, open a terminal and run the following commands:
npm install
followed bynpm start
.
-
To configure Surveyo with Slash GraphQL, create a
.env
file and addREACT_APP_GRAPHQL_ENDPOINT
to the endpoint of your Slash cluster. -
In Slash GraphQl, Load the schema from schema.graphql present in this repo
-
Start the frontend
We use Auth0 for authorisation. The snippets for auth0 configuration are checked in the code here. The steps of configuring Auth0 dashboard are mentioned in the blog post here. After configuring Auth0 dashboard, update the Auth0 config used in the code present in src/AuthConfig.json.