Skip to content

Commit

Permalink
Merge pull request #97 from ant-xuexiao/refactor/project-folder-struc…
Browse files Browse the repository at this point in the history
…ture

refactor/project folder structure
  • Loading branch information
RaoHai authored Apr 25, 2024
2 parents ea45180 + 6d728ee commit d49a311
Show file tree
Hide file tree
Showing 109 changed files with 3,333 additions and 2,728 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/aws-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,15 @@ jobs:
- run: sam build --use-container --config-file .aws/petercat-preview.toml

# Prevent prompts and failure when the stack is unchanged
- run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --config-file .aws/petercat-preview.toml
- run: |
sam deploy \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--config-file .aws/petercat-preview.toml \
--parameter-overrides GitHubAppID=${{ secrets.X_GITHUB_APP_ID }} \
GithubAppsClientId=${{ secrets.X_GITHUB_APPS_CLIENT_ID }} \
GithubAppsClientSecret=${{ secrets.X_GITHUB_APPS_CLIENT_SECRET }} \
OpenAIAPIKey=${{ secrets.OPENAI_API_KEY }} \
SupabaseServiceKey=${{ secrets.SUPABASE_SERVICE_KEY }} \
SupabaseUrl=${{ secrets.SUPABASE_URL }} \
TavilyAPIKey=${{ secrets.TAVILY_API_KEY }}
13 changes: 12 additions & 1 deletion .github/workflows/aws-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ jobs:
- run: sam build --use-container --config-file .aws/petercat-prod.toml

# Prevent prompts and failure when the stack is unchanged
- run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --config-file .aws/petercat-prod.toml
- run: |
sam deploy \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--config-file .aws/petercat-prod.toml \
--parameter-overrides GitHubAppID=${{ secrets.X_GITHUB_APP_ID }} \
GithubAppsClientId=${{ secrets.X_GITHUB_APPS_CLIENT_ID }} \
GithubAppsClientSecret=${{ secrets.X_GITHUB_APPS_CLIENT_SECRET }} \
OpenAIAPIKey=${{ secrets.OPENAI_API_KEY }} \
SupabaseServiceKey=${{ secrets.SUPABASE_SERVICE_KEY }} \
SupabaseUrl=${{ secrets.SUPABASE_URL }} \
TavilyAPIKey=${{ secrets.TAVILY_API_KEY }}
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
__pycache__/
*.pyc
# dependencies
/node_modules
/.pnp
.pnp.js
node_modules/

server/temp/

# testing
/coverage

# next.js
/.next/
/out/
.next/
out/


# production
/build
build

# misc
.DS_Store
Expand All @@ -26,6 +25,7 @@ server/temp/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.yarnrc.yml

# local env files
.env*.local
Expand Down
1 change: 1 addition & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
docker/
lui/
server/
Binary file removed bin/act
Binary file not shown.
1 change: 1 addition & 0 deletions .env.example → client/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
SELF_PATH=/client/
SUPABASE_URL=http://localhost:8000
SUPABASE_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion app/page.tsx → client/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { Assistant } from 'petercat-lui';

declare type Bot = Tables<'bots'>;

const ASSISTANT_API_HOST = process.env.NEXT_PUBLIC_ASSISTANT_API_HOST;

export default function Home() {
const { data: bots, isLoading, error } = useBotList();
if (isLoading) {
Expand All @@ -21,7 +23,7 @@ export default function Home() {

return (
<div>
<Assistant host="https://api.petercat.chat" />
<Assistant host={ASSISTANT_API_HOST} />

<div className="container mx-auto max-w-[1024px]">
<div className="mt-8">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions next.config.js → client/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// module.exports = withBundleAnalyzer({})

module.exports = {
...process.env.NEXT_STANDALONE ? { output: "standalone" } :{},
webpack: (config) => {
config.resolve.fallback = { http: false, https: false, net: false, tls: false };

Expand Down
57 changes: 57 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "bot-meta",
"version": "0.0.0",
"private": true,
"scripts": {
"bootstrap": "yarn",
"dev": "next dev",
"build": "next build",
"build:docker": "docker build -t bot-meta .",
"start": "next start",
"lint": "next lint",
"format": "prettier --write \"app\""
},
"engines": {
"node": ">=18"
},
"dependencies": {
"@auth0/nextjs-auth0": "^3.3.0",
"@next/bundle-analyzer": "^13.4.19",
"@nextui-org/react": "^2.2.9",
"@supabase/supabase-js": "^2.32.0",
"@tanstack/react-query": "^5.17.19",
"@types/node": "20.4.5",
"@types/react": "18.2.17",
"@types/react-dom": "18.2.7",
"ai": "^2.1.28",
"autoprefixer": "10.4.14",
"axios": "^1.6.7",
"concurrently": "^8.2.2",
"dayjs": "^1.11.10",
"petercat-lui": "^0.0.4",
"eslint": "8.46.0",
"eslint-config-next": "13.4.12",
"framer-motion": "^10.16.15",
"https-proxy-agent": "^7.0.2",
"immer": "^10.0.3",
"langchain": "^0.0.187",
"lodash": "^4.17.21",
"next": "14.0.1",
"openai": "^4.24.7",
"postcss": "8.4.27",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-toastify": "^9.1.3",
"tailwindcss": "3.3.3",
"typescript": "5.1.6",
"use-immer": "^0.9.0",
"zod": "^3.22.3",
"zod-to-json-schema": "^3.21.4"
},
"devDependencies": {
"@svgr/webpack": "^8.1.0",
"@types/lodash": "^4.14.202",
"prettier": "3.0.0"
},
"repository": "https://github.com/ant-xuexiao/bot-combo.git"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion tailwind.config.js → client/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const {nextui} = require("@nextui-org/react");
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./app/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
"./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit d49a311

Please sign in to comment.