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

Improvement Request: Restructure of tribler-core #6177

Closed
drew2a opened this issue Jun 23, 2021 · 5 comments
Closed

Improvement Request: Restructure of tribler-core #6177

drew2a opened this issue Jun 23, 2021 · 5 comments
Assignees

Comments

@drew2a
Copy link
Contributor

drew2a commented Jun 23, 2021

The current structure of core is definitely better than 7.3.0 but it is still far from perfection.
I'm almost "one-year-tribler-developer" but still confused with the navigation and with the purpose of some folders.

I want to suggest one small step further.

The structure might look like this:

tribler_core
|communities
|accounting
|tunnel
|popularity
|gigachannel
|remote_query
|database
|mds
|ledger_zero
|rest
|libtorrent
|channels
|tunnels
|components
|libtorrent
|category_filter
|resource_monitor
|torrent_checker
|trust_calculation
|torrent_checker
|upgrade
|utilities

Why rest placed outside communities or components? Because it represents the whole Core-API and should be easy to find for those who want to use it.

Why database placed outside of mds? Because it is one of the core Tribler's parts that has been used from several components and communities and deserves its place in a hi-level of the structure.

Feel free to comments on a structure itself or on naming in particular.
When we will reach a consensus it will take one day of my time to implement the changes.

@ichorid
Copy link
Contributor

ichorid commented Jun 24, 2021

A couple of important notes:

  • First, there is more than a single set of ORM bindings: LedgerZero's ORM bindings are completely independent of MDS-related bindings. So, putting all the ORM bindings into a single dir will create a total mess.
  • Second, the original idea behind the structure we're using now was to eventually support adding modules to Tribler dynamically.

In the end, it boils down to the classic question of "sort by type vs sort by function". Sort by type is the Unix's approach (/bin), while sort by function is the Windows's approach (c:\Program Files). The former better fits tight, cleanly designed systems, conservative systems with a limited scope of functionality. The latter is favoured by dynamic, highly extensible systems.
The Unix approach is about enforcing structure. The Windows approach is about isolating chaos.

Which one fits Tribler better at this point in development, I'm unable to tell 🤷

@drew2a
Copy link
Contributor Author

drew2a commented Jun 24, 2021

@ichorid I've added "ledger zero" and "mds" ORM-bindings to the example above.

@ichorid
Copy link
Contributor

ichorid commented Jun 24, 2021

We had a live discussion with @drew2a , and I am now convinced that this restructuring will do more good for Tribler immediately than it will do harm to our future modularisation goal. 👍

@drew2a drew2a added this to the 7.11.0 July milestone Jun 25, 2021
@ichorid
Copy link
Contributor

ichorid commented Jun 25, 2021

I've got an even more radical idea: let's just refactor everything properly with FastAPI+DependencyInjector
This combo will nicely solve all of our modularisation+testing+documentation+configuration problems. 🎉 🚀 🎉

@drew2a
Copy link
Contributor Author

drew2a commented Sep 14, 2021

The task is no longer relevant (after merging #6206).

@drew2a drew2a closed this as completed Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants