WIP - Feat/Vote with database
Co-authored-by: Romain Lanz [email protected]
What this PR is about?
Add database connection for vote
If it's a new feature
- [x]
featureCreate a PHP script to add vote endpoints with ip verification - [x]
featureAdd MYSQL database support - [x]
featureAdd vote on the front side - [ ]
featureAdd env to connect the real database - [ ]
featureDisable 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)
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?
For example, I went to localhost:4200 from your branch, and I have this error message:

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