• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Development Web Development Proposed Update to the Structure of jellyfin-web

     
    • 1 Vote(s) - 5 Average

    Proposed Update to the Structure of jellyfin-web

    thornbill
    Online

    Core Team

    Posts: 177
    Threads: 6
    Joined: 2023 Jun
    Reputation: 8
    Country:United States
    #1
    2024-07-12, 03:04 AM
    Inspired by the "Bulletproof React" project structure, I would like to propose the following modification to our existing project structure:

    The addition of the features directory.

    The features directory will provide us with a more organized file layout as the project continues to grow, allowing us to group code for a common feature under a single directory. Our hooks directory for example is currently growing out of control as we write more new code using Tanstack Query hooks for queries and mutations. Under the features directory structure, these would move to features/{feature_name}/api/{hook_name}.ts for example. Components and types related to a specific feature would also move in a similar fashion. Some possible features could be "libraries", "users", "auth", "search".

    This would be an alternative to the approach of grouping related code under the corresponding route that we had utilized here. I prefer keeping the routes directory clean of any supporting code so that it reflects the url structure of the app. This also enables sharing code for the same feature between routes while keeping it organized separately from global/common code.

    A features directory could be present at the application (apps/dashboard/features) or global level for common features (like auth). Common lower level components and hooks would stay structured as is.

    You can see an example of this structure in practice in my add plugin redesign pull request: https://github.com/jellyfin/jellyfin-web...5773/files
    [Image: thornbill?style=flat&logo=github]
    1
    1
    1hitsong
    Offline

    Moderator

    Posts: 103
    Threads: 11
    Joined: 2023 Jun
    Reputation: 3
    #2
    2024-07-12, 12:52 PM
    I like this idea. I'm all for organization and keeping clean project structures, and reading through the bulletproof readme, this makes a lot of sense. Thumbs-up
    🤘 Enjoy

    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode