Giter VIP home page Giter VIP logo

msg's Introduction

msg

Travis CI Status Coveralls Code Coverage PyPi

msg is a simple, but powerful service-oriented RESTful messaging library.

msg focuses on the overlapping core features of any messaging system, so you can skip to implementing the cool parts. You can use msg to build live chat/instant messenger, a forum, a Twitter clone, a blog, etc.

msg runs in Python 2 and 3. msg can be configured to use any database supported by SQLAlchemy.

The beauty in this project is that its focus/scope is tiny, the barebones of any messaging system, which we perfect for you.

For the REST API, setup instructions, deployment instructions, and more, please read The Official msg Wiki!

Quick Start

  1. install and launch redis server
  2. pip install msg
  3. gunicorn msg.msg:app --worker-class gevent --bind localhost:5000

Develop

  1. install and launch redis server
  2. Edit msg/config.py or override
  3. pip install -r requirements/develop.txt

If you're using a non-default database:

python -c "import msg.msg; msg.msg.init_db()"

Example

For the demo to work you need to install the Allow-Control-Allow-Origin: * plugin for Firefox, Chrome, whatever.

  1. cd examples
  2. python msgviewer.py
  3. Checkout http://localhost:8080/ and http://localhost:8080/stream

If you're using httpie (sudo apt install httpie) here are some example commands:

  1. Create a user: http POST localhost:5000/user username=kitten password=yarn
  2. Create a message: http POST localhost:5000/message text="i love kittens" --auth kitten:yarn

msg's People

Contributors

kawa-kokosowa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

msg's Issues

Testing expired tokens.

Is the a way to test when a token expires that wouldn't involve having python wait 10 minutes?

update viewer/example

it's out of date

also ideally there'd be three kinds of examples:

  • imageboard type (eventually this'll be staticfuzz.
  • instant messenger type/chat
  • trello ripoff

ratelimiting in system user mode

if staticfuzz is gonna use msg, then staticfuzz will be rate limited, not per-user. meaning everyone will have to share the same rate limits, which is bad.

unittest /stream

Difficulty of unittesting SSE/EventSource, /stream

I'm not sure how to approach testing the event stream. It currently will get caught in the infinite loop of the stream resource. Another hurdle is POST'ing while listening with something like sseclient

ensure consistent ordering for messages returned

when returning messages (a list of messages) be sure they're ordered by time in ascending order by default, otherwise there should be a way to specify ascending_not_decending=True as a json property

should there be a modified timestamp? defaults to createddate. this way we can return the newest including by edit, not just created date alone

Making post without "text" results in KeyError

Command used: http POST localhost:5000/message message="i love kittens" --auth kitten:yarn

Expected behavior:
Return error with message "text field required"

Actual Behavior:

  File "/Users/seabreeze/Projects/msgboard/msgboard/msg.py", line 201, in post
    text = json_data['text']
KeyError: 'text'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.