diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000000000000000000000000000000000000..85e6143924986743fb2b608eac6f0305a7c1810b --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "next/core-web-vitals", + "rules": { + "react/no-unescaped-entities": ["error", { "forbid": [">", "}"] }] + } +} diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..dfe0770424b2a19faf507a501ebfc23be8f54e7b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,35 +1,2 @@ -*.7z filter=lfs diff=lfs merge=lfs -text -*.arrow filter=lfs diff=lfs merge=lfs -text -*.bin filter=lfs diff=lfs merge=lfs -text -*.bz2 filter=lfs diff=lfs merge=lfs -text -*.ckpt filter=lfs diff=lfs merge=lfs -text -*.ftz filter=lfs diff=lfs merge=lfs -text -*.gz filter=lfs diff=lfs merge=lfs -text -*.h5 filter=lfs diff=lfs merge=lfs -text -*.joblib filter=lfs diff=lfs merge=lfs -text -*.lfs.* filter=lfs diff=lfs merge=lfs -text -*.mlmodel filter=lfs diff=lfs merge=lfs -text -*.model filter=lfs diff=lfs merge=lfs -text -*.msgpack filter=lfs diff=lfs merge=lfs -text -*.npy filter=lfs diff=lfs merge=lfs -text -*.npz filter=lfs diff=lfs merge=lfs -text -*.onnx filter=lfs diff=lfs merge=lfs -text -*.ot filter=lfs diff=lfs merge=lfs -text -*.parquet filter=lfs diff=lfs merge=lfs -text -*.pb filter=lfs diff=lfs merge=lfs -text -*.pickle filter=lfs diff=lfs merge=lfs -text -*.pkl filter=lfs diff=lfs merge=lfs -text -*.pt filter=lfs diff=lfs merge=lfs -text -*.pth filter=lfs diff=lfs merge=lfs -text -*.rar filter=lfs diff=lfs merge=lfs -text -*.safetensors filter=lfs diff=lfs merge=lfs -text -saved_model/**/* filter=lfs diff=lfs merge=lfs -text -*.tar.* filter=lfs diff=lfs merge=lfs -text -*.tar filter=lfs diff=lfs merge=lfs -text -*.tflite filter=lfs diff=lfs merge=lfs -text -*.tgz filter=lfs diff=lfs merge=lfs -text -*.wasm filter=lfs diff=lfs merge=lfs -text -*.xz filter=lfs diff=lfs merge=lfs -text -*.zip filter=lfs diff=lfs merge=lfs -text -*.zst filter=lfs diff=lfs merge=lfs -text -*tfevents* filter=lfs diff=lfs merge=lfs -text +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000000000000000000000000000000000000..ae3bd6fd194f0c35cd6a1ad64165ba12c2e6e11d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,48 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [feature/live-preview] + pull_request: + branches: [feature/live-preview] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + + steps: + - name: Set Actions Allow Unsecure Commands + run: | + echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV + + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Installing my packages + run: yarn install + + - name: Build my App + run: yarn build + env: + NEXT_PUBLIC_BASE_PATH: /chakra-nextjs-pro + - run: yarn export + env: + NEXT_PUBLIC_BASE_PATH: /chakra-nextjs-pro + - run: touch ./out/.nojekyll + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@3.5.9 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: out diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..55b60445c4603da02f52186c54651273890871e8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +node_modules +/node_modules +package-lock.json +yarn.lock +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build +build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +*.pem +.pnpm-debug.log* + +# nextjs +/.next/ +/out/ + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +.idea diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000000000000000000000000000000000..5c6c95870c24158ba1c30aa1214d98d5a11663db --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +legacy-peer-deps=true +auto-install-peers=true +strict-peer-dependencies=false \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..491758bba1c82b85e87cde4718b9e9d07c663f77 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "prettier.singleQuote": true, + "prettier.semi": true, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "typescript.tsdk": "node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..d2a5ebd8982a8299af6742e149a0b1b52147ab1b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [1.0.0] 2023-06-20 + +### Official Release + +Added TypeScript & NextJS diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..131359ab51e343575c826eae71eeb54d328ce010 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Horizon UI + +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. diff --git a/README.md b/README.md index c0fd70e3aa74f2bfb06dfc3ad9dbf693279a643e..234fea13c0fad72f00f792a9a2a3271c5a634458 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,104 @@ +# [Horizon ChatGPT AI Template](https://horizon-ui.com/chatgpt-ai-template) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter)](https://twitter.com/intent/tweet?text=Check%20Horizon%20ChatGPT%20AI%20Template,%20the%20trendiest%20open%20source%20ChatGPT%20AI%20admin%20template%20for%20%23nextjs%20and%20%23react!%0A%0Ahttps%3A//horizon-ui.com/chatgpt-ai-template/%20%20) + +![version](https://img.shields.io/badge/version-1.0.0-brightgreen.svg) +[![GitHub issues open](https://img.shields.io/github/issues/horizon-ui/chatgpt-ai-template.svg?maxAge=2592000)](https://github.com/horizon-ui/chatgpt-ai-template/issues?q=is%3Aopen+is%3Aissue) + +

 

+ +[Horizon UI - Tailwind CSS React Admin dashboard template](https://horizon-ui.com/ai-template) + +

 

+ +Get started and build your dream AI web app with Horizon AI Template, the trendiest & innovative Open-Source Free ChatGPT AI Admin Template for NextJS & React! + --- -title: Hlsitechbot -emoji: 💬 -colorFrom: yellow -colorTo: purple -sdk: gradio -app_file: app.py -pinned: false -license: apache-2.0 + +### Introduction + +Horizon ChatGPT AI Template is the world's best open source OpenAI ChatGPT AI Template made with React, NextJS and Chakra UI! Start creating outstanding Chat AI SaaS Apps faster. + +It comes with over 30+ dark/light frontend individual elements, like buttons, inputs, navbars, nav tabs, cards, or alerts, giving you the freedom of choosing and combining. + +### Documentation + +Each element is well presented in a very complex documentation. You can read more about the documentation here. + +### Quick Start + +Install Horizon ChatGPT AI Template by running either of the following: + +- Install NodeJS LTS from [NodeJs Official Page](https://nodejs.org/en/?ref=horizon-documentation) (NOTE: Product only works with LTS version) + +Clone the repository with the following command: + +```bash +git clone https://github.com/horizon-ui/chatgpt-ai-template.git +``` + +Run in the terminal this command: + +```bash +npm install +``` + +Then run this command to start your local server + +```bash +npm run dev +``` + +### Your API Key is not working? + +- Make sure you have an [OpenAI account](https://platform.openai.com/account) and a valid API key to use ChatGPT. We don't sell API keys. +- Make sure you have your billing info added in [OpenAI Billing page](https://platform.openai.com/account/billing/overview). Without billing info, your API key will not work. +- The app will connect to the OpenAI API server to check if your API Key is working properly. + +### ATTENTION: The model: `GPT-4` does not work yet. +If you are trying to use GPT-4, model it will not work if you don't have access from OpenAI. +Note that even if you have ChatGPT Plus, you still need to request access to the GPT-4 API in order to use it with your API Key. +This is OpenAI's restriction and we can't do anything about it. You can join the waitlist [here](https://openai.com/waitlist/gpt-4-api) . + + +### Example Page + +If you want to get inspiration or just show something directly to your clients, you can jump start your development with our pre-built example page. You will be able to quickly set up the basic structure for your web project. + +View example pages here. + +### Versions + +| Free Version | PRO Version | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [![Horizon ChatGPT AI Template](https://i.ibb.co/Qmym1qt/horizon-ai-template-presentation-image-open-source.png)](https://github.com/horizon-ui/chatgpt-ai-template) | [![Horizon AI Template PRO](https://i.ibb.co/ChL2fvf/horizon-ai-template-presentation-image.png)](https://www.horizon-ui.com/ai-template?ref=readme-horizon-ai-template-free) | + +### Figma Version + +Horizon AI Template is available in Figma format as well! Check Figma +files in your .zip files! 🎨 + +### Reporting Issues + +We use GitHub Issues as the official bug tracker for the Horizon UI. Here are +some advices for our users that want to report an issue: + +1. Make sure that you are using the latest version of the Horizon AI Template. + Check the CHANGELOG from your dashboard on our + [CHANGE LOG File](https://github.com/horizon-ui/chatgpt-ai-template/blob/main/CHANGELOG.md?ref=readme-horizon-ai-template-free). +2. Providing us reproducible steps for the issue will shorten the time it takes + for it to be fixed. +3. Some issues may be browser specific, so specifying in what browser you + encountered the issue might help. + --- -An example chatbot using [Gradio](https://gradio.app), [`huggingface_hub`](https://huggingface.co/docs/huggingface_hub/v0.22.2/en/index), and the [Hugging Face Inference API](https://huggingface.co/docs/api-inference/index). \ No newline at end of file +### Community + +Connect with the community! Feel free to ask questions, report issues, and meet new people that already use Horizon AI Template! + +💬 [Join the #HorizonUI Discord Community!](https://discord.gg/f6tEKFBd4m) + +### Copyright and license + +⭐️ [Copyright 2023 Horizon UI ](https://www.horizon-ui.com/?ref=readme-horizon-ai-template-free) + +📄 [Horizon UI License](https://horizon-ui.notion.site/End-User-License-Agreement-8fb09441ea8c4c08b60c37996195a6d5) diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000000000000000000000000000000000000..2543a77d60dd84ce94a76d7c94f1fb25dca79e04 --- /dev/null +++ b/next.config.js @@ -0,0 +1,19 @@ +/** @type {import('next').NextConfig} */ + +const nextConfig = { + reactStrictMode: false, + swcMinify: true, + basePath: process.env.NEXT_PUBLIC_BASE_PATH, + assetPrefix: process.env.NEXT_PUBLIC_BASE_PATH, + images: { + domains: [ + 'images.unsplash.com', + 'i.ibb.co', + 'scontent.fotp8-1.fna.fbcdn.net', + ], + // Make ENV + unoptimized: true, + }, +}; + +module.exports = nextConfig; diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..90a129b45dcca6b4918629a05f8e5a729e593d63 --- /dev/null +++ b/package.json @@ -0,0 +1,60 @@ +{ + "name": "horizon-ai-template-pro", + "version": "1.0.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@chakra-ui/icons": "^1.1.5", + "@chakra-ui/react": "1.8.9", + "@chakra-ui/system": "^1.12.1", + "@chakra-ui/theme-tools": "^1.3.6", + "@codemirror/legacy-modes": "^6.3.2", + "@emotion/react": "^11.4.1", + "@emotion/styled": "^11.3.0", + "@heroicons/react": "^2.0.17", + "@material-tailwind/react": "^1.4.2", + "@tanstack/react-table": "^8.5.15", + "@testing-library/jest-dom": "^5.14.1", + "@testing-library/react": "^11.2.7", + "@testing-library/user-event": "^12.8.3", + "@uiw/codemirror-theme-tokyo-night": "^4.19.11", + "@uiw/react-codemirror": "^4.19.11", + "babel-cli": "^6.26.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-react": "^6.24.1", + "babel-register": "^6.26.0", + "endent": "^2.1.0", + "eventsource-parser": "^1.0.0", + "framer-motion": "^4.1.17", + "next": "13.2.4", + "react": "18.2.0", + "react-build-sitemap": "^0.2.2", + "react-custom-scrollbars-2": "^4.2.1", + "react-dom": "18.2.0", + "react-icons": "^4.9.0", + "react-is": "^18.0.0", + "react-markdown": "^8.0.6", + "react-router-dom": "^5.3.0", + "react-scripts": "5.0.0", + "remark-gfm": "^3.0.1", + "typescript": "4.9.5", + "web-vitals": "^1.1.2" + }, + "devDependencies": { + "@types/node": "18.15.11", + "@types/react": "18.0.31", + "@types/react-dom": "18.0.11", + "autoprefixer": "^10.4.14", + "eslint": "8.37.0", + "eslint-config-next": "13.2.4", + "eventsource": "^2.0.2", + "postcss": "^8.4.21", + "prettier-plugin-tailwindcss": "^0.2.6", + "tailwindcss": "^3.3.1" + } +} diff --git a/pages/_app.tsx b/pages/_app.tsx new file mode 100644 index 0000000000000000000000000000000000000000..8539071faff3d064ae6dc7a7efc9584f6d562d22 --- /dev/null +++ b/pages/_app.tsx @@ -0,0 +1,76 @@ +'use client'; +import type { AppProps } from 'next/app'; +import { ChakraProvider, Box, Portal, useDisclosure } from '@chakra-ui/react'; +import theme from '@/theme/theme'; +import routes from '@/routes'; +import Sidebar from '@/components/sidebar/Sidebar'; +import Footer from '@/components/footer/FooterAdmin'; +import Navbar from '@/components/navbar/NavbarAdmin'; +import { getActiveRoute, getActiveNavbar } from '@/utils/navigation'; +import { usePathname } from 'next/navigation'; +import { useEffect, useState } from 'react'; +import '@/styles/App.css'; +import '@/styles/Contact.css'; +import '@/styles/Plugins.css'; +import '@/styles/MiniCalendar.css'; + +function App({ Component, pageProps }: AppProps<{}>) { + const pathname = usePathname(); + const [apiKey, setApiKey] = useState(''); + const { isOpen, onOpen, onClose } = useDisclosure(); + useEffect(() => { + const initialKey = localStorage.getItem('apiKey'); + if (initialKey?.includes('sk-') && apiKey !== initialKey) { + setApiKey(initialKey); + } + }, [apiKey]); + + return ( + + + + + + + + + + + + + +