After the Civil War America entered a new phase called the Reconstruction Period. During this time many "black towns" were formed by former slaves and freedmen. I haven't not done and exhaustive study on these towns but so far, I've found that many had a similar history as that of Nicodemus.
Nicodemus, Kansas was founded in 1877 and by 1886 it was quite prosperous. It became a modern town with free enterprise, drugstore, bank, schoolhouse, churches and newspapers. However, the railroad passed them by even after the town leaders tried to entice railroad owners to put a line to their town. The railroad by-passed the town and the population continued to dwindle. Unlike most of the Reconstruction towns Nicodemus still has a few hundred people living there today.
There are good and bad accounts during this time period and it's extremely interesting to read about. Check out the library of Congress and their "African American Odyssey" section on the Reconstruction Period for more information.