[Design] How to structure a complex application? #135
matt-grain
announced in
Q&A
Replies: 1 comment 2 replies
-
This is a great question. There's no official best way, but the way you described is basically how our website is structured:
As your app grows, you may also want to move out common components to their own files so they can be reused. This includes page templates (so for example you can include a navbar and footer for each page easily). We will update our site docs to include this info. It seems to scale pretty well and is easy to reason about each page independently. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Let's assume I have a website with separate features, mostly independent (except maybe some user data).
Currently the state is defined at the
app
level so eachpage
defined in theapp
shares the same state.If every section of the application is in a separate
py
file, what is the best code structure to use?Ex:
main.py
importing [1], [2], [3], defining the app, pages and compiling the stuffglobal_state.py
file for the app global statepage_x.py
file per section, in this file the local state (inheriting the global state) and substates and rendering functions, importing [1]Something like that?
How did you structure the pynecone.io website?
Beta Was this translation helpful? Give feedback.
All reactions