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 dashboard with 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. Admins can also see a button for creating a new category.
A delete-button will appear by hovering over the category tile (admin feature).
All users can see their username and role, and log out using the menu at the top right of the page.
All users can use the search bar to search for specific messages that they have access to.
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.
Category pages display all threads within a category, with edit and delete options available for threads created by the logged-in user. In the main view, users can see all messages in the selected thread, along with a kebab menu for editing or deleting their own messages. An 'Edited' tag will appear on threads and messages that have been modified.
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