Large-scale quantum information processing and distributed quantum computation require the ability to perform entangling operations on a large number of qubits. We describe a new photonic module which prepares, deterministically, photonic cluster states using an atom in a cavity as an ancilla. Based on this module, we design a network for constructing 2D cluster states and then we extend the architecture to 3D topological cluster states. Advantages of our design include a passive switching mechanism and the possibility of using global control pulses for the atoms in the cavity. The architecture described here is well-suited for integrated photonic circuits on a chip and could be used as a basis of a future quantum optical processor or in a quantum repeater node.