Repository navigation
Closed
Labels
breakingIndicates a major update or change which breaks compatibilitydocumentationenhancementThis is an suggested enhancement or new featurequestionThis is a questionrefactor
Milestone
Description
Please verify that this feature request has NOT been suggested before.
- I checked and didn't find a similar feature request
Problem statement
We currently have frontend and backend structured differently and the name InvenTree is used multiple times. If you clone InvenTree any you set up bare metal manually you end up with this path: /home/inventree/InvenTree/InvenTree/InvenTree/version.py.
Suggested solution
Reshuffle the code organisation, rename the InvenTree Django app and move everything possible into clearly documented (in CONTRIBUTING) folders.
My suggested structure would be something like this:
InvenTree/
├─ .github/
│ ├─ actions/
│ ├─ workflows/
│ ├─ scripts/
├─ .vscode/
├─ src/
│ ├─ backend/
│ │ ├─ requirements.txt
│ │ ├─ src/
│ │ │ ├─ core/
│ │ │ │ ├─ version.py
│ │ │ ├─ common/
│ │ │ ├─ order/
│ │ │ ├─ part/
│ │ ├─ manage.py
│ ├─ frontend/
│ │ ├─ src/
│ │ │ ├─ main.tsx
│ │ ├─ package.json
├─ contrib/
│ ├─ deploy/
│ ├─ docker/
│ │ ├─ Dockerfile
│ │ ├─ docker-compose.yml
├─ docs/
├─ assets/
│ ├─ images/
│ │ ├─ LOGO
├─ tasks.py
├─ README.md
Describe alternatives you've considered
Moving some of the deploy stuff out of the way and adding docs alone would also be a bg win IMO.
Examples of other systems
No response
Do you want to develop this?
- I want to develop this.
Metadata
Metadata
Assignees
Labels
breakingIndicates a major update or change which breaks compatibilitydocumentationenhancementThis is an suggested enhancement or new featurequestionThis is a questionrefactor
Activity
wolflu05 commentedon Sep 20, 2023
This is a good idea to simplify things, but we need to make sure that the plugin system still works with the current import paths.
matmair commentedon Sep 20, 2023
All documented
pluginspaths are safe, they were structured that way. Imports fromInvenTreewill need a rewrite, that is kind of the point. Monkey patching that would run into a lot of problems because there are multiple namespaces/modules named InvenTree.wolflu05 commentedon Sep 20, 2023
Yeah, if its only the
InvenTreemodule and all other models can be imported from the same path, I think its ok if this big change will be mentioned as breaking, that way we can rewrite our plugins. I bet you also import stuff in your plugins other than from thepluginpackage, e.g. models, ...SchrodingersGat commentedon Sep 20, 2023
This has been bothering me for ages, I support such a change. It would obviously need a lot of testing :)
matmair commentedon Sep 20, 2023
I can make a PR that shows the effects. I have already tested this for all the docker stuff and know that keeps working. Other things should be straight forward - but breaking to 1) forks and 2) plugins. I think a fat warning in the release notes should be enough for 2) and think 1) can be neglected as I know of none that are signifincant.
matmair commentedon Sep 20, 2023
Here is the docker test: https://github.com/matmair/InvenTree/tree/docker-cleanup
matmair commentedon Sep 21, 2023
My suggestion would be a multi-PR change:
Does this sound good @inventree/triage ?
[FR] Restructure code
[FR] Restructure code
[FR] Restructure code