Git Product home page Git Product logo

labs-slack-integration's Introduction

What is this

MIT licensed Build Status

Simple application to send a messages to Slack and listen outgoing messages from Slack and reply those.

Table of Contents

Requirements

Installation

1. Clone repository

Use your favorite IDE and get checkout from GitHub or just use following command

git clone https://github.com/protacon/labs-slack-integration.git

2. Configuration

Next you need to create .env file, which contains all the necessary environment variables that application needs. You can create it by following command (in folder where you cloned this project):

cp .env.dist .env

Then open that file and make necessary changes to it. Note that this .env file is ignored on VCS.

3. Dependencies installation

Next phase is to install all needed dependencies. This you can do with following command, in your project folder:

composer install

Or if you haven't installed composer globally

curl -sS https://getcomposer.org/installer | php
php composer.phar install

4. File permissions

Next thing is to make sure that application var directory has correct permissions. Instructions for that you can find here.

I really recommend that you use ACL option in your development environment.

5. Environment checks

To check that your environment is ready for this application. You need to make two checks; one for CLI environment and another for your web-server environment.

CLI environment

You need to run following command to make all necessary checks.

./vendor/bin/requirements-checker

Web-server environment

Open terminal and go to project root directory and run following command to start standalone server.

./bin/console server:start

Open your favorite browser with http://127.0.0.1:8000/check.php url and check it for any errors.

6. Slack configuration

You need to configure your Slack to connect to this application. And to do that open https://[your_slack].slack.com/customize/ in your favorite browser and click Configure Apps on left hand side menu.

And after that click Custom Integrations

Incoming WebHooks

Create new hook as you like, and copy that Webhook URL to your .env file SLACK_WEBHOOK_URL value.

Outgoing WebHooks

Create new hook as you like, and set this application URL to URL(s) section on configuration. Then copy token to your .env file SLACK_TOKEN value.

Development

IDE

I highly recommend that you use "proper" IDE to development your application. Below is short list of some popular IDEs that you could use.

Personally I recommend PhpStorm, but just choose one which is the best for you. Also note that project contains .idea folder that holds default settings for PHPStorm.

PHP Code Sniffer

It's highly recommended that you use this tool while doing actual development to application. PHP Code Sniffer is added to project dev dependencies, so all you need to do is just configure it to your favorite IDE. So the phpcs command is available via following example command.

./vendor/bin/phpcs -i

If you're using PhpStorm following links will help you to get things rolling.

Docker

Todo

Testing

Project contains bunch of tests (Functional, Integration, Unit) which you can run simply by following command:

./bin/phpunit

Note that you need to create .env.test file to define your testing environment. This file has the same content as the main .env file, just change it to match your testing environment.

Or you could easily configure your IDE to run these for you.

Coverage

After you have run tests you can see actual code coverage by opening ./build/report/index.html with your favorite browser

Metrics

Project also contains PhpMetrics to make some analyze of your code. You can run this by following command:

./vendor/bin/phpmetrics --junit=build/logs/junit.xml --report-html=build/phpmetrics .

And after that open build/phpmetrics/index.html with your favorite browser.

Links / resources

Authors

Tarmo Leppänen

License

The MIT License (MIT)

Copyright © 2018 Protacon Solutions Ltd

labs-slack-integration's People

Contributors

tarlepp avatar

Watchers

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