Breast cancer is the most prevalent malignancy in women and exhibits significant heterogeneity. The tumor microenvironment (TME) plays a critical role in tumorigenesis, progression, and response to therapy. However, its impact on the prognosis and immunotherapy responses is incompletely understood. Using public databases, we conducted a comprehensive investigation of transcriptome and single-cell sequencing data. After performing immune infiltration analysis, we conducted consensus clustering, weighted gene co-expression network analysis (WGCNA), Cox regression, and least absolute shrinkage and selection operator (Lasso) regression to identify independent prognostic genes in breast cancer. Subsequently, we developed a prognostic model for patients with breast cancer. Tumor Immune Dysfunction and Exclusion (TIDE) values were used to assess patient’s responsiveness to breast cancer. Based on single-cell RNA-sequencing data, we identified various cell types through cluster analysis and investigated the expression of prognostic model genes in each cell type. The drug sensitivity of targeted therapeutic agents for breast cancer treatment was analyzed in different cell types. We identified 12 independent prognostic genes associated with breast cancer and used these genes to construct a prognostic model. The prognostic model accurately discriminated between patients classified as high- and low-risk, providing precise prognostic predictions for individual patients. Additionally, our model exhibited a robust capacity to predict the immunotherapeutic response in breast cancer patients. Our investigation revealed a notable association between the proportion of endothelial cells (ECs) and patient prognosis in breast cancer. A prognostic model for breast cancer was formulated that showed close associations between prognosis and response to immunotherapy. For patients predicted by our model to not respond effectively to immunotherapeutic agents, it may be considered to combine immunotherapeutic agents with targeted therapeutic agents identified through our drug sensitivity analysis, which could potentially enhance treatment efficacy.