/strawpoll

(mini-strawpoll clone, needs CSS) WIP, overengineered real-time poll web app. Functional backend using Scala (http4s, cats, circe, doobie) and semi-functional frontend using ReasonReact

Primary LanguageScalaApache License 2.0Apache-2.0

strawpoll

This will be a small strawpoll clone, that will not have the authentication features since I suck at that. This is an educational project that will eventually be hosted.

Reasoning for Language Choices

The backend is based on scala-pet-store. The frontend is based on Reason's QuickStart, which I normally don't use (I use Reason Scripts).

Scala has an amazing backend ecosystem, while Reason is amazing on the frontend, which is why I chose them for their respective roles. Reason is not yet mature enough to attract beginners for its backend usage. However, for the frontend, it feels much more natural to use than Scala.js for a JavaScript programmer like me.

Frontend Src

TODO

Doing it pretty much from top to bottom.

  • UI
    • New Poll
    • Vote
    • Results
  • Duplicate Votes Checker
    • IP Addr. Checking
    • Browser Cookie Checking
  • Auth
  • Public vs Private Polls
    • Allow Public Polls to be in a "Trending" section. That'd be cool

Architecture

Backend:

  • http4s, cats, doobie, circe

Frontend:

  • reason-reroute

Strategies:

  • short-polling for now

Developing

Shell 1:

sbt
# Shell will pop up, and these commands will be very useful:
# reload on save: reStart
# lint: scalafmt

Shell 2:

yarn && yarn start # npm install && npm run start

Shell 3:

yarn webpack # npm run webpack

And then go to localhost.