├── .env.example ├── public ├── robots.txt ├── avatar2.png ├── favicon.ico ├── logo192.png ├── logo512.png ├── openai.png ├── openai-dark.png ├── openai-light.png ├── openai-avatar.png ├── manifest.json └── index.html ├── postcss.config.js ├── src ├── fonts │ └── charter_regular-webfont.woff ├── components │ ├── Layouts │ │ ├── main.layouts.js │ │ ├── navbar.layouts.js │ │ └── sidebar.layouts.js │ ├── Dall-E │ │ ├── main.dalle.js │ │ └── image.dalle.js │ ├── ChatGPT │ │ ├── main.chatgpt.js │ │ └── completion.chatgpt.js │ ├── Home │ │ └── main.home.js │ ├── Utilities │ │ ├── octocat.js │ │ ├── information.js │ │ └── modals.js │ ├── Demo │ │ └── main.demo.js │ └── FAQ │ │ └── main.faq.js ├── setupTests.js ├── App.test.js ├── reportWebVitals.js ├── index.js ├── App.css ├── example.js ├── App.js ├── logo.svg └── index.css ├── tailwind.config.js ├── .gitignore ├── package.json └── README.md /.env.example: -------------------------------------------------------------------------------- 1 | REACT_APP_API_KEY="" 2 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/avatar2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/public/avatar2.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/public/logo512.png -------------------------------------------------------------------------------- /public/openai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/public/openai.png -------------------------------------------------------------------------------- /public/openai-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/public/openai-dark.png -------------------------------------------------------------------------------- /public/openai-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/public/openai-light.png -------------------------------------------------------------------------------- /public/openai-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/public/openai-avatar.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /src/fonts/charter_regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armandwipangestu/openai-project/HEAD/src/fonts/charter_regular-webfont.woff -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ["./src/**/*.{js,jsx,ts,tsx}"], 4 | theme: { 5 | extend: {}, 6 | }, 7 | plugins: [], 8 | }; 9 | -------------------------------------------------------------------------------- /src/components/Layouts/main.layouts.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const MainLayouts = ({ children }) => { 4 | return {children}; 5 | }; 6 | 7 | export default MainLayouts; 8 | -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /.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 17 | .env.local 18 | .env.development.local 19 | .env.test.local 20 | .env.production.local 21 | 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/components/Dall-E/main.dalle.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Image from "./image.dalle"; 3 | 4 | const Dalle = (props) => { 5 | return ( 6 | 7 |
8 |

9 | OpenAI - {props.title} 10 |

11 |

12 | {props.description} 13 |

14 |
15 | 16 |
17 | ); 18 | }; 19 | 20 | export default Dalle; 21 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot(document.getElementById('root')); 8 | root.render( 9 | 10 | 11 | 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/components/ChatGPT/main.chatgpt.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Completion from "./completion.chatgpt"; 3 | 4 | const Chatgpt = (props) => { 5 | return ( 6 | 7 |
8 |

9 | OpenAI - {props.title} 10 |

11 |

12 | {props.description} 13 |

14 |
15 | 16 |
17 | ); 18 | }; 19 | 20 | export default Chatgpt; 21 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/components/Home/main.home.js: -------------------------------------------------------------------------------- 1 | import { NavLink } from "react-router-dom"; 2 | 3 | const Home = (props) => { 4 | return ( 5 |
6 |

7 | {props.title} 8 |

9 |

10 | {props.description} 11 |

12 | 13 | 20 | 21 |
22 | ); 23 | }; 24 | 25 | export default Home; 26 | -------------------------------------------------------------------------------- /src/example.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import { Configuration, OpenAIApi } from "openai"; 3 | import "./App.css"; 4 | 5 | const App = () => { 6 | const [prompt, setPrompt] = useState(""); 7 | const [result, setResult] = useState(""); 8 | const configuration = new Configuration({ 9 | apiKey: process.env.REACT_APP_API_KEY, 10 | }); 11 | 12 | // useEffect(() => { 13 | // generateImage(); 14 | // }, []); 15 | 16 | const openai = new OpenAIApi(configuration); 17 | 18 | const generateImage = async () => { 19 | const res = await openai.createImage({ 20 | prompt: prompt, 21 | n: 1, 22 | size: "1024x1024", 23 | }); 24 | setResult(res.data.data[0].url); 25 | }; 26 | 27 | return ( 28 | <> 29 |