GithubHelp home page GithubHelp logo

kiritvaghela / chameleon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iankeen/chameleon

0.0 0.0 0.0 43 KB

A set of Frameworks for interacting with Slack APIs and building bots on OSX and Heroku

Swift 100.00%

chameleon's Introduction

Chameleon

A set of Frameworks for interacting with Slack APIs and building bots in Swift on OSX and Heroku

Swift

Features

Chameleon provides frameworks for:

  • Web API
  • Real time messaging API
  • Bot: Uses Web/RTM and provides an API for custom services (i.e. karma)

Using Chameleon you are able to interact with these an a type-safe manner.

Preparing to use Chameleon

Swift 3

You need Swift 3 installed to use or contribute to Chameleon, I recommend using swiftenv.

swiftenv install DEVELOPMENT-SNAPSHOT-2016-05-09-a
swiftenv global DEVELOPMENT-SNAPSHOT-2016-05-09-a

This will install the snapshot and set it as the default installation of Swift 3.

Slack

You will need to configure a new bot user for your team. Copy the token, you will need it.

Heroku

If you plan to run a bot on Heroku you will need a Heroku account (free is fine!) and also have the Heroku Toolbelt installed.

Running locally on OSX

  • Download the latest Chameleon source and extract it
  • Open a terminal window and go to the directory containing Package.swift
  • Type swift build
  • Type .build/debug/app --token="<your-bot-token>"
  • Go into a default channel in your slack and say "hey @yourBot" - it should respond.

Deploy to Heroku

  • Download the latest Chameleon source and extract it
  • Open a terminal window and go to the directory containing Package.swift
  • Using the Heroku CLI login and create a new app.
  • Set the buildpack heroku buildpacks:set https://github.com/oarrabi/heroku-buildpack-swift
  • Create a file called Procfile and add the text: worker: App --token="<your-bot-token>"
  • Deploy to Heroku by typing:
git add .
git commit -am 'depoy to heroku'
git push heroku master
  • Once that has completed type: heroku ps:scale worker=1
  • Go into a default channel in your slack and say "hey @yourBot" - it should respond.

⚠️ Work in Progress

This is a work in progress so expect improvements as well as breaking changes!

Chameleon is functional however there is still a lot to do before it is complete

  • Currently the 'persistence layer' is memory :(
  • The Web and Real time messaging APIs can do a lot - I have built support for the core/most common features but they are incomplete. I will add more over time until they are complete.
  • Once stable and the API is 'firmer' the individual frameworks will be broken out. They all live here for now for ease of development, however, separation should be considered when contributing.

#Acknowledgement This was my first dive into 'Server Side Swift'; 95% of this code was done over a total of a few days but getting working in the terminal and then deployed to Heroku took far longer... This project would likely have ended up as mostly useless OSX app if it hadn't been for the teams from Vapor and Zewo pioneering the server side Swift movement. I am especially thankful for the help and patience of Logan Wright, Tanner Nelson and Dan Appel

Contact

Feel free to open an issue or PR, if you wanna chat you can find me on Twitter (@IanKay) or on iOS Developers

chameleon's People

Contributors

iankeen 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.