This is a chatroom website that enables users to enter chatrooms with other users and send messages to each other in real time.
The website was primarily made using Python and more specifically, Django as my backend framework of choice. Django was chosen for several reasons:
- Django has a more structured and opinionated approach to web development compared to other similar frameworks like Flask. This can make it easier to build maintainable and scalable applications, which is important for adding functionality.
- Even though Django is quite monolithic, Django follows a "batteries included" philosophy, which means it comes with a lot of functionality out of the box.
- Django has a robust set of features and tools for building web applications, including an ORM (Object-Relational Mapper) for interacting with databases, a template engine for building views, and a built-in user authentication system. These features helped me build a full-featured chat application more quickly and easily.
The user and messages were stored in an SQLite database, with the front end of the program being written in HTML and the jQuery framework. The jQuery framework was crucial in delivering asynchronous JavaScript to display messages in the chat rooms.
- Make sure to have the following installed: Python and Django
- Next, download the source code or clone the repository.
- First, make sure that the database is set up and fresh with the following command:
python manage.py migrate chatroom zero
- Next, to start the server, make sure you are in the root directory, and then in a terminal, run the following command:
python manage.py runserver
- The server should start up and you can open the website by typing
http://127.0.0.1:8000/
in any modern browser.
The following commands will be useful:
python manage.py runserver
python manage.py migrate chatroom zero
- Enable proper account management: account sign-up and sign-out functionality
- Allow all users to be able to see past open chat-rooms
- Change the CSS to display all the messages on one side and display all the online users in the chatroom and their usernames on another side