Furniture configuration app

I need to develop a Build-Your-Own cabinet configuration application for a cabinet company. I need it to be a drag n drop application. there is a grid system involved, where you can fit 3 large cabs in a grid, or 6 small ones, and so fourth…so there is logic involved. Anyone ever build something similar? a drag n drop application with logic? Any help or steer in the right direction is greatly appreciated…thanks…