A digester with separate stages for hydrolysis and methanogenesis is disclosed. The digester includes a leachate bay reactor, which may be configured as modular, multi-bay units. Waste material is added to the leachate bay reactor. A leachate storage tank is fluidically connected to the leachate bay reactor, which facilitates hydrolysis. Leachate from the leachate storage tank is recirculated through the leachate bay reactor. A high rate methanogenic reactor is fluidically connected to the leachate storage tank to cycle the leachate in a fixed film environment for biogas production from solubilized organic matter. The reactor may be operated in an anaerobic digestion mode, or a dual aerobic-anaerobic digestion mode. The reactor may also include a struvite system having a crystallizer unit and a separation unit to reduce ammonium and phosphate accumulation during operation.