Introducing (*insert drumrolls) HashPoll
A utility to create fun-little polls for Hashnode and beyond.
Hashpoll is a hashnode widget that enables seamless polls on any post. It is a lightweight tool that generates code for you to put in hashnode's widget field to create polls that just blend in with the rest of your content. You can use it directly from the command line or the Web interface, and use your poll as needed.
A little widgety talk
Wait, you can put polls in Hashnode now?
Yessss, that's what Hashpoll is all about. While Hashnode doesn't have an official poll option, it does have an amazing option to extend its functionality. This can be done through the use of an awesome feature called widgets.
So, how do I make a poll from this widget wizardry you speak of?
That's where Hashpoll comes in, when you create a poll on Hashpoll, it generates the required code for you to create a Hasnode widget. You just need to put this code into the required place in your blog settings as instructed here and you are golden.
Repositories and URLs
Let's get these out of the way for chaps who are just here for them.
Repos
URLs
Services Diagram
The following diagram shows the flow of data and the underlying services used.
The whole backend with all the AWS services and the FastAPI service are created and provisioned by Amplify. Amplify handled data modelling, authentication, GraphQL API, and Docker-based deployments making the whole process a breeze.
Here is a screenshot of the data modelling process in the Amplify Studio.
The CLI Commands
The following are the commands for the Hashpoll CLI.
Create
This is the command to create polls from the CLI.
hashpoll create [question] --option1 [option1] --option2 [option2] --option3 [option3] --option4 [option4]
or
python -m hashpoll create [question] --option1 [option1] --option2 [option2] --option3 [option3] --option4 [option4]
Tips
- Put the question or options (if multiple words) in quotes to avoid the terminal registering this as multiple arguments.
- If you miss adding one of the options, the program will prompt you for entering them.
View
This is a command for viewing all details of a particular poll.
hashpoll view [Poll ID]
or
python -m hashpoll view [Poll ID]
Vote
This is a command to vote on a specific poll.
hashpoll vote [Poll ID] [Option Number]
or
python -m hashpoll vote [Poll ID] [Option Number]
Open-poll
This is a simple command to open a poll in the default browser.
hashpoll open-poll [Poll ID]
or
python -m hashpoll open-poll [Poll ID]
Results
This is a command to fetch the current data from poll responses.
hashpoll results [Poll ID]
or
python -m hashpoll results [Poll ID]
Code
This is handy command to generate the Hashnode Widget Code for a particular poll.
hashpoll code [Poll ID]
or
python -m hashpoll code [Poll ID]
Features
Hashpoll is equipped with the following features as of now:
- Both CLI and Web interfaces
- Integrates seamlessly with Hashnode
- Easy to integrate with Hahsnode and other tools
- No trackers whatsoever
- Many new and exciting upcoming features
Technologies Used
Client
- Svelte
- PicoCSS
- Typer
- Rich
Server
- AWS Amplify and provisioned AWS services
- FastAPI
Roadmap
Following are the features we are trying to add to Hashpoll:
- Password Protection
- Authentication
- Ability to modify a poll
- In-depth analytics
License
Hashpoll has been released under the MIT License.
Acknowledgements
Hashpoll would like to thank the teams behind the following projects as they played a crucial part in enabling Hahpoll.
Feedback
Please tell us if you like Hashpoll.
If you have any other suggestions, please drop an email over at arpan@hackersreboot.tech.
Thanks!
Thank you dear readers for reading this article, don't forget to try Hashpoll out. See you next time!