Skip to content

Commit

Permalink
Include legacy demo
Browse files Browse the repository at this point in the history
  • Loading branch information
aerovulpe committed Oct 25, 2021
1 parent c70904f commit 13e980b
Show file tree
Hide file tree
Showing 62 changed files with 5,080 additions and 2,065 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHATKITTY_API_KEY='YOUR_CHATKITTY_API_KEY_HERE'
70 changes: 70 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"react",
"prettier",
"import"
],
"extends": [
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"env": {
"browser": true,
"node": true
},
"globals": {
"document": false
},
"rules": {
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
],
"import/order": [
"error",
{
"newlines-between": "always",
"alphabetize": {
"order": "asc"
}
}
],
"sort-imports": [
"error",
{
"ignoreDeclarationSort": true,
"ignoreCase": true
}
],
"no-use-before-define": [
"error",
{
"variables": false
}
],
"import/no-named-as-default": 0,
"no-param-reassign": [2, { "props": false }],
"@typescript-eslint/no-empty-function": ["error", { "allow": ["arrowFunctions"] }],
"@typescript-eslint/no-empty-interface": "off",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
.env.development.local
.env.test.local
.env.production.local
.eslintcache
.idea

npm-debug.log*
yarn-debug.log*
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
40 changes: 40 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
language: node_js

node_js: 12

before_install:
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
echo '
CHATKITTY_API_KEY="${STAGING_CHATKITTY_API_KEY}"
' >> .env.production;
fi
- if [[ -n $TRAVIS_TAG && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
echo '
CHATKITTY_API_KEY="${PRODUCTION_CHATKITTY_API_KEY}"
' >> .env.production;
fi
install:
- yarn install
script:
- yarn run build
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
TAG="latest";
docker build -t "howdi/chatkitty-demo:$TAG" -f docker/Dockerfile .;
docker push "howdi/chatkitty-demo:$TAG";
fi
- if [[ -n $TRAVIS_TAG && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
TAG="$(git describe --tags)";
docker build -t "howdi/chatkitty-demo:$TAG" -f docker/Dockerfile .;
docker push "howdi/chatkitty-demo:$TAG";
fi
after_success:
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
ecs deploy howdi-dev chatkitty-staging-demo --tag $TAG;
fi
- if [[ -n $TRAVIS_TAG && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
ecs deploy howdi chatkitty-demo --tag $TAG;
fi
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 ChatKitty, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
26 changes: 1 addition & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# dogfood
# ChatKitty chat demo - React

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

Expand Down Expand Up @@ -44,27 +44,3 @@ You don’t have to ever use `eject`. The curated feature set is suitable for sm
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `yarn build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
5 changes: 5 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx
MAINTAINER ChatKitty
EXPOSE 80
ADD build /usr/share/nginx/html/
ADD docker/nginx.conf /etc/nginx/
56 changes: 56 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

server {
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}

location /health {
access_log off;
return 200 'OK';
add_header Content-Type text/plain;
}
}

server {
listen 80;

if ($http_x_forwarded_proto = 'http') {
return 301 https://$host$request_uri;
}

location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
}
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
tcp_nopush on;

keepalive_timeout 65;

gzip on;
}
65 changes: 52 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,58 @@
{
"name": "dogfood",
"name": "chatkitty-chat-demo-react",
"version": "0.1.0",
"private": true,
"license": "MIT",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"lint": "eslint .",
"lint-fix": "eslint --quiet --fix",
"format": "prettier --write \"src/**/*.+(ts|tsx|js|jsx|json|yml|yaml|css|md|vue)\"",
"eject": "react-scripts eject",
"prepare": "husky install"
},
"dependencies": {
"@giphy/js-types": "^4.0.3",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/emoji-mart": "^3.0.5",
"@types/invariant": "^2.2.35",
"@types/jest": "^26.0.15",
"@types/moment": "^2.13.0",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/styled-components": "^5.1.12",
"@types/styled-system": "^5.1.13",
"chatkitty": "1.50.0",
"emoji-mart": "^3.0.1",
"framer-motion": "^4.1.17",
"invariant": "^2.2.4",
"moment": "^2.29.1",
"react": "^17.0.2",
"react-chat-ui-kit": "^1.0.0-beta.1",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"styled-components": "^5.3.1",
"styled-system": "^5.1.5",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
"devDependencies": {
"@typescript-eslint/eslint-plugin": "4.0.1",
"@typescript-eslint/parser": "4.0.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^7.0.1",
"lint-staged": "^11.1.2",
"prettier": "^2.3.2"
},
"browserslist": {
"production": [
Expand All @@ -34,5 +65,13 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"eslint --cache --fix"
],
"*.{json,md,html}": [
"prettier --write"
]
}
}
Binary file modified public/favicon.ico
Binary file not shown.
7 changes: 5 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<meta name="theme-color" content="#000000" />
<meta
name="description"
Expand All @@ -24,7 +27,7 @@
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>React App</title>
<title>ChatKitty React Example</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "ChatKitty",
"name": "ChatKitty React Example",
"icons": [
{
"src": "favicon.ico",
Expand Down
Loading

0 comments on commit 13e980b

Please sign in to comment.