In recent years, N- and O-heterocyclic compounds have received considerable attention due to their wide applications in various fields, especially in medicine and industry. Considering the importance of this category of organic compounds, in this project, the high-yield and one-pot synthesis of N- and O-containing heterocycles using 2-aminoprop-1-en-1, 1, 3-tricarbonitrile was investigated. In addition, through computational studies, the preparation mechanism of a group of synthesized heterocycles was evaluated using the DFT method.