Coder Social home page Coder Social logo

almzayyen / dschat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from colohan/dschat

0.0 1.0 0.0 30 KB

AppEngine hosted chat server. Example for the distributed systems class at www.distributedsystemscourse.com

License: MIT License

Python 61.66% HTML 13.95% JavaScript 24.13% CSS 0.25%

dschat's Introduction

dschat

This is the dschat online chat system. Inspired by the zarchive interface to the Zephyr chat system used by CS grad students at Carnegie Mellon.

This is a example program. It is not guaranteed to be complete, robust, or anything else. If you deploy this to AppEngine and get a lot of active users (or one runaway bot), it may cost you money to run this. If you deploy the uwsgi version it is wide open to spammers and abuse. Be careful!

I am far from an expert in Python, and this is the first Javascript program I ever wrote. I'm a C++ guy. Don't use my code as an example of "good practice", as it probably isn't.

This program is intentionally minimalist -- it is a foundation for people to build upon to help them learn distributed systems, as a part of the class at www.distributedsystemscourse.com. So many features are intentionally absent to give students a chance to implement them themselves.

This does not mean that I welcome any and all contributions. Anything which adds features and doesn't detract from the learning goal of this code? Great! Anything which makes the code easier to read, more "standard" Python or Javascript, easier to deploy? Awesome. Send me my first github pull request ever, and I'll figure out what to do with that.

===

AppEngine:

If you change this app and want to test it on your local computer, you need to first set up Firebase (grrr, the Channel API was deprecated). See the instructions here: https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/appengine/standard/firebase/firetactoe

Then to test this program use:

cd dschat/appengine pip install -t lib -r requirements.txt export GOOGLE_APPLICATION_CREDENTIALS=/path/to/firebase_credentials.json dev_appserver.py .

To deploy the new version to AppEngine, use:

gcloud app deploy app.yaml

If you make a change which issues new datastore queries, run the following to cause AppEngine to build new indexes:

gcloud app deploy index.yaml

===

Uwsgi/nginx:

If you change this app and want to test it on your local computer (or a cloud VM), you need to:

  • Install and configure nginx.

  • Install uwsgi.

  • Install redis.

  • You may want to get a SSL certificate and install it (I used letsencrypt).

  • Configure nginx to serve the static content in dschat/*/, and also pass through dynamic requests to the uwsgi socket. My config can be found in sample_configs/nginx_sites.conf.

  • Configure systemd or upstart to automatically start both redis and uwsgi on boot. My config for uwsgi can be found in sample_configs/uwsgi.service, the installer for redis generated one automagically for me.

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.