Were there any centralized projects dedicated to collecting literary or scientific works?
Almost every dynasty in China from the Jin Dynasty onwards had a 'palace library' dedicated to the records of the imperial court. Those weren't really true libraries, but rather, served multi-functional roles as both a secretariat as well as a library of sorts.
The oldest surviving 'true' library in China from ancient or dynastic times would be the Tian Yi Ge (天一阁), literally translating into the Pavilion of One Sky, or One Sky Pavilion. Located in the city of Ningbo, in Zhejiang Province, the Tian Yi Ge has survived through some of the most tumultuous times in Ancient China up until the present day. It is probably the closest thing in China if you were to compare it to the Library of Alexandria.
The interesting thing about the Tian Yi Ge is that it was, by all accounts, founded as a private library, not an imperial/government one. It was first founded in 1561 by Fan Qin, a former government official, after he resigned from his post as a protest against the corruption of the Grand Secretary, Yan Song. The Tian Yi Ge may have been Fan Qin's attempt to preserve the sanctity of the scholarly arts, as many imperial scholars/officials in his lifetime were able to obtain their positions not out of academic merit, but due to bribery. Even after Yan Song's fall, the Tian Yi Ge continued to flourish as a private library.
The Tian Yi Ge survived long after Fan Qin passed, and eventually came to be acknowledged as the greatest library in the Ming Dynasty, boasting a collection of over 70,000 unique texts. The Tian Yi Ge even survived the fall of the Ming Dynasty. After the Ming fell and the Manchurians invaded and conquered China, thereby forming the Qing Dynasty, the library lived on. The Tian Yi Ge was later visited by the Qing Dynasty's Qianlong Emperor, who so admired the Tian Yi Ge that he not only left it alone as a private institution rather than assert imperial authority over it; he also gave it some measure of security and legitimacy, and furthermore used it as a template for his own library projects. Several imperial libraries were built in the Tian Yi Ge's likeness, including the Wen Yuan Ge in the Forbidden City in Beijing.
The fall of the Qing Dynasty did affect the Tian Yi Ge quite badly. Particularly, in the aftermath of the Opium Wars, British forces ransacked the Tian Yi Ge and looted much of the great collection there. Over the years, the Tian Yi Ge suffered, with local theft stripping away more of its collection, as China underwent severe political upheaval leading to the fall of the Qing Dynasty in 1912, the chaotic Warlord Era, the Sino-Japanese conflicts including WW2, and the Chinese Civil War.
After the Communist Party prevailed in the Civil War, and the People's Republic of China was established, the PRC government made attempts to restore the Tian Yi Ge to its former glory. It was made a National Heritage Site, and private donations and government re-acquisition attempts have resulted in the restoration of 30,000 of the ancient texts in the Tian Yi Ge. Sadly, that is still less than 50% of the original collection; much of it is probably still in the hands of private collectors, western museums/galleries, or simply destroyed/lost.
Today, you can visit the Tian Yi Ge in the middle of Ningbo. It still stands, and although much of its original collection of texts is not available to the public, it is still quite an austere and serene place to visit.
Sources:
John Makeham (2008). China: The World's Oldest Living Civilization Revealed. Thames & Hudson.
Yi, Y. U. A. N. (2002). Royal Accreditation of a Private Library: the Unique Relation between Emperor Qianlong and Tianyi Ge [J]. Tianjin Library Journal, 4, 017.