insanolanbiri / chat-by-eren-web

daha mükemmel bir chat odası

Home Page:https://insanolanbiri.pythonanywhere.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chat by Eren: web edition

daha mükemmel bir chat odası

deploy pythonanywhere web app

Requirements:

Python 3 and pip

Setup:

  1. clone this repository using git clone https://github.com/insanolanbiri/chat-by-eren-web.git
  2. cd to the clone: cd chat-by-eren-web
  3. setup a python virtual environment with: "python -m venv ."
    • Or "py -3 -m venv ." or "python3 -m venv ." depending on your OS and if you have multiple python versions installed. The key is that python 3 is used.
  4. Run ".\Scripts\activate" (on Windows) or "source ./bin/activate" (on Linux)
    • The shell prompt should change to show the name of the activated environment
  5. Install dependencies with: "pip install -r requirements.txt"
  6. This gives you a virtual environment to use for this chat app. You can deactivate the environment by running "source deactivate" (on Windows) or "deactivate" (on Linux)

Running:

  1. Initialize the database by setting the FLASK_APP environment variable to chat.py (e.g. "export FLASK_APP=chat.py") and running "flask initdb"
  2. Run with "flask run"
  3. Navigate to 127.0.0.1:5000 (the default ip for running flask apps) in your browser

Specifications:

  1. When visiting the page for the first time, users should be given the chance to create an account or login
  2. Once successfully logged in, the user should be given a list of possible chat rooms to join, or a message stating that none currently exist. The user should also have the option to create a new chat room.
  3. Once in a chat room, the user should be shown the history of messages for that chat room, as well as be kept up to date as messages are sent to the chat room. The user should also have the option to post a new message to the chat room. The user should further be given a way to leave the chat room.
    • Users can be in only one chat room at a time.
    • You must use AJAJ and JSON to update the list of messages posted to the chat room, and to post new messages to the chat room.
    • All AJAJ chat updates should send only new messages to the user. The user should not receive the full list of chat messages with every AJAJ update as this could grow quite large over time.
    • You must be sure that your application does not display "phantom" messages to the user.
      • I.e., All users in the same chat room should see the same messages in the same order and new messages should always appear at the end of the chat log, never in the middle of the chat log.
    • You should take a polling approach to ensure that new messages are always available to the user. Your application should have a 1 second time between polls.
  4. Once a user leaves the chat room, they should again be shown a list of potential chat rooms to join (or a message if none exist).
    • The user should also have the option to delete any chat rooms that they created.
      • Any users still in a room when it is deleted should be shown a message informing them that the room was deleted and be again presented with the list of available chat rooms (or a message if none exist).
  5. The user should always (on every page) be presented with a way to log out while they are logged in.
  6. All data should be stored in an SQLite database named "chat.db" using SQLAlchemy's ORM and the Flask-SQLAlchemy extension.

Additional Notes:

About

daha mükemmel bir chat odası

https://insanolanbiri.pythonanywhere.com

License:GNU General Public License v2.0


Languages

Language:CSS 53.0%Language:Python 17.0%Language:HTML 15.2%Language:JavaScript 14.7%