The app is built with:
- UI: React with TypeScript, Vite, and SASS/SCSS
- Server: ASP.NET Core (C#), using Entity Framework Core as the ORM (Object Relational Mapper)
- Database: PostgreSQL
- Hosting: Vercel (UI) and Heroku (Server)
Initially, I used SQLite for my app. However, I quickly discovered that Heroku doesn't support SQLite well, as its ephemeral file system causes data loss upon app restarts. To resolve this, I switched to PostgreSQL, using Heroku's built-in PostgreSQL add-on, which provides better scalability and persistence.
2. Preventing Users from Seeing Quiz Answers in the Network TabI considered the possibility that users who know how to inspect the Network tab in their browser could view quiz answers before attempting them. This was a serious concern, as it could compromise the integrity of the quiz.
From a performance perspective, making a request every time the user advances to the next question is inefficient. Instead, I decided to fetch all questions for a selected category at once. However, this introduces the risk of exposing answers in the network response.
Solution: Encrypting Answers Before Sending Them to the Client
To prevent answer leakage, I implemented client-side encryption:
- The UI generates a unique encryption key using Crypto API whenever it requests questions.
- This key is sent securely to the server, which uses it to encrypt the answers before sending them back.
- The UI then decrypts the answers using the same key, ensuring they remain unreadable in transit.
This approach enhances security while maintaining efficient data retrieval.
There are other challenges as well, but the above caused the most trouble.
What specific areas of your project would you like help with?I will update the Readme.md
in my repository on how to setup and run the application on local machine, but that would take some time.
In the meantime, feel free to ask me any question regarding this solution.