Iteration 3 Plan - GToidZ/ku-polls GitHub Wiki

Goal

Add user authentication to KU Polls and change the app model from "anyone can vote freely" to "1 vote per 1 authenticated user."

Features

  1. Users with credentials can authenticate (login) to the application.
  2. Guests can freely browse and see polls and their results but cannot vote.
  3. Authenticated users can cast their vote on any polls but can vote once per poll.
  4. A user can change their vote by selecting a new choice.
  5. A user can change their vote only within a poll's timeframe.
  6. When a user, revisit their answered polls, they see a selected radio button on the choice they have voted for, indicating their latest answer.
  7. Administrators can create, edit and delete user credentials.

Milestone

  1. Application development - develop a web application with Django.
    1. Users can authenticate with the correct credentials. (Authentication implementation; migration)
    2. Only authenticated users can vote. (Authentication mixin)
    3. Administrators can create, edit, delete user credentials. (Admin page modification)
  2. UI/UX improvement - improve UI/UX of the application.
  3. Code review - review, fix and document project's source code respecting style guides and standards.
  4. Iteration 3 - completing iteration three with deployable application.

Acceptance Criteria

  1. Application can be logged in with user credentials.
  2. Only authenticated users can vote and change their votes.
  3. All tests passing.
  4. User interface after authentication implementation should keep the same look and feel.
  5. Everything works (deployable) on the iteration3 branch and must be merged into master.

Retrospective

What went right?

The third iteration was successfully implemented with all the requirements that are functionalities.

The migration of models with new attributes went fine and database reading/writing works perfectly. Additionally, I have no problem when deleting fields, which is great.

User authentication works out-of-box, saving time and doesn't require tests on User model.

Voting now requires user authentication and each user has only one vote per poll, works as intended.

Web interface is more interactive with user, such as providing feedback on hovering some elements.

Everything works on development deploy.

What went wrong?

The website has an unintended bug that I cannot find a workaround yet, when a user edits their vote without authentication, it redirects to login, once logged in, it won't check on the radio button. Maybe, it's due to requesting to vote view?

Not everything should work on production yet. (Especially, static files.)

When has been learned?

  • Django's User saves time for coding and testing.
  • I think I got hang of ForeignKey and relationship fields in databases.
  • I took advantage of using filters to lookup in the database more efficiently.