What is the best system one can make under $5000

I am new to speakers in general and have a couple of decent headphones. What is the best system one can hope to create with a budget of $5000. It is ok to include second-hand components as well. It should allow a turntable and at least one optical input and headphone output.

The listening area is 13ft X 20ft.

Thanks in advance for your advice.

Since you're looking for fairly neutral and uncolored sound, there's a pair of Revel F206 here for $2500 and a Hegel H160 (that has all the connections you're looking for) for $1400 that will likely sound fantastic and leave you with another $1100 for whatever else.  Best of luck. 
KEF LS50 Wireless ~$2500

Technics SL1200GR ~$1700

$800 left for a decent phono preamp

  •  Buy all from same dealer and maybe they'll throw in a good TT cartridge
or ask for typical 10 to 15% discount and put it toward a cart like the Ortofon 2M Bronze 

Such a system would likely embarrass some costing 3x more.

Use whatever cables you can get your hands on in addition to the manufacturer supplied cables. Best Buy RocketFish works perfectly fine. Don't waste money on esoteric cables or power conditioning, at least not at the start. 

How do you plan to use the system? If it’s for a combo music & TV/movie system then I’d lean towards big floorstanders that can deliver deep bass. If it’s for music only and your musical tastes don’t mind lacking a bit of bass and lower volumes, you might be better off with a highend bookshelf speaker. 

For the former, I’d go Goldenear Triton 2s, but there are lots of solid contenders including Kef R900s, PSB Imagine T2s or those Revel F206s. For the latter, Harbeths or DeVore Gibbon 3XLs are on my personal wishlist. Either way I’d spend $2500-3500 on the speakers since they affect system performance more than any other component and I’d try my best to listen to a pair before buying if at all possible. 

I’d then look for a good integrated amp with built-in phono input, DAC, and headphone output for somewhere around $1k...$1500 max if you were closer to the lower end of the price range on speakers. Peachtree nova150 comes to mind and one is available now for $999. The Hegel mentioned by soix would be an awesome choice but is listed as “local pickup only” so include the price of a trip to Minnesota in the budget if you can’t talk the seller into shipping it :). 

I’d definitely include a chrome cast audio as mentioned above...can’t be beat for $35   

Next I’d pick out a turntable somewhere in the $500-$1k range to leave just enough for budget cables, interconnects, and a surge protector (the latter to keep from it going up in smoke more than for any sound quality benefits). If you don’t mind lacking a dust cover I’d go VPI Cliffwood...if you do, Rega Planar 2 or 3 or something from the Pro-Ject lineup that works for the remaining budget. 

All that said, I didn’t build my <$5000 system that way at all. It’s:
KEF LS50s ($1000)
Creek Evo100a w/ Ruby DAC module (~$2500)
Chromecast Audio ($35)
VPI Nomad Turntable ($600 on sale)
Pioneer CD/DVD player I already had ($?)
Furman power conditioner/surge protector ($200) 
Entry-level Audioquest cabling and interconnects (couple hundred dollars tops for all of them)

.... and it sounds fantastic to me. 
Belles Aria Integrated (includes MM phono stage), Nuforce STA200 (on closeout) and Odyssey Khartago amps, Magnepan .7 and Salk SongTower speakers
jl35, I don't think we can say the STA200 is on a closeout price anymore.  I would guess that the unit is still being manufactured and Nuforce has decided that the $499 is the fair market value.