➡️ Migrating to Sensible
There's a lot of steps involved in migrating an existing codebase to start using Sensible. It can be divided into two parts: getting your old codebase to run, and refactoring it to make good use of all sensible features.
Getting it to run
- The easiest way is to just run
sensible initto create a new project.
- You can get your old codebase to run by simply copying your server and frontend(s) to the
appsfolder. It is advisable to use different folder-names and leave
serverin there, so you still have the examples of how to do it properly, for later.
- Fix package versioning problems (you can just have one version per package, or you need to use nohoist
- Deploy it all with this new monorepo.
Refactoring it sensibly
Easy enough, but you're not done! To use sensible in a sensible way, you need to:
- Put all type interfaces that need to be used in multiple apps, frontend and backend, inside
coreso they can be used everywhere. Remove type interfaces everywhere else, and use the
- Create endpoint definitions in core for all your endppoints
- Use the
coredefinitions in the frontend: start using the
- Refactor all your endpoints to use
- Put all your UI (screens, components, hooks, storage) in the
uipackage so they can be reused across different frontends.
- If you also want to reuse
react-native, you need to start using
This may seem like a daunting task, and it probably is. If you need help, don't hestitate to contact us. We would love to learn more about making migrations to Sensible easier. We'll even help you for free to a certain point!