A chat application built with Flask and PostgreSQL, featuring categories, threads, and messages. Categories contain discussion threads, which consist of messages. Users must be logged in to view and participate in discussions. The app supports both regular users and administrators, with admins having additional privileges like managing categories and creating private categories.
Visitors are able to register either as an admin or regular user, and log in with the username and password that they created. Possible error messages: username already in use, passwords don't match, incorrect username or password.
After logging in, there is a list of categories that the user has access to, including the amount of threads and messages, as well as the time of last message for each category. Clicking on the category name opens up the category page (not fully done yet). Admins can also see a button for creating a new category.
All users can see their username and role, and log out using the menu at the top right of the page.
Admin users can create a new public or private category.
If they choose to create a private category, they are able to select the users that they want to give access to.
The app was originally deployed to Fly.io, but due to very unclear pricing, I have taken it down. This means that the app will have to be tested locally.
Clone the repository and navigate to the root directory
Create a .env
file with the following variables, changing the values to your own
DATABASE_URL=postgresql:///yourlocaldatabaseaddress
SECRET_KEY=supersecret
python3 -m venv venv
source venv/bin/activate
pip install -r ./requirements.txt
psql < schema.sql
flask run