Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major Backend Rework #34

Merged
merged 5 commits into from
Sep 17, 2024
Merged

Major Backend Rework #34

merged 5 commits into from
Sep 17, 2024

Conversation

Piyuuussshhh
Copy link
Owner

  • ops.rs was the most fucked rust code anyone would've ever seen. Had to refactor and implement a better, scalable design.
  • which is what this PR aims to do.

Advantages

  1. Implementing Habits is easier than ever now.
  2. The code is readable and modular.
  3. Coupling and cohesion levels are better than ever. Earlier all db stuff was done in ops.rs, now its modularized.
  4. Files and functions do what they are NAMED to do. Nothing less, nothing more.
  5. Finally made me realise the importance of reading the documentation and understanding the features a framework offers T_T (if i'd known about State<'_, T>, why would I do what I did in the first place? That singleton was my best effort at mimicking state management.)

Cons

  1. Exporting now takes a while because the pdf file has to be created BEFORE it can be saved using the file system dialog. Earlier, the pdf file was created when the user pressed the 'Save' button.
  2. Took me the entirety of yesterday and made me suffer from imposter syndrome.

Stuff Left To Do In This PR:

  1. I think many variables are marked as pub simply in todo.rs.
  2. The database file needs to be named according to the user's operating system. It was implemented in the old code, I was too busy to do it in this version. Left as an exercise for @Arnax308 lmao.

…ffected (basically all pieces calling tauri commands and some small ones using state variables here and there)
…abase by a linear search over all fetched todos from today
@Piyuuussshhh
Copy link
Owner Author

Long export times are now fixed!

@Piyuuussshhh Piyuuussshhh merged commit f446949 into main Sep 17, 2024
@Piyuuussshhh Piyuuussshhh deleted the fix-ops branch September 17, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant