First published serially in a London magazine in 1914, A Portrait of the Artist as a Young Man is set in Dublin in the late 19th century. Dublin is very important to the story because it is tied to Stephen's discontent. He becomes aware of the squalid urban setting and dislikes the dirtiness of the city (which contrasts with the artistic inspiration he finds in the idyllic Blackrock and the seashore).
Dublin's political climate was very tense during this particular time; many Irish people believed that Charles Parnell would win "Home Rule" for their country (i.e. autonomy from England). But Parnell had an affair and plunged the country into political chaos. This resulted in widespread disillusionment and a feeling of hopelessness despite the country's continued desire for independence from the British empire (which was granted, notably, in 1914).
The story's protagonist feels that Dublin is stuck in the past and unable to achieve modernization. He also believes that it remains paralyzed by nostalgia (just like his father). Stephen manages to find beauty in "dear dirty Dublin," as Joyce once termed it, because he has the eye of an artist. But the city's prevailing gloom causes him to follow his calling out of Ireland in order to "forge in the smithy of [his] soul the uncreated conscience of [his] race"—a conscience that, he implies, is not possible to create within the confines of the city.