-
Notifications
You must be signed in to change notification settings - Fork 450
The Refactor #735
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
base: main
Are you sure you want to change the base?
The Refactor #735
Conversation
b2553e7 to
4a3123e
Compare
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: KIRIN.CHU 朱祐麟 <KIRIN.CHU@deltaww.com> Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Use User ID instead of Username to judge isLogin. Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Fix hyperledger-cello#734. Signed-off-by: dodo920306 <dodo920306@gmail.com>
The update/delete organizations feature isn't ready yet, so they're disabled in this commit but will be added back in the future. Signed-off-by: dodo920306 <dodo920306@gmail.com>
Agents "may" be deleted in the future. Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
"Network" may be deleted in the future, so here the related pages are disabled. Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
They will be opened once they're ready. Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
4a3123e to
583629c
Compare
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
They will be added back once they're ready for the new APIs Signed-off-by: dodo920306 <dodo920306@gmail.com>
PhilosophyOne key principle behind this PR is that unused code should be removed from the codebase. If a piece of code becomes relevant again in the future, it can always be recovered from Git history. That’s precisely what version control is for — preserving past implementations without cluttering the present codebase. API EngineThis is where most of the refactoring takes place, so let’s start here. "Agents Are Actually Redundant"This may sound controversial at first, but I genuinely believe that once we decided to adopt Docker Swarm (which we must, given blockchain's network accessibility requirements), the concept of "agents" in the Hyperledger Cello architecture became unnecessary. The Hyperledger Fabric binaries we rely on are already well-equipped to operate nodes (peers and orderers) remotely — for example, using the familiar This leads to a simple conclusion: since both the infrastructure layer (Docker/Kubernetes) and the application layer (Fabric) already provide remote control capabilities, there's no need to implement another redundant remote-control layer ourselves. We can directly leverage the built-in functionality of these tools. As a result, the StructureAnother major improvement is the API Engine structure. Views-Serializers-Services-ModelsIf a module needs some logic implementations, the module should be divided into 4 files (at least).
Previous, most logic was tightly packed inside Code StyleAs mentioned in the Philosophy section, all legacy code unrelated to current functionality has been removed. Additionally, redundant or incorrect implementations have been cleaned up. Here are a few examples:
|
Delivery
Side Effect
|
All dockerfiles should be directly placed inside with their codes. By this way, it reduces the effort to pay attention to connect them with their true codebase and context. Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Since the login page doesn't include the `GlobalHeader`, the icon of the language selection doesn't include the padding like pages after login. Signed-off-by: dodo920306 <dodo920306@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com>
Let's face it: the current state of this project’s code is not so good.
Contributions over time have lacked consistency, leading to duplicated implementations and a fragmented structure that makes maintenance and development difficult.
The combination of Python, Django, and object-oriented design has introduced unnecessary complexity, and without long-term technical stewardship, the project has become hard to extend.
Another pressing issue is the number of long-standing bugs. For a project that has been in existence for over six years, there remain issues that ideally should have been addressed very early on. Many of these are not superficial problems that tools or automated testing could easily detect, but deeper logical flaws that only become evident when the affected code paths are used.
Additionally, it seems that the project has not fully embraced the design principles of Django REST Framework (DRF). For example, serializers are often used only for traffic handling, while much of the core business logic resides in views.py, which goes against DRF’s intended design practices.
To summary, a refactor is inevitable, and to make sure I’m not just another person who criticizes without acting, I’ll do it myself.