  Two-dimensional polyaniline with C$_3$N stoichiometry, is a newly fabricated
layered material that has been expected to possess fascinating electronic,
thermal, mechanical and chemical properties. The nature of its counterpart
nano-ribbons/structures offering even more tunability in property because of
the unique quantum confinement and edge effect, however, has not been revealed
sufficiently. Here, using the first-principles calculation based on density
functional theory and nonequilibrium Green's function technique, we first
perform a study on the electron band structure of armchair C$_3$N nanoribbons
(AC$_3$NNRs) without and with H-passivation. The calculated results show that
the pristine AC$_3$NNRs are metal, while the H-passivated ones are either
direct or indirect band gap semiconductors depending on the detailed edge
atomic configurations. Then we propose a lateral planar homogenous junction
with an interface between the pristine and H-passivated AC$_3$NNRs, in which
forms a Schottky-like barrier. Interestingly, our further transport calculation
demonstrates that this AC$_3$NNRs-based heterojunction exhibits a good
rectification behavior. In specification, the average rectification ratio (RR)
can reach up to $10^3$ in the bias regime from 0.2 to 0.4 V. Particularly,
extending the length of semiconductor part in the heterojunction leads to the
decrease of the current through the junction, but the RR can be enlarged
obviously. The average RR increases to the order of $10^4$ in the bias from
0.25 to 0.40 V, with the boosted maximum up to $10^5$ at 0.35 V. The findings
of this work may be serviceable for the design of functional nanodevices based
on AC$_3$NNRs in the future.
