design – How to manage a single codebase for multiple software products?

Currently, we have a single codebase from which 3 different software products are derived from:

  1. point-of-sale app for retail
  2. point-of-sale app for restaurants
  3. point-of-sale app for hotels

They all share the same codebase but differ in their use-cases as each target group has different requirements, so it is not comparable to a pro and basic edition.

I have read about feature flags to toggle on/off different sets of features for each product and also about modularization, but I wonder if there are better ways to manage this setup. Moreover, are there any patterns or paradigm to support easier management?

Our main concern is to ease A/B Testing. Currently, we must build 2 versions and the tester must test each version. Better would be if the tester would only run a single version and by applying an argument during runtime to enable certain features, so he can easier test what is needed.