Poll is a web application that presents site visitors with a simple single question survey.
The software in this repository was used to quickly build and release an application with just enough features for a Minimum Viable Product (MVP).
I used it to run a short-lived survey for a small virtual monthly public speaking meeting I co-host called Beyond Soft Talk (BSG).
When a user initially visits the site, they are presented with the following "Welcome" page:
After making their selections and hitting the submit button (not pictured) users are redirected to the following "Thank You" page:
The core design constraint of this project requires that the system be Cloud/Deployment environment agnostic.
Anyone could easily fork this code and deploy it to an on-premises or cloud environment without having to redesign or rewrite the application.
I also wanted to avoid introducing extra third-party dependencies on popular No-Code Form Builders such as SurveyMonkey, Cognito Forms, and Google Forms.
This section of the guide is written for a developer interested in cloning this repository to modify it or deploy it as-is to their own environment. To use it, a basic knowledge of MongoDB Cloud Atlas db administration is required
If you are interested in additional details on these prereqs ask -- I'm happy to provide them.
Any cloud provider can be used (AWS, Azure, Heroku, GCP).
For its ease of use and ability to scale from 0 to n instances as needed on demand I chose Google Cloud Platform App Engine.
The following steps can be run from a Unix-based Terminal. I'm using bash
as my shell in the samples below.
Following these steps, keeps development costs down, as we essentially assemble the binary artifacts GCP requires for execution in an APP ENGINE environment ahead of time (on a local development or build server). It also allows the application to be spun up only when users clicked a link shared with them via email.
gcloud
CLI cd $projectDir
./gradlew bootJar
$projectDir/build/libs
./gradlew generateAppYaml
app.yaml
that contains the value of APP_MONGODB_CONN
will be generated to $projectDir/build/libs
cd $projectDir/build/libs
gcloud app deploy ./poll-0.0.3-SNAPSHOT.jar --appyaml=./app.yaml
At this time, it is a heavy lift to design, add or display alternate questions. To make this single-question poll survey reusable in other contexts, a configurable question provider would be a great feature to have.
ℹ️ Note: See GitHub issue #2 for further details.
Deployment instructions (for additional cloud platforms) and automated steps to provision any required infrastructure (including the MongoDB Atlas database) would also be a nice-to-have.
The survey works best on desktop/laptop systems or tablets with larger screen sizes. On Mobile, we do use some of MDBootstraps built-in breakpoints to adjust positioning of text boxes (based on screen size), but the available dates table uses the "table-responsive" CSS class. This allows the content to be viewable using a horizontal scrollbar. An alternate UX design optimized for smaller screen sizes that avoids scrolling would be a future nice-to-have.
Creating new opportunities for innovation and collaboration is what make open source software special.
If you would like to use this code in a derived work of your own, please fork the repository.
If you have any changes you would like to potentially contribute back simply create a pull request.
Thanks!
Copyright (c) 2023 Tony Castrogiovanni