Skip to content

Commit

Permalink
code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
van100j committed Jul 23, 2017
1 parent 71f45c2 commit 8bd7b5a
Show file tree
Hide file tree
Showing 47 changed files with 8,255 additions and 973 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
NODE_ENV=development
PORT=4040
WSURL=http://localhost:4040
APIAI_CLIENT_TOKEN=YOUR_API_AI_TOKEN
APIAI_CLIENT_TOKEN=YOUR_API_AI_CLIENT_ACCESS_TOKEN
GOOGLE_API_KEY=YOUR_GOOGLE_TIMEZONE_API_TOKEN
55 changes: 48 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,52 @@
# Date Bot
# TiBot — The Date and Time Bot

A simple Date bot that answers date related questions like:
- how many days between today and November 21st
- Is it Monday today
- How many days until December
- etc.
A simple bot app which enables users to ask about the current date and time, calculate between dates, determine how many days until another date, etc.

Also API.AI's small talk agent included, which enables the bot to answers questions, well... related to small talk.
## Requirements

The app is built using [Angular](https://angular.io/) on the front end, [Express](https://expressjs.com/) on the back end, and [API.AI](https://api.ai/)'s API to process and understand natural language.

You will need:
- [Node.js](https://nodejs.org/en/), and [npm](https://docs.npmjs.com/getting-started/installing-node) or [Yarn](https://yarnpkg.com/en/)
- [API.AI account](https://console.api.ai/api-client/#/login)

Once you've created your [API.AI account](https://console.api.ai/api-client/#/login) go ahead and create your [Agent](https://api.ai/docs/agents).

You will also need [Google Maps API](https://developers.google.com/maps/get-started/) key, as we'll use some of their APIs to get data related to locations and timezones, specifically:
- The [Google Maps Geocoding API](https://developers.google.com/maps/documentation/geocoding/start) — to get location related data
- The [Google Time Zone API](https://developers.google.com/maps/documentation/timezone/intro) — to get location's timezone data

## Getting Started

You can start by cloning this repo:

```shell
git clone
```

Create your `.env` file which contains your development environment, including the APIs keys, simply copy the `.env.sample` file to `.env`
```shell
cp .env.sample .env
```
and update it accordingly with your API.AI and Google Maps API keys.

Install server dependencies at the root of the directory, and start the Express app:
```shell
npm install
npm start
```

Install front end dependencies in the `./client` directory, and start the Angular app:
```shell
cd client
npm install
npm start
```

## The Front End



Open [http://localhost:4200/](http://localhost:4200/) in your browser.

### Demo at https://the-date-bot.herokuapp.com/
5 changes: 4 additions & 1 deletion client/.angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"styles": [
"styles.css"
],
"scripts": [],
"scripts": [
"../node_modules/moment/min/moment.min.js",
"../node_modules/moment-timezone/builds/moment-timezone-with-data.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
Expand Down
Binary file removed client/dist/favicon.ico
Binary file not shown.
28 changes: 0 additions & 28 deletions client/dist/index.html

This file was deleted.

1 change: 0 additions & 1 deletion client/dist/inline.3c89334d6e0441532305.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion client/dist/main.9c4e9dde1a03a6e675e2.bundle.js

This file was deleted.

Loading

0 comments on commit 8bd7b5a

Please sign in to comment.