In this work, a straightforward and scalable method was used to generate nitrogen-rich porous carbon (NRPC), which was then incorporated with a graphitic carbon nitride and magnetite (g-C3N4/Fe3O4) nanocomposite, fabricated with Fe3O4 nanoparticles as an eco-friendly and economically viable component. The fabricated NRPC/g-C3N4/Fe3O4 nanocomposite was applied as an electrode in supercapacitor applications. The synthesized NRPC/g-C3N4/Fe3O4 nanocomposite, NRPC, g-C3N4, and Fe3O4 were characterized by analytical and morphological analyses. The spherically shaped Fe3O4 nanoparticles were analyzed by field-emission scanning electron microscopy (FE-SEM) and high-resolution transmission electron microscopy (HR-TEM). The specific surface area of NRPC/g-C3N4/Fe3O4 was determined to be 479 m2 g-1. All the crosslinked composites showed exceptional electrochemical performance and exhibited a pseudo-capacitance behaviour. In comparison to the Fe3O4 and g-C3N4/Fe3O4 electrodes, the NRPC/g-C3N4/Fe3O4 electrode showed a lower charge-transfer resistance and higher capacitance. The prepared NRPC/g-C3N4/Fe3O4 electrode exhibited the highest specific capacitance of 385 F g-1 at 1 A g-1 compared to Fe3O4 (112 F g-1) and g-C3N4/Fe3O4 (150 F g-1). Furthermore, the cycling efficiency of NRPC/g-C3N4/Fe3O4 remained at 94.3% even after 2000 cycles. The introduction of NRPC to g-C3N4/Fe3O4 improved its suitability for application in high-performance supercapacitors.