Creating tailored group chats

My project involves creating a private messaging application for university students, and I want to incorporate tailored group chats for each course offered. Ideally, I envision the courses being pre-built, and during the sign-up process, students would be able to select their respective courses. Once they have selected their courses, they should be automatically added to all the course groups they belong to.
any advice?

Pretty easy to do, what are you having trouble with? Need a bit more info on what advice you need.

i need advice on how to structure the database for the courses and how they would select the courses they offer.