项目作者: gbhgit

项目描述 :
This application allow several users to talk in a chatroom and also to get stock quotes from an API using a specific command.
高级语言: Python
项目地址: git://github.com/gbhgit/browser-based-chat.git
创建时间: 2021-05-29T22:06:56Z
项目社区:https://github.com/gbhgit/browser-based-chat

开源协议:MIT License

下载


Python-Django chat application

This application allow several users to talk in a chatroom and also to get stock quotes
from an API using a specific command.

Recomendations

  • Redis >= 5
  • Python 3
  • Tested in Linux

Installation and Deploy using Docker

  • 1: Check if redis is running, case is running stop your current redis server using the command below, just to avoid conflicts:

    1. sudo /etc/init.d/redis-server stop
  • 2: Using the terminal enter in repository chat folder and run the command to build docker:

    1. sudo docker-compose build
  • 3: Using the terminal enter in repository chat folder and run the command to start server:

    1. sudo docker-compose up -d
  • 4: Check docker containers starts successfully:

    1. sudo docker ps
  • 5: Then check the web app in http://127.0.0.1:8000/
  • 6: Basic registred user username: admin and password: 123

Run tests with Docker

  • 1: After creating the container just get container id with command:

    1. sudo docker ps
  • 2: Enter inside the container by id:

    1. sudo docker exec -it [container-id] bash
  • 3: Run the command inside the container:

    1. python3 manage.py test

Considerations

Completed all Mandatory Features

:heavy_check_mark: Allow registered users to log in and talk with other users in a chatroom. \
:heavy_check_mark: Allow users to post messages as commands into the chatroom with the following format
/stock=stock_code \
:heavy_check_mark: Create a decoupled bot that will call an API using the stock_code as a parameter
(https://stooq.com/q/l/?s=aapl.us&f=sd2t2ohlcv&h&e=csv, here aapl.us is the
stock_code) \
:heavy_check_mark: The bot should parse the received CSV file and then it should send a message back into
the chatroom using a message broker like RabbitMQ. The message will be a stock quote
using the following format: “APPL.US quote is $93.42 per share”. The post owner will be
the bot. \
:heavy_check_mark: Have the chat messages ordered by their timestamps and show only the last 50
messages. \
:heavy_check_mark: Unit test the functionality you prefer. \

Completed all Bonus (Optional) Features

:heavy_check_mark: Have more than one chatroom. \
:heavy_check_mark: Handle messages that are not understood or any exceptions raised within the bot. \

My Personal Bonus Features