Git Product home page Git Product logo

ohe's Introduction

ohe — Private messaging on App.net

This is ohe, the code behind App.net's reference private messaging UI called Omega. It's the same code we run in production for omega.app.net. This code is ready for local deployment, deployment on Heroku, or larger scale deployment, if you want. It is an example of a thick Javascript application with some server logic.

It contains:

  • An Angular.js application for the UI
  • An API proxy to allow API calls to be made as session-authenticated calls
  • A consumer of the streaming API

Requirements

  • Node.js 0.8.xx+
  • Redis server

Installation — development

  1. Create a new application on App.net. Note the client_id and client_secret. The redirect URI should be /return on the host you're going to use for ohe, e.g., http://localhost:8666/return.

  2. Create a config.json in the root of your application. Add your client_id/client_secret where prompted, as well as a random secret to protect your sessions. Update your redis URL if necessary. Make sure you don't check in any sensitive data, e.g., client secret or session secret, where it will be exposed publicly.

    This configuration is read via the nconf configuration library. It is possible to specify configuration via the config file, via environment variables or via the command line.

  3. npm install

  4. node app.js

  5. Open your browser to http://localhost:8666/

Optional — deploy to Heroku

If you're deploying to Heroku, you probably want to configure your app with environment variables instead. Try this:

heroku config:set NODE_ENV=production adn__client_id=<client_id> adn__client_secret=<client_secret> adn__scope=messages deploy__heroku=1

deploy__heroku=1 causes the app to use Heroku environment variables for the Redis URL (assumes Redis To Go) and HTTP port.

Note that you might want to set adn__stream_key to a different value for your Heroku config so that your development and Heroku environments use different connections to the App.net streaming API.

Custom domains on Heroku are not currently supported, unless you have a custom SSL certificate. Please use a .herokuapp.com domain so that you can use SSL.

Optional — multiprocess deployment

If you are running more than one process, e.g., a worker and several web nodes, you can elect to pipe stream updates through Redis. You must ensure that all processes run with the deploy:multiprocess option enabled, and exactly one process runs with the deploy:master flag set to a true value.

ohe's People

Contributors

mstorus avatar berg avatar mthurman avatar

Watchers

Jae Hess avatar James Cloos avatar

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.