Commit cfa95014 authored by sharanjan's avatar sharanjan

Sulokshan backend

parent 34c0ab49
> 1%
last 2 versions
\ No newline at end of file
.git
node_modules
\ No newline at end of file
module.exports = {
root: true,
env: {
node: true
},
extends: [
'eslint:recommended',
'plugin:vue/recommended',
'@mishushakov',
'@mishushakov/eslint-config/vue'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
\ No newline at end of file
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
\ No newline at end of file
FROM node as builder
WORKDIR /app
COPY . .
RUN npm install && npm run build --if-present
FROM pagespeed/nginx-pagespeed
COPY --from=builder /app/dist /usr/share/nginx/html
\ No newline at end of file
This diff is collapsed.
# Dialogflow for Web *v2*
This is a mobile-friendly Web Application for [Dialogflow V2](https://dialogflow.com).
For a live demo, [check this](https://mishushakov.github.io/dialogflow-web-v2/).
# Installation
## Requirements
- NodeJS & NPM (or Yarn)
- Dialogflow V2 Project (for V1, use this [old repo](https://github.com/mishushakov/dialogflow-web))
## Set up Dialogflow Gateway (backend)
To connect this UI with Dialogflow, you need to use a backend server.
- [Dialogflow Gateway API](https://github.com/narVidhai/Dialogflow-Gateway-Server) - Host this server and get the hosted URL.
## Setup
Clone this repo first and `cd` into it.
### Get the dependencies
- Using npm: `npm i`
- (Or) Using yarn: `yarn`
### Connect your Agent
Open `src/Config/index.js` and change the `API_URL` variable to your Dialogflow Gateway API that you hosted.
The logo, agent name, description and available languages are fetched from your Dialogflow project. Change them there and it will sync to the UI.
## Serving the application
To `serve` the web application (development purpose):
-npm install @vue/cli-service -g
- Using npm: `npm run serve`
- (Or) Using yarn: `yarn serve`
Your browser should open and redirect to `localhost:8080`. You can also give a `--port` argument to serve at specific port.
## Building for production
Your app will be bundled to the `dist` directory
- Using npm: `npm run build`
- (Or) Using yarn: `yarn build`
<hr/>
<hr/>
## UI Features
Note: This is an unofficial Web Integration
- Dark Mode & [Theming](#theming)
- Voice Input and Speech Feedback (with SSML)
- [Docker](./Dockerfile) and [Kubernetes](./k8s) support
- [Rich-component](https://developers.google.com/assistant/conversational/rich-responses), Webhook and Actions on Google Support ([demo](https://mishushakov.github.io/dialogflow-web-v2/))
- Floating Widget for embedding on websites ([repo and demo](https://github.com/mishushakov/df-btn))
- Based on Vue, Webpack, Babel and PostCSS
- Lightweight (build is <50KB gzipped)
- Free and fully Documented
- Recommended by [Dialogflow](https://twitter.com/Dialogflow/status/923976390201847809) and [MadeWithVueJS](https://twitter.com/MadeWithVueJS/status/1130147606666063875)
## Theming
You can make a custom theme for Dialogflow for Web v2, according to the specification:
![Theme Dialogflow for Web v2](https://svgur.com/i/HVW.svg)
To apply the variables, open `src/Style/Theme.sass` and change them in the `\:root` selector
You can also optimize your theme for Dark-mode-enabled clients within the same file and selector under the `@media (prefers-color-scheme: dark)`
Please note, when adding new languages, you may have to translate some of the UI as well (`translations.json` in `src/Translations`)
module.exports = {
presets: [
'@vue/app'
]
}
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: ushaflow-web
spec:
selector:
matchLabels:
app: ushaflow-web
template:
metadata:
labels:
app: ushaflow-web
spec:
containers:
- name: ushaflow-web
image: docker.pkg.github.com/mishushakov/dialogflow-web-v2/dialogflow-web-v2
\ No newline at end of file
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ushaflow-web
spec:
rules:
- host: example.com
http:
paths:
- path: /
backend:
serviceName: ushaflow-web
servicePort: http
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: ushaflow-web
spec:
selector:
app: ushaflow-web
ports:
- name: http
targetPort: 80
port: 80
\ No newline at end of file
This diff is collapsed.
{
"name": "dialogflow-web-v2",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"audio-recorder-polyfill": "^0.3.4",
"core-js": "^3.6.4",
"dialogflow-gateway": "0.0.7",
"dialogflow": "^0.7.0",
"hark": "^1.2.3",
"langs": "^2.0.0",
"register-service-worker": "^1.7.1",
"vue": "^2.6.11",
"vue-resource": "^1.5.1"
},
"devDependencies": {
"@mishushakov/eslint-config": "^1.0.6",
"@vue/cli-plugin-babel": "^4.2.3",
"@vue/cli-plugin-eslint": "^4.2.3",
"@vue/cli-plugin-pwa": "^4.2.3",
"@vue/cli-service": "^4.2.3",
"babel-eslint": "^10.1.0",
"eslint": "^6.8.0",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.26.3",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
}
}
module.exports = {
plugins: {
autoprefixer: {}
}
}
\ No newline at end of file
module.exports = {
lintOnSave: false,
publicPath: '',
productionSourceMap: false
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment