Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cogentapps committed Mar 14, 2023
1 parent 4a5e8c9 commit 645b66b
Show file tree
Hide file tree
Showing 104 changed files with 11,064 additions and 1,565 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: npm install && npm run build
- run: cd app && npm install && npm run build
135 changes: 133 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,133 @@
node_modules
package-lock.json
*.sqlite
*.db

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
5 changes: 5 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tasks:
- init: cd webapp && npm install
command: cd webapp && npm run start


37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM node:16-alpine AS build

RUN addgroup -S app && adduser -S app -G app
RUN mkdir /app && chown app:app /app

USER app

WORKDIR /app

COPY ./app/package.json ./
COPY ./app/tsconfig.json ./

RUN npm install

COPY ./app/craco.config.js ./craco.config.js
COPY ./app/public ./public
COPY ./app/src ./src

ENV NODE_ENV=production
ENV REACT_APP_AUTH_PROVIDER=local

RUN npm run build

FROM node:16-alpine AS server

RUN addgroup -S app && adduser -S app -G app

WORKDIR /app

COPY ./server/package.json ./
COPY ./server/tsconfig.json ./

RUN npm install

COPY ./server/src ./src

COPY --from=build /app/build /app/public
26 changes: 5 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,31 +42,15 @@ Your API key is stored only on your device and never transmitted to anyone excep

## Running on your own computer

1. First, you'll need to have Git installed on your computer. If you don't have it installed already, you can download it from the official Git website: https://git-scm.com/downloads.

2. Once Git is installed, you can clone the Chat with GPT repository by running the following command in your terminal or command prompt:

```
git clone https://github.com/cogentapps/chat-with-gpt.git
```

3. Next, you'll need to have Node.js and npm (Node Package Manager) installed on your computer. You can download the latest version of Node.js from the official Node.js website: https://nodejs.org/en/download/

4. Once Node.js is installed, navigate to the root directory of the Chat with GPT repository in your terminal or command prompt and run the following command to install the required dependencies:

```
npm install
```

This will install all the required dependencies specified in the package.json file.

5. Finally, run the following command to start the development server:
To run on your own device, you can use Docker:

```
npm run start
git clone https://github.com/cogentapps/chat-with-gpt
cd chat-with-gpt
docker-compose up
```

This will start the development server on port 3000. You can then open your web browser and navigate to http://localhost:3000 to view the Chat with GPT webapp running locally on your computer.
Then navigate to http://localhost:3000 to view the app.

## License

Expand Down
4 changes: 4 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
package-lock.json
.env
build
36 changes: 36 additions & 0 deletions app/craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const cracoWasm = require("craco-wasm");

/*
{
"plugins": [
[
"formatjs",
{
"idInterpolationPattern": "[sha512:contenthash:base64:6]",
"ast": true
}
]
]
}
*/

module.exports = {
plugins: [
cracoWasm(),
],
eslint: {
enable: false
},
babel: {
plugins: [
[
'formatjs',
{
removeDefaultMessage: false,
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true
}
]
]
}
}
54 changes: 33 additions & 21 deletions package.json → app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "chat-with-gpt",
"version": "0.1.1",
"name": "Chat with GPT",
"version": "0.2.0",
"dependencies": {
"@auth0/auth0-spa-js": "^2.0.4",
"@emotion/css": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@mantine/core": "^5.10.5",
Expand All @@ -10,20 +11,8 @@
"@mantine/notifications": "^5.10.5",
"@mantine/spotlight": "^5.10.5",
"@reduxjs/toolkit": "^1.9.3",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/natural": "^5.1.2",
"@types/node": "^16.18.13",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@types/react-helmet": "^6.1.6",
"@types/react-syntax-highlighter": "^15.5.6",
"@types/uuid": "^9.0.1",
"broadcast-channel": "^4.20.2",
"craco": "^0.0.3",
"craco-wasm": "^0.0.1",
"csv": "^6.2.8",
"expiry-set": "^1.0.0",
"idb-keyval": "^6.2.0",
"jshashes": "^1.0.8",
Expand All @@ -32,31 +21,31 @@
"minisearch": "^6.0.1",
"natural": "^6.2.0",
"openai": "^3.2.1",
"papaparse": "^5.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-intl": "^6.2.10",
"react-markdown": "^8.0.5",
"react-redux": "^8.0.5",
"react-router-dom": "^6.8.2",
"react-scripts": "5.0.1",
"react-syntax-highlighter": "^15.5.0",
"redux-persist": "^6.0.0",
"rehype-katex": "^6.0.2",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"sass": "^1.58.3",
"sentence-splitter": "^4.2.0",
"slugify": "^1.6.5",
"sort-by": "^1.2.0",
"typescript": "^4.9.5",
"sort-by": "^0.0.2",
"uuid": "^9.0.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "craco start",
"build": "craco build",
"build": "GENERATE_SOURCEMAP=false craco build",
"test": "craco test",
"eject": "craco eject"
"eject": "craco eject",
"extract": "formatjs extract 'src/**/*.ts*' --ignore='**/*.d.ts' --out-file public/lang/en-us.json --format simple --id-interpolation-pattern '[sha512:contenthash:base64:6]'"
},
"eslintConfig": {
"extends": [
Expand All @@ -75,5 +64,28 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@craco/craco": "^7.1.0",
"@formatjs/cli": "^6.0.4",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/natural": "^5.1.2",
"@types/node": "^16.18.13",
"@types/papaparse": "^5.3.7",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@types/react-helmet": "^6.1.6",
"@types/react-intl": "^3.0.0",
"@types/react-syntax-highlighter": "^15.5.6",
"@types/uuid": "^9.0.1",
"babel-plugin-formatjs": "^10.4.0",
"craco-wasm": "^0.0.1",
"http-proxy-middleware": "^2.0.6",
"react-scripts": "^5.0.1",
"sass": "^1.58.3",
"typescript": "^4.9.5"
}
}
File renamed without changes.
Loading

0 comments on commit 645b66b

Please sign in to comment.