mirror of
https://github.com/Wolvan/poll.horse.git
synced 2024-11-21 20:47:59 +01:00
Mirror of https://github.com/Wolvan/poll.horse
9fa3eabad1
The frontend should work without having JS enabled. JS will enhance the experience but should under no circumstance be necessary. To achieve this, the entire entry system has been turned into a form that posts its values to a new backend path specifically made to take form responses. Instead of returning an API response, it also redirects the browser to either the voting page on successful creation or the frontpage with a bunch of get parameters that are used to prefill the form in a server-side rendering process. An error parameter is also given but there is no way to display said error for now. |
||
---|---|---|
.vscode | ||
frontend | ||
src | ||
test | ||
utils | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.json | ||
.gitignore | ||
.mocharc.json | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md | ||
tsconfig.json |
Poll.horse
Simple polling service for public polls
With strawpoll being somewhat very broken I decided to implement my own. Let's go!
What is this
If you have never used strawpoll, in short this is a website to easily make small polls without a fuss.
Contributing
The core is written in TypeScript, a typed superset to Javascript and executed with NodeJS. Pull Requests welcome.
Before cloning this repository, make sure you have Node installed.
Then clone this repository, open a terminal/command prompt and type npm i
to install the required dependencies.
ts-node
is recommended to test during development, install it with npm i -g ts-node typescript
.
Directory Structure
./dist
- The finalized and compiled files that can be used with node./src
- The source files of the project./test
- Files required for unit testing, aka test setup/teardown and test spec files./utils
- Various utility scripts not part of the main source code
Scripts
Execute the scripts with npm run <script>
find-todo
- Finds remainingTODO:
in the code and warns the developer that there are still things that are unfinishedmocha
- Runs the unit tests in the/test
directorylint
- Runseslint
and checks for code styling problemsbuild
- Compile the TypeScript Source todist/
test
- Runslint
,find-todo
andmocha
in orderdebug
- Start the./src/main.ts
with node and start the debugger on port 9229start
- Runtest
andbuild
, then try and execute the./dist/main.js
in the./dist
directory to test