Nucleo-Estudantes-Informatica-ISEP / antirecurso

Wanna pass your exams? We gotcha! 😉
https://antirecurso.nei-isep.org
GNU General Public License v3.0
11 stars 7 forks source link

Adopt SSR #66

Closed tomasflopes closed 5 months ago

tomasflopes commented 5 months ago

Due to the project's nature and timeframe (developed almost always during the exams), some architectural decisions were not right and are now hurting the platform performance (and related costs).

The issue is, as we are using a React Context to store the auth data, all the pages are considered Client Components. Given this, we are not taking advantage of the main resource that Next.js can offer related to caching.

This would help in the costs associated with the db and backend (as the hits on both would greatly reduce due to Vercel caching) and would enhance UX as the load times would be reduced to a minimum.

Of course, there are some components that really need to be client as they required user interaction, but almost all the app is considered a client component and that does not make any sense. There are a lot of better (and safer) ways to store auth data (e.g. cookies) and it would solve the issue. We started this way, but due to some bugs someone thought that the context would be the better way to solve the issue (and it really did) but now is raising concerns that are more important.

dimaguy commented 5 months ago

I believe DEI offers virtual machines to students, I haven't tested this, but I think that if it works as "advertised" you'd likely be able to cut down drastically on costs until optimization is put in place

tomasflopes commented 5 months ago

Thanks for the suggestion! While virtual machines could potentially help cut costs, we're steering clear of them due to our team's rotational nature. Introducing additional processes to maintain consistency in infrastructure ownership isn't ideal for us.

dimaguy commented 5 months ago

Thanks for the suggestion! While virtual machines could potentially help cut costs, we're steering clear of them due to our team's rotational nature. Introducing additional processes to maintain consistency in infrastructure ownership isn't ideal for us.

Have you tried talking to the professors in charge of the servers? You could probably arrange a deal that would allow for group access to the machine using one's student credentials, with the president of the NEI or a sponsoring professor supervising the accesses

EDIT: nevermind I just described a process that's not ideal