Create database sql for game session

I already create a website (html,css and javascript) for a game board. It’s like a chess game. I put it on gitlab and I generate a page with an URL.

Now I wonder if it’s possible to create a database (i saw postegresql package already exist in gitlab) for users and host it on gitlab. Then players would play online together in real time (like for exemple).

If it’s possible how can I create this ? My database just will has users name, password and a reference to current game if there is one.

Thanks !