A voting APP.
-
Authenticated users can:
- create a poll with any number of possible items
- keep their polls and come back later to access them
- see the aggregate results of all polls(implemented using Charts)
- vote on every polls(one time on each poll)
- share all polls with their friends.
-
Unauthenticated users just can:
- see the aggregate results of all polls(implemented using Charts)
- Unit test (Doing)
- Coverage to 6% -- updated 2017-05-22
- Coverage to 29% -- updated 2017-05-26
- Coverage to 50% -- updated 2017-06-04
- Coverage to 73% -- updated 2017-06-13
- Code formate (Doing)
List page data pagination(done by @maokailu)
I am grateful to any one for contributing bugfixes, issues and improvements~
-
Install node.js Ubuntu/Mac , Windows
-
Clone this project
git clone https://github.com/elevenbeans/we-voting.git cd we-voting
-
Install local dependencies
npm install
For *nix (including Mac),
Run ./start.sh
Or export NODE_ENV=dev-HMR && ./start.sh
(enable HMR).
For windows,
npm run bundle // compile and bundle js files
npm run start // start node server
npm run watch // watching changes
Don't forget to run Mongodb in your dev environment : )
Run export NODE_ENV=pre && ./start.sh
.
Run export NODE_ENV=production && ./start.sh
.
Run npm run build
Run npm run test
.
Or,
Run npm run cover
to see test case coverage.
- Enviroment: Node
- Framework: Express
- Tools: Request, compression, body-praser
- Template engine: Ejs
- DataBase: Mongodb
- JS standard: ECMAScript 6
- Framework: React + ReactDOM + React-Router
- Module bundler and compiler: Webpack + Babel
- Open source components: react-d3-components
-
home page
- router:
/
- example:
https://we-voting-ele.herokuapp.com/
- router:
-
list page
- router:
/list(/:name)
- example:
https://we-voting-ele.herokuapp.com/list
- router:
-
detail page
- router:
/detail(/:id)
- example:
https://we-voting-ele.herokuapp.com/detail/1494908221812
- router:
-
new page
- router:
/new
- example:
https://we-voting-ele.herokuapp.com/new
- router:
|-- client // front-end code
|-- components // front-end components
|-- footer.jsx // public footer
|-- header.jsx // public header
|-- loading.jsx // loading amination
|-- spning.jsx // spning amination
|-- lib // front-end library
|-- utils.jsx
|-- detail.jsx // detail page
|-- home.jsx // home page
|-- index.jsx // front-end intrance
|-- list.jsx // list page
|-- new.jsx // new page
|-- controller // server-end controller
|-- routes
|-- login.js // login routes
|-- view.js // view routes
|-- api.js // api controller
|-- DBhandler.js // DataBase CRUD
|-- dist // compiled front-end code
|-- vendor
|-- jquery.min.js
|-- bootstrap.min.js
|-- bootstrap.min.css
|-- react-dom.min.js // react-dom production version
|-- react.min.js // react production version
|-- loading.css
|-- vote.bundle.js // bundled voteApp intrance file
|-- router.bundle.js // bundled react-router
|-- detail.chunk.js // splitted JS file in detail page
|-- home.chunk.js // splitted JS file in home page
|-- list.chunk.js // splitted JS file in list page
|-- new.chunk.js // splitted JS file in new page
|-- views // server-end views
|-- error.ejs
|-- footer.ejs
|-- header.ejs
|-- index.ejs
|-- .gitignore
|-- Procfile // heroku file
|-- README.md
|-- index.js // app intrance file
|-- package.json
|-- serverConfig.js // enviroment configuration
|-- start.sh // start file for mac
|-- webpack.config.js