Peel and slice the potatoes, then place them in cold water to prevent browning. Remove the cores from the apples, peel them, slice them, and place in cold water to prevent browning.
In a frying pan over medium-high heat, fry the bacon and diced onions for 3-5 minutes until the bacon is cooked and the onions are soft. Crush the allspice grains, juniper berries, peppercorns, and bay leaf together, then place them in a spice bag or cheesecloth.
Drain the potatoes and apples. In a large saucepan, layer the sauerkraut, fried bacon and onions, apples, and potatoes, making sure the top layer is sauerkraut. Tuck the spice sachet between the layers. Pour the beef broth over everything. Cover and simmer on low heat for 60 minutes.