Giter Site home page Giter Site logo

herks / partybus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nobleuplift/lunchtrain

0.0 0.0 0.0 926 KB

Lunch Train is a Slack app written in PHP to help coordinate team outings

Home Page: http://slackapi.github.io/lunchtrain/

PHP 81.09% Shell 0.31% CSS 7.73% Hack 7.88% TSQL 3.00%

partybus's Introduction

Lunch Train

Lunch Train

This repo contains the code for the Slack demo app Lunch Train: http://www.lunchtrainbot.com/

Lunch Train is a Slack app that helps you schedule and coordinate team social outings like lunch trips.

Code Overview

Landing page

Landing page HTML is in index.php and all the assets are inside these folders: js, img, fonts, font-awesome, CSS

Heroku Configurations

app.json, composer.json and Procfile together define the heroku app configuration.

Libraries

Files inside include directory are various small libraries that are used in Lunch Train

  • config.php: Slack app configuration
  • db_config.php: Database configuration
  • init.php: initial load configuration
  • lib_app_installs.php: methods to manage api token storage.
  • lib_curl.php: handles http download requests
  • lib_db.php: Database management
  • lib_message.php: creates message payload for slack messages
  • lib_slack.php: methods to post/update messages to slack
  • lib_time_parser.php: parse natural language time inside the slash command
  • lib_trains.php, lib_train_actions.php:

Database schema

schama.sql contains the lunch train MySQL DB schema.

Command & Action Requests

  • Slash command requests are processed by command.php
  • Button action requests are processed by action.php
  • Slack Events API events are processed by events.php

Setup and Development

  1. Create your config file by copying include/config-example.php and renaming it to config.php, and adding your app's credentials.

  2. Setup Heroku locally: https://devcenter.heroku.com/articles/getting-started-with-php#set-up

  3. Within the LunchTrain clone, run the line heroku git:remote -a lunchtrainbot-staging

  4. Install MAMP (apache and MySQL). https://www.mamp.info/en/ and setup database using schema.sql

  5. Add LunchTrain folder to your webroot.

  6. Add the notification cron job:

    cron_leave_now_2_min_warning is executed every minute to send 2-minute warnings and update the in-channel message that train has left. The cron is executed from dev-sandbox. Following is the cron config.

    * * * * * curl "http://lunchtrainbot-staging.herokuapp.com/cron_leave_now_2_min_warning.php?env=dev"
    * * * * * curl "http://lunchtrainbot.herokuapp.com/cron_leave_now_2_min_warning.php?env=prod"
    

partybus's People

Contributors

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