Git Product home page Git Product logo

soul's Introduction

Soul

This is the umbrella app for Soul. SoulWeb is a web server, and SoulGut talks to various APIs.

Configuration

You'll need a postgres database as described in apps/soul_gut/config/config.exs. In particular, you'll need a database called soul_gut_repo, accessible with username postgres and password supersecure.

Once that's set up, I think you'll need to run mix ecto.create and possibly mix ecto.migrate. At any rate, it can't hurt.

Then, run iex -S mix phoenix.server, and visit localhost:4000/api/services to see a list of implemented services and whether or not you have credentials for them (you shouldn't).

Choose a service, we'll use Facebook as an example. Give your app id and secret by putting {"client_id": "XXX", "client_secret": "XXX"} to http://localhost:4000/api/services/facebook/app.

curl -X PUT -H 'Content-Type: application/json' -d '{"client_id": "XXX", "client_secret": "XXX"}' http://localhost:4000/api/services/facebook/app

Then, visit http://localhost:4000/auth/facebook to authenticate. Then you should be able to visit http://localhost:4000/api/facebook/me/feed.

soul's People

Contributors

philipcmonk avatar stephenlacy avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

soul's Issues

Add authentication

  • Add API access authentication
  • Should confirm for a JWT token on certain request parameters:
    • Headers: headers['x-session-token'] = <token>
    • Query String: ?token=<token>
  • The JWT should be stored with a expiration time on the Sessions table
  • Upon logout the Session row corresponding with the current logged in session.id should be invalidated

Refactor strategies

I believe the following functions are sufficiently general that they can be pulled into the Strategies module directly:

client/1
has_client?/1
set_client/2
set_client/4
del_client/1

Tests

Yeah, probably needs some tests

Should cache responses from services

A dumb cache probably won't end up cutting it -- some data changes very often and other doesn't. In reality, we're going to have to understand the api anyway -- a proxy isn't sufficient for our goals.

convert to snake_case

Still learning elixir conventions, but function, variable, etc should be in snake_case rather than camelCase.

Needs an endpoint for the authorization url

Either use /api/services (get all authorization urls for services we don't have credentials for) or /api/services/:service. I lean toward the latter, just because it feels asymptotically more correct, but they're essentially equivalent.

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.