question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

simplify Internal Module Architecture

See original GitHub issue

Progress overview, find background info below

Once all released


Today we have this for new Hoodie

hoodie/
β”œβ”€β”€ hoodie-client
β”‚Β Β  β”œβ”€β”€ hoodie-client-account
β”‚Β Β  β”œβ”€β”€ hoodie-client-connection-status
β”‚Β Β  β”œβ”€β”€ hoodie-client-log
β”‚Β Β  └── hoodie-client-store
└── hoodie-server
    β”œβ”€β”€ hoodie-server-account
    └── hoodie-server-store

Additionally there are these two repositories:

We use these to test client & server together and have a simple generic web app UIs.

The problems with this architecture are

  • the standalone repos are overhead and confusing
  • it’s pretty hard to anderstand how e.g. hoodie-client-account interacts with hoodie-server-account. Like where are the two coming together, exactly
  • It sounds / feels unnaturl. hoodie-client-account, when talking in natural language is the β€œHoodie Account Client”, not β€œHoodie Client Account”

What we suggest instead is this:

hoodie
β”œβ”€β”€ @hoodie/account
β”‚   β”œβ”€β”€ @hoodie/account-client
β”‚   └── @hoodie/account-server
β”œβ”€β”€ @hoodie/store
β”‚   β”œβ”€β”€ @hoodie/store-client
β”‚   └── @hoodie/store-server
β”œβ”€β”€ @hoodie/connection-status
└── @hoodie/log

This architecture combines all logic for the different places that Hoodie touches into one place. Right now that is server & client logic, but in future that will be an admin UI and a generic app UI. This will make the β€œstandalone” repos obsolete too, the role of hoodie-standalone-account is now covered by @hoodie/account

All these core modules follow the same folder structure. All folders are optional.

@hoodie/<module-name>
β”œβ”€β”€ README.md
β”œβ”€β”€ package.json
β”œβ”€β”€ client
β”‚   └── index.js
β”œβ”€β”€ server
β”‚   └── index.js
β”œβ”€β”€ public
β”‚Β Β  └── index.html
└── admin
    └── index.html
  • client/index.js, exports a Hoodie client plugin, it will be added dynamically to the /hoodie/client.js bundle
  • server/index.js, exports a hapi plugin with server logic
  • public/index.html and all other assets in public/ will be served at /hoodie/<module-name>/. So for example @hoodie/account could come with it’s own generic account UI to sign in / sign out / reset password etc. That way when I build a Hoodie app, I have an account UI out of the box for free.
  • admin/index.html will be added to the Hoodie Admin Dashboard – how ever that will work πŸ˜ƒ We can ignore this part for now and get back to it later.

So this will then work exactly the same with Hoodie Plugins, too. Only that they will not be scoped with @hoodie, but probably have a package name prefix like hoodie-plugin-<name-here>


I thought a lot about this in the past weeks and months, and finally I feel like we figured it all out, it all make sense

Mind: blown

Let us know what you think πŸ˜ƒ

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
gr2mcommented, Mar 24, 2016

here’s the full code for example/index.js as I got it, the diff might be a bit hard to read: https://gist.github.com/b3d53107b9fddb0a8d55

0reactions
gr2mcommented, Apr 5, 2016

I guess we are done πŸ‘ πŸŽ‰ chapeau Finn πŸ˜ƒ

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Simplification Principle - Deloitte
Taking an inside-out perspective, simplifying internal processes and structures will have positive impacts on the entire value creation capability of.
Read more >
A Cleaner way to Modular Architecture in Android - Medium
Simply put, in a modular architecture the app is divided into multiple gradle modules instead of one huge β€œapp” monolith.
Read more >
SUMMARY's modular system offers a simplifying solution to ...
SUMMARY presents a concrete modular system that answers efficiently to the need for work simplification and building process acceleration.
Read more >
Common modularization patterns - Android Developers
This page gives an overview of some general rules and common patterns that you can employ when developing multi module Android apps.
Read more >
What is a Modular Design? Everything You Want to Know in 8 ...
A modular design is an approach for product designing which is used to produce a complete product by integrating or combining smaller parts...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found