The Paris Commune of 1871 was the result of the world's first working class revolution. It survived for only two months but it was the most democratic and liberating government the world had seen up till that point. It offered a glimpse of a model of democracy that goes beyond the limited parliamentary democracy which is the best we can expect under capitalism.
Marx did not pluck a theory of what real democracy would look like from thin air - he learnt it from the concrete example of the Paris Commune. The Civil War in France, a pamphlet based on speeches to the First International, was written by Marx in 1871. It is both an impressive, succinct history of the Paris Commune and a powerful polemic against capitalism.