Single-molecule electronics can provide the ultimate miniaturization of future generation integrated circuits. We carried out a theoretical analysis of various molecular devices. Our atomistic study allowed us to explain the observed transport behavior and to design novel types of single-molecule diodes and transistors. We also proposed a novel circuit modeling methodology that leads to a fast assessment of the response of single-molecule devices and to the design of complex molecular circuits.