Easy and quick online poll api in nodejs
- Nodejs, not an ancient one please, soruce code uses some es6 and not using a transpiler, tested on v7.7.1. Use nvm if you want to rum multiple version of nodejs.
- MySQL
- git client for sure
- Create a database on your database sever.
git clone https://github.com/deepak-jacob/online-poll.git- Edit src/config.json and set you connection string.
npm install
Happy to help, raise an issue if you are facing any difficulty please.
npm startnpm testnpm run devnpm run tdd
/api/poll/create- for creating new poll/api/poll/up- for casting a vote/api/poll/:poll_id- for results
Jump into test/test.js for detailed infomantion on how to use api.
express- most simple and minimal web frameworksequelizejs- a promise-based ORM for Node.js v4 and up. It supports the dialects PostgreSQL, MySQL, SQLite and MSSQL and features solid transaction support, relations, read replication and more.ES6mocha and chai- for testmysql- dev did on mysql but you can you anysequelizejssupported database without any changes.
- Check and refine the data returned each calls
- Starttime and endtime checking
- Send mail and validate each vote.
- Implement a redis queue to handle millions of request and process votes from that queue.
- Finish all restful api's
- More test
- Use vagrant for easy dev env setup
- Deployment helpers, dockerize, etc
Feature request and PRs welcome.
MIT