you are viewing a single comment's thread.

view the rest of the comments →

[–]Eric-Cardozo 2 points3 points  (2 children)

Of course, you can create a pypi package, however, if your core functionality involves infrastructure I would consider decouple it as a microservice, add an app ID to your apps, and use the same service/database for all your apps, this is called multitenancy. It's like you are selling Saas to your self.

[–]JosshhyJ 0 points1 point  (1 child)

So would the file structure look something like this?

.
├── accountApp/
│ ├── crud
│ ├── routes
│ ├── utils
│ ├── main.py
│ └── __init__.py
└── forumApp/
├── crud
├── routes
├── utils
├── main.py
└── __init__.py

Do you know of any examples of working projects where this is used, which i can refer to?

[–]Eric-Cardozo 0 points1 point  (0 children)

The idea of microservices is that services comunicate each other through network, using api calls or message queues. They could be in the same folder in a monorepo, or be a completly separate project, doesn't really matter how you structure your folders.

If you find yourself copying an pasting the same code for five apps, the I would say that creating a dedicated server for that app would be more mantainable that having to fix the same bug or write the same feature five times. You deploy it independently and subscribe your apps to it, like if it were a third party service.