Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
the-AjK committed Mar 29, 2018
0 parents commit 4b9ebce
Show file tree
Hide file tree
Showing 183 changed files with 17,588 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BTB - BiteTheBot
(BSD-3 license)

Copyright © 2018 Alberto Garbui <alberto.garbui@gmail.com>

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

-Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
-Neither the name of BTB - BiteTheBot nor the names of its contributors may be
used to endorse or promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node index.js
133 changes: 133 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<p align="center"><img src="logo.png" align="center" /></p>

# BiteTheBot
Copyright © 2018, [Alberto Garbui (aka JK)](mailto:alberto.garbui@gmail.com)

Find me on:
[![alt text][1.1]][1]
[![alt text][2.1]][2]
[![alt text][6.1]][6]

[1.1]: http://i.imgur.com/tXSoThF.png (twitter)
[2.1]: http://i.imgur.com/P3YfQoD.png (facebook)
[6.1]: http://i.imgur.com/0o48UoR.png (github)

[1]: https://twitter.com/albertoajk
[2]: https://www.facebook.com/ajk.alberto
[6]: https://github.com/the-AjK

> BiteTheBot (aka BTB) is an innovative tool that will revolutionize your way of ordering lunch.
## Main features

* *Mobile ready*: Telegram bot user experience with a fully mobile responsive web application for admins users.
* *Coolest bot ever*: based on Futurama© Bender© robot. Beers are always accepted!
* *Easy to use*: each user can easily register itself searching the the bot name "*BiteTheBot*" in the Telegram search bar and following the bot instructions. Once enabled, the user will be able to deeply interact with the bot.
* *Passwordless experience*: each user can use BTB with Telegram. Enabled users can order food and indicate other preferences as: table, take away ecc.
* *Realtime notifications and reminders*: each user can receive notifications regarding the new daily menu and the daily order reminder based on personal settings.
* *Admin dashboard*: admin users can manage in detail menus (tables, final time ecc.), orders and users with a powerful fully mobile responsive webapp.

## Whistlist/TODO

* Deep user editing
* Tables selection on menu create/update
* Menu suggestions on menu create/update
* Cool statistics/graphs
* Dashboard tables pagination
* Basic user dashboard section to place orders through web interface
* ...and more...

## Getting Started with BTB

### Requirements

* [NodeJS](https://nodejs.org) >= 8.11.0
* [Yarn](https://yarnpkg.com) >= 1.5.1
* A valid [Telegram bot token](https://telegram.org/blog/bot-revolution)
* [Mongo DB database](https://www.mongodb.com)

### Enviroment variables

The following enviroments variable are required to run BTB, you can save them in a .env file in the root dir:

* NODE_ENV: production/development flag
* BOT_TOKEN: telegram bot token
* PORT: NodeJS binding port
* MONGODB_URI: MongoDB connection URI
* JWT_SECRET: JWT secret
* MAIL_SERVICE: mail service (Gmail)
* MAIL_USERNAME: email account username
* MAIL_PASSWORD: email account password
* ROOT_TELEGRAM_ID: Telegram ID of the choosen one ;D

Example:

``` env
NODE_ENV=production
BOT_TOKEN=123456789:nhnms9u7mjg58bs1ong78bjrr5
PORT=3001
MONGODB_URI=mongodb://user:password@database:port/db_name
JWT_SECRET=supersecretjwt!
MAIL_SERVICE=Gmail
MAIL_USERNAME=username@gmail.com
MAIL_PASSWORD=password
ROOT_TELEGRAM_ID=123456789
```

### Build the dashboard GUI

Run *yarn install* to install the dashboard dependencies and *yarn run build* to create an optimized production build:

``` bash
cd btb/dashboard
yarn install
yarn run build
```

### Install server dependencies

Run *yarn install* to install the server dependencies in the root folder:

``` bash
cd btb/
yarn install
```

### Run

To run BTB, run:

``` bash
node index.js
```

## License

BTB - BiteTheBot
(BSD-3 license)

Copyright © 2018 Alberto Garbui <alberto.garbui@gmail.com>

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

-Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
-Neither the name of BTB - BiteTheBot nor the names of its contributors may be
used to endorse or promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 3 additions & 0 deletions dashboard/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "react-app"
}
11 changes: 11 additions & 0 deletions dashboard/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[ignore]

[include]

[libs]

[lints]

[options]

[strict]
18 changes: 18 additions & 0 deletions dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
31 changes: 31 additions & 0 deletions dashboard/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "dashboard",
"version": "0.1.0",
"private": true,
"dependencies": {
"downshift": "^1.31.2",
"flow-bin": "^0.66.0",
"jwt-decode": "^2.2.0",
"keycode": "^2.2.0",
"material-ui": "^1.0.0-beta.35",
"material-ui-icons": "^1.0.0-beta.36",
"mobx": "^3.6.1",
"mobx-react": "^4.4.2",
"moment": "^2.21.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-router-dom": "^4.2.2",
"react-scripts": "^1.1.1",
"react-table": "^6.8.0",
"styled-components": "^3.2.3",
"superagent": "^3.8.2",
"typeface-roboto": "^0.0.54",
"validatorjs": "^3.14.2"
},
"scripts": {
"start": "REACT_APP_JTW_TOKEN_STORAGE_KEY='btb_token' react-scripts start",
"build": "REACT_APP_JTW_TOKEN_STORAGE_KEY='btb_token' react-scripts build",
"test": "react-scripts test --env=jsdom",
"flow": "flow"
}
}
48 changes: 48 additions & 0 deletions dashboard/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/static/icons/favicon.ico">
<script src="%PUBLIC_URL%/static/js/pace.min.js"></script>
<script src="%PUBLIC_URL%/static/js/ifvisible.min.js"></script>
<link href="%PUBLIC_URL%/static/css/pace-theme-minimal.css" rel="stylesheet" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>BiteTheBot</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<script type = "text/javascript" >
//$(document).ready(function() {
Pace.start();
//});
</script>
</html>
51 changes: 51 additions & 0 deletions dashboard/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"short_name": "BTB",
"name": "BiteTheBot",
"icons": [
{
"src": "\/static\/icons\/favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "\/static\/icons\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/static\/icons\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/static\/icons\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/static\/icons\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/static\/icons\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/static\/icons\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
],
"start_url": "/index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Loading

0 comments on commit 4b9ebce

Please sign in to comment.