{"id":24969459,"url":"https://github.com/intrepidpursuits/lunchtrain","last_synced_at":"2025-04-11T04:40:40.269Z","repository":{"id":151543749,"uuid":"101936931","full_name":"IntrepidPursuits/lunchtrain","owner":"IntrepidPursuits","description":"Lunch Train is a Slack app written in PHP to help coordinate team outings","archived":false,"fork":false,"pushed_at":"2017-08-31T21:27:05.000Z","size":972,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-25T02:43:45.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://slackapi.github.io/lunchtrain/","language":"CSS","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IntrepidPursuits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-30T23:09:12.000Z","updated_at":"2020-02-15T02:28:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"91db7110-132e-4bdc-bd95-6d2ffd2592d8","html_url":"https://github.com/IntrepidPursuits/lunchtrain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntrepidPursuits%2Flunchtrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntrepidPursuits%2Flunchtrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntrepidPursuits%2Flunchtrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntrepidPursuits%2Flunchtrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IntrepidPursuits","download_url":"https://codeload.github.com/IntrepidPursuits/lunchtrain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345275,"owners_count":21088242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-03T14:38:20.941Z","updated_at":"2025-04-11T04:40:40.247Z","avatar_url":"https://github.com/IntrepidPursuits.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Lunch Train](https://user-images.githubusercontent.com/32463/28790268-42eebab4-75dd-11e7-80ce-e825b5a703df.png)\n\n ## Lunch Train\n\nThis repo contains the code for the Slack demo app Lunch Train: http://www.lunchtrainbot.com/\n\nLunch Train is a Slack app that helps you schedule and coordinate team social outings like lunch trips.\n\n### Code Overview\n\n#### Landing page\nLanding page HTML is in `index.php` and all the assets are inside these folders:  js, img, fonts, font-awesome, CSS \n\n#### Heroku Configurations\napp.json, composer.json and Procfile together define the heroku app configuration.\n\n\n#### Libraries\n\nFiles inside `include` directory are various small libraries that are used in Lunch Train\n\n* config.php: Slack app configuration\n* db_config.php: Database configuration\n* init.php: initial load configuration\n* lib_app_installs.php: methods to manage api token storage.\n* lib_curl.php: handles http download requests\n* lib_db.php: Database management\n* lib_message.php: creates message payload for slack messages\n* lib_slack.php: methods to post/update messages to slack\n* lib_time_parser.php: parse natural language time inside the slash command\n* lib_trains.php, lib_train_actions.php: \n\n#### Database schema\nschama.sql contains the lunch train MySQL DB schema.\n\n#### Command \u0026 Action Requests\n* Slash command requests are processed by `command.php`\n* Button action requests are processed by `action.php`\n* Slack Events API events are processed by `events.php`\n\n#### Setup and Development\n1. Create your config file by copying `include/config-example.php` and renaming it to `config.php`, and adding your app's credentials.\n2. Setup Heroku locally: https://devcenter.heroku.com/articles/getting-started-with-php#set-up\n3. Within the LunchTrain clone, run the line `heroku git:remote -a lunchtrainbot-staging`\n4. Install MAMP (apache and MySQL). https://www.mamp.info/en/ and setup database using `schema.sql`\n5. Add LunchTrain folder to your webroot.\n6. Add the notification cron job:\n\n   `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. \n   ```\n   * * * * * curl \"http://lunchtrainbot-staging.herokuapp.com/cron_leave_now_2_min_warning.php?env=dev\"\n   * * * * * curl \"http://lunchtrainbot.herokuapp.com/cron_leave_now_2_min_warning.php?env=prod\"\n   ```\n   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintrepidpursuits%2Flunchtrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintrepidpursuits%2Flunchtrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintrepidpursuits%2Flunchtrain/lists"}