The Blue Castle by L.M. Montgomery - is a 1926 novel by Canadian author Lucy Maud Montgomery, best known for her novel Anne of Green Gables (1908).
Valancy is, at twenty-nine, the old maid of the Stirling clan. Her entire life has been spent with her nagging mother, aunt, and gossipy extended family: Victorian and middle class, they actively discourage happiness and treat Valancy like a child, constantly comparing her with her beautiful cousin, Olive, putting her down, and calling her by the baby name "Doss." Her only respites come from daydreaming of her "Blue Castle," and reading the nature books of John Foster.
Then Valancy is diagnosed with a terminal heart ailment, a fact she keeps secret. At a stroke it frees her from fear of the future and awe of her oppressive family. She has always judged them objectively and secretly laughed at their foibles: but now, by doing what she pleases rather than what is 'expected' of her, and saying aloud what she thinks of them, she causes the Stirlings to conclude that she has suddenly gone 'dippy.'
Then Valancy scandalizes the clan by moving out of her mother's house and taking a position as housekeeper for childhood friend Cissy Gay and her father, master carpenter and notorious town drunk Roaring Abel. Cissy is dying of consumption, but is socially ostracized for having had a child out of wedlock. Cissy and Valancy share a room and renew their friendship. Valancy enjoys earning a salary and spending her money in ways her family would not approve of - such as purchasing a brightly-coloured, low-necked dress. But her real satisfaction comes from doing something worthwhile, and doing it well. She also meets and spends time with Barney Snaith, who is a good friend of both Abel and Cissy, but whom town gossips are convinced is a criminal in hiding and/or the father of Cissy's illegitimate, now-deceased child.
Towards the end Cissy confides in Valancy, about the man she fell in love with but refused to marry because he no longer loved her. Her baby compensated for her heartache, but when the infant died she was devastated. Cissy passes away quietly and Valancy makes all the funeral arrangements, setting the house in order for Abel before leaving.