DONE
- rest end points for user registration, email verification, login
- rest end points for poll creation, voting, result counting
- all the functional repositories and entities
- GraphQL endpoints for poll related operations
- migration to h2 database
- added eureka service discovery
- added zuul api gateway/ proxy server
- registered polling service as eureka client
- added some integration tests and unit tests
- added swagger documentation
- consumed number to word soap web service
- added spring security
TODO:
- exception handling for all the rest endpoints
- ui (preferably react)
- comment microservice
- tests for every feature
- rest api good practices
- NoSQL
HLD:
-
Requirements
- system will support authentication, authorization, different user roles (google/facebook sign in, email verified username password authentication)
- any user can will be able to create poll, with expiration Date Time
- poll can have multiple questions with multiple choices
- link for for poll will be shared with users once poll becomes active
- other users will be add poll to watchlist if poll is public or else only admin will have access to it
- admin will be able to see graph based result per questions for given poll.
- super admins will be able to review and activate poll if it satisfies content policies.
- system should have monitoring system to give health of system and various services, also should generate alerts about failures/load/performance.
-
System interface definition
-
Security related interface authentication()
authorization() -
User related interface
crudOpForUser(User user) -
Poll related interface
addPoll(String userId, Poll poll)
loadMyPolls(String userId)
loadPublicPolls()
loadResults(Poll poll)
selectChoice(String questionId, String choiseId, String userId)
-
-
Back-of-the-envelope estimation
there can be millions of users/polls in system. -
Model For System
USER: ID, FULL_NAME, USERNAME, EMAIL, PASSWORD, CREATED_AT, UPDATED_AT
POLL: ID, USER_ID, NAME, IS_PUBLIC, IS_ACTIVE, EXPIRATION_DATE_TIME, CREATED_BY, UPDATED_BY,CREATED_AT, UPDATED_AT
QUESTION : ID, POLL_ID, VALUE
CHOICE : ID, QUESTION_ID, VALUE
VOTE : ID, QUESTION_ID, CHOCE_ID, USER_ID
*(mysql db will be used)
-
High-level design
todo: add block diagram
- Detailed design (To Do)
- How we will handle hot polls
- Where should we introduce cache to speed up things
- what are some bottlenecks in system and what can be done about those.
- What components need better load balancing?