Skip to content

[Design] How to structure a complex application? #135

Answered by picklelo
matt-grain asked this question in Q&A
Discussion options

You must be logged in to vote

This is a great question. There's no official best way, but the way you described is basically how our website is structured:

  • A file base_state.py that has global information, and which all the page states will subclass
  • For each page, a file like landing_page.py which has the state for that page (inheriting from the base state), along with the code to render the page.
  • A styles.py file with common styles used throughout the app pages
  • In the main app file, we define the app and add all the pages

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 ea…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@FHU-yezi
Comment options

@picklelo
Comment options

Answer selected by picklelo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants