├── .github
└── workflows
│ └── deploy.yml
├── .gitignore
├── LICENSE
├── README.md
├── docs
└── hello-world-config.png
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
├── speechly_app_config.sal
├── src
├── App.css
├── App.test.tsx
├── App.tsx
├── Microphone.tsx
├── RepoList.tsx
├── SpeechApp.tsx
├── data.ts
├── filter.ts
├── index.css
├── index.tsx
├── logo.svg
├── parser.ts
├── react-app-env.d.ts
├── serviceWorker.ts
└── setupTests.ts
├── tsconfig.json
└── yarn.lock
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy
2 |
3 | on:
4 | push:
5 | branches: [master]
6 |
7 | jobs:
8 | build:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@v2
12 | with:
13 | persist-credentials: false
14 | - run: npm install --no-dev
15 | - run: npm run-script build
16 | env:
17 | REACT_APP_APP_ID: ${{ secrets.REACT_APP_APP_ID }}
18 | REACT_APP_LANGUAGE: ${{ secrets.REACT_APP_LANGUAGE }}
19 | - name: deploy
20 | uses: JamesIves/github-pages-deploy-action@releases/v3
21 | with:
22 | ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
23 | BRANCH: gh-pages
24 | FOLDER: build
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Speechly
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This repo has been moved to https://github.com/speechly/speechly/tree/main/examples/react-client-example
2 |
--------------------------------------------------------------------------------
/docs/hello-world-config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/speechly/react-example-repo-filtering/89ca3c15025c4136ab674f519c66a3ad3624662c/docs/hello-world-config.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "voice-repo-filtering",
3 | "homepage": "https://speechly.github.io/react-example-repo-filtering",
4 | "version": "0.1.0",
5 | "private": true,
6 | "dependencies": {
7 | "@speechly/react-client": "0.0.2",
8 | "@testing-library/jest-dom": "^4.2.4",
9 | "@testing-library/react": "^9.3.2",
10 | "@testing-library/user-event": "^7.1.2",
11 | "@types/jest": "^24.0.0",
12 | "@types/node": "^12.0.0",
13 | "@types/react": "^16.9.0",
14 | "@types/react-dom": "^16.9.0",
15 | "react": "^16.13.1",
16 | "react-dom": "^16.13.1",
17 | "react-scripts": "3.4.3",
18 | "typescript": "~3.7.2"
19 | },
20 | "scripts": {
21 | "start": "react-scripts start",
22 | "build": "react-scripts build",
23 | "test": "react-scripts test",
24 | "eject": "react-scripts eject"
25 | },
26 | "eslintConfig": {
27 | "extends": "react-app"
28 | },
29 | "browserslist": {
30 | "production": [
31 | ">0.2%",
32 | "not dead",
33 | "not op_mini all"
34 | ],
35 | "development": [
36 | "last 1 chrome version",
37 | "last 1 firefox version",
38 | "last 1 safari version"
39 | ]
40 | }
41 | }
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/speechly/react-example-repo-filtering/89ca3c15025c4136ab674f519c66a3ad3624662c/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Speechly React Example
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/speechly/react-example-repo-filtering/89ca3c15025c4136ab674f519c66a3ad3624662c/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/speechly/react-example-repo-filtering/89ca3c15025c4136ab674f519c66a3ad3624662c/public/logo512.png
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/speechly_app_config.sal:
--------------------------------------------------------------------------------
1 | # Which languages we can filter by
2 | languages = [
3 | Go
4 | TypeScript
5 | Python
6 | ]
7 |
8 | # Which fields we can sort by
9 | sort_fields = [
10 | name
11 | description
12 | language
13 | followers
14 | stars
15 | forks
16 | ]
17 |
18 | # Synonyms for "repo"
19 | results = [
20 | items
21 | results
22 | repos
23 | repositories
24 | ]
25 |
26 | # A couple of commands for filtering.
27 | #
28 | # This will expand into e.g. following examples (not exhaustive):
29 | # "Show all Go repos"
30 | # "Show me only TypeScript repositories"
31 | # "Show Python results"
32 | # etc.
33 | #
34 | # Words in curly brackets ("{me}") are optional.
35 | # Square brackets are for lists (e.g. one option from the list may be used)
36 | *filter show {me} {[all | only]} $languages(language) {$results}
37 | *filter filter {$results} by $languages(language) {language}
38 |
39 | # A command for sorting, e.g.:
40 | # "Sort the repos by name"
41 | # "Order results by forks"
42 | # etc.
43 | *sort [sort | order] {the} {$results} by $sort_fields(sort_field)
44 |
45 | # A command for resetting the filters, e.g.:
46 | # "Reset all filters to default"
47 | # "Remove the filters"
48 | # "Reset to default"
49 | # etc.
50 | *reset [reset | remove] {[the | all]} {filters} {to default}
51 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | .block {
2 | margin: 1em;
3 | }
4 |
--------------------------------------------------------------------------------
/src/App.test.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render();
7 | const linkElement = getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { SpeechProvider } from "@speechly/react-client";
3 |
4 | import "./App.css";
5 |
6 | import { SpeechApp } from "./SpeechApp";
7 |
8 | function App() {
9 | const appId = process.env.REACT_APP_APP_ID ?? "";
10 | if (appId === undefined) {
11 | throw Error("Missing Speechly app ID!");
12 | }
13 |
14 | const language = process.env.REACT_APP_LANGUAGE ?? "";
15 | if (language === undefined) {
16 | throw Error("Missing Speechly app language!");
17 | }
18 |
19 | return (
20 |
21 |
22 |
Speechly React example app
23 |
24 |
25 |
26 | This is an example app for filtering data using{" "}
27 | Speechly and{" "}
28 | React. Check out the source code on{" "}
29 |
30 | GitHub
31 |
32 |
33 |
34 |
35 | Try filtering the repos by language by pressing the "Start" button and
36 | saying e.g.:
37 |
38 |
39 | Show me Go repos
40 |
41 |
42 | Show all TypeScript repositories
43 |
44 |
45 | You can also sort by saying, e.g.:
46 |
47 |
48 | Sort by stars
49 |
50 |
51 | Order by name
52 |
53 |
54 | If you want to reset the filters, just say Reset the filters.
55 |