ObjectiveDanzhixiaoyao pills (DXP) is a traditional Chinese medicine formula that has been effectively used in clinical practice to treat depression and metabolic associated fatty liver disease (MAFLD), but its therapeutic mechanism is not yet clear. The purpose of this study is to explore the possible mechanisms of DXP in treating depression and MAFLD using network pharmacology and molecular docking techniques based on existing literature reports. MethodsBy combining TCMSP, Swiss ADME, Swiss TargetPrediction, and UniProt databases, the active ingredients and potential targets of DXP were screened and obtained. By searching for relevant disease targets through Gene Cards, OMIM, and TTD databases, intersection targets between drugs and diseases were obtained. The network of "Disease - Potential targets - Active ingredients - Traditional Chinese medicine - Prescriptions" was constructed using Cytoscape 3.9.1 software, and the PPI network was constructed using STRING 12.0 database. The core targets were obtained through topology analysis. GO function enrichment and KEGG pathway enrichment analysis were conducted based on DAVID. The above results were validated by molecular docking using PyMol 2.5 and AutoDock Tool 1.5.7 software, and their possible therapeutic mechanisms were discussed. ResultsNetwork pharmacology analysis obtained 130 main active ingredients of drugs, 173 intersection targets between drugs and diseases, and 37 core targets. Enrichment analysis obtained 1390 GO functional enrichment results, of which 922 were related to biological process, 107 were related to cellular component, 174 were related to molecular function, and obtained 180 KEGG pathways. Molecular docking has confirmed the good binding ability between relevant components and targets, and the literature discussion has preliminarily verified the above results. ConclusionDXP can act on targets such as TNF, AKT1, ALB, IL1B, TP53 through active ingredients such as kaempferol, quercetin, naringenin, isorhamnetin, glyuranolide, etc, and by regulating signaling pathways such as pathways in cancer, MAPK signaling pathway, lipid and atherosclerosis, to exert its effect of "homotherapy for heteropathy" on depression and MAFLD. In addition, glyuranolide showed the strongest affinity with TNF (−7.88 kcal/mol), suggesting that it may play a key role in the treatment process. The research results provide a theoretical basis for elucidating the scientific connotation and mechanism of action of traditional Chinese medicine compound DXP, and provide new directions for its clinical application.