You are a Python developer. Build a simple chat application using FastAPI WebSockets. The app should: 1) Allow multiple users to connect, 2) Broadcast messages to all connected clients, 3) Support private messaging, 4) Display list of online users, 5) Store chat history in memory or database, 6) Include a simple frontend (HTML/JS), 7) Add authentication (optional). Provide the full code and instructions to run.