choiceof.dev icon indicating copy to clipboard operation
choiceof.dev copied to clipboard

WIP - Feat/Vote with database

Open WilliamTraoreee opened this issue 3 years ago • 2 comments

Co-authored-by: Romain Lanz [email protected]

What this PR is about?

Add database connection for vote

If it's a new feature

  • [x] feature Create a PHP script to add vote endpoints with ip verification
  • [x] feature Add MYSQL database support
  • [x] feature Add vote on the front side
  • [ ] feature Add env to connect the real database
  • [ ] feature Disable vote behavior if user has already vote on the front side

Tests

  • [x] I have run the tests of the project. nx affected --target=test

Clean Code

  • [x] I made sure the code is type safe (no any)

WilliamTraoreee avatar Oct 26 '22 17:10 WilliamTraoreee

For the users that clone the project and wants to quickly try it on their machine, I would like to be sure that they can still use the project like it was before, with random values, without any need for docker or any db. Is it the case?

And also the behavior really cool would be that we send the information to backend, but either or not the use has already answered the question before, we just show him the current count + 1 and we let him pass to the next question. I mean, we don't need to wait for the answer of the API call to display the result of the vote. The final user does not care if the API call went well. Do you know what I mean?

bdebon avatar Oct 29 '22 11:10 bdebon

For example, I went to localhost:4200 from your branch, and I have this error message: image

I would be nice that in the case this fetch does not work, we use the random values and we don't break the application

bdebon avatar Oct 29 '22 12:10 bdebon