Fascinating properties of ionic liquids such as their higher ionic conductivity, lower vapor pressure, high thermal and electrochemical stability, make them promising candidates as electrolytes for novel energy storage devices. Interaction of ionic liquids (ILs) as electrolytes with electrode is crucial for optimizing the efficiency of energy storage devices. Herein, we report the interaction mechanism of ionic liquids 1-3 dimethylimidazolium halide (1,3-DMIX) on porous covalent triazine frameworks (CTF-0) and non-porous carbon nitride (C4N) electrode materials. Molecular electrostatic potential (MEP) analysis is performed for the prediction of interacting sites on studied electrolytes and electrode materials. Significant changes in geometric and electronic parameters are observed upon interaction of ionic liquid electrolytes with C4N and CTF-0. The nature of interaction between ionic liquids and electrode surfaces is evaluated through Quantum theory of atoms in molecules (QTAIM) and non-covalent index (NCI) analyses which reveal that there exist only the non-covalent interactions (van der Waals) between them. Frontier molecular orbitals (FMO) analysis shows a significant decrease in energy gap upon interaction of ILs with CTF-0, which results in increase in electrical conductivity. Overall, porous CTF-0 electrode material displays greater interaction with the considered ILs as compared to non-porous C4N electrode material. This study will provide a way for experimentalist to explore ionic liquids and carbon nitride or covalent triazine framework as electrolyte–electrode systems which can be used further in energy storage devices like fuel cells, solar cells, ion batteries, and supercapacitors.