Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mayooear committed Mar 5, 2023
1 parent 6c41006 commit 601ba2b
Show file tree
Hide file tree
Showing 24 changed files with 3,273 additions and 2,253 deletions.
1 change: 1 addition & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENAI_API_KEY=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# local env files
.env*.local
.env

# vercel
.vercel
Expand Down
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
23 changes: 23 additions & 0 deletions components/LoadingDots.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import styles from '../styles/loading-dots.module.css';

const LoadingDots = ({
color = '#000',
style = 'small',
}: {
color: string;
style: string;
}) => {
return (
<span className={style == 'small' ? styles.loading2 : styles.loading}>
<span style={{ backgroundColor: color }} />
<span style={{ backgroundColor: color }} />
<span style={{ backgroundColor: color }} />
</span>
);
};

export default LoadingDots;

LoadingDots.defaultProps = {
style: 'small',
};
38 changes: 33 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
{
"name": "notion-langchain-js",
"name": "next-openai-typescript-starter",
"version": "0.1.0",
"private": true,
"license": "MIT",
"author": "Mayo",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"type-check": "tsc --noEmit",
"lint": "eslint --ignore-path .gitignore \"**/*.+(ts|js|tsx)\"",
"format": "prettier --ignore-path .gitignore \"**/*.+(ts|js|tsx)\" --write"
},
"dependencies": {
"@headlessui/react": "^1.7.13",
"@headlessui/tailwindcss": "^0.1.2",
"@heroicons/react": "^2.0.16",
"@vercel/analytics": "^0.1.11",
"next": "13.2.3",
"openai": "^3.2.1",
"react": "18.2.0",
"react-dom": "18.2.0"
"react-dom": "18.2.0",
"react-hot-toast": "^2.4.0"
},
"devDependencies": {
"@types/node": "^18.14.6",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"autoprefixer": "^10.4.13",
"eslint": "8.35.0",
"eslint-config-next": "13.2.3"
}
"eslint-config-next": "13.2.3",
"postcss": "^8.4.21",
"prettier": "^2.8.4",
"tailwindcss": "^3.2.7",
"tsx": "^3.12.3",
"typescript": "^4.9.5"
},
"keywords": [
"starter",
"typescript",
"nextjs",
"langchain",
"openai"
]
}
7 changes: 0 additions & 7 deletions pages/_app.js

This file was deleted.

22 changes: 22 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import '@/styles/base.css';
import type { AppProps } from 'next/app';
import { Analytics } from '@vercel/analytics/react';
import { Inter } from 'next/font/google';

const inter = Inter({
variable: '--font-inter',
subsets: ['latin'],
});

function MyApp({ Component, pageProps }: AppProps) {
return (
<>
<main className={inter.variable}>
<Component {...pageProps} />
<Analytics />
</main>
</>
);
}

export default MyApp;
13 changes: 13 additions & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Html, Head, Main, NextScript } from "next/document";

export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
5 changes: 0 additions & 5 deletions pages/api/hello.js

This file was deleted.

13 changes: 13 additions & 0 deletions pages/api/hello.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next';

type Data = {
name: string;
};

export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>,
) {
res.status(200).json({ name: `John Doe` });
}
69 changes: 0 additions & 69 deletions pages/index.js

This file was deleted.

82 changes: 82 additions & 0 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import Head from 'next/head';
import Image from 'next/image';

export default function Home() {
return (
<div className="flex min-h-screen flex-col items-center justify-center py-2">
<Head>
<title>Create Next App</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<main className="flex w-full flex-1 flex-col items-center justify-center px-20 text-center">
<h1 className="text-6xl font-bold">
Welcome to{' '}
<a className="text-blue-600" href="https://nextjs.org">
Next.js!
</a>
</h1>

<p className="mt-3 text-2xl">
Get started by editing{' '}
<code className="rounded-md bg-gray-100 p-3 font-mono text-lg">
pages/index.tsx
</code>
</p>

<div className="mt-6 flex max-w-4xl flex-wrap items-center justify-around sm:w-full">
<a
href="https://nextjs.org/docs"
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Documentation &rarr;</h3>
<p className="mt-4 text-xl">
Find in-depth information about Next.js features and its API.
</p>
</a>

<a
href="https://nextjs.org/learn"
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Learn &rarr;</h3>
<p className="mt-4 text-xl">
Learn about Next.js in an interactive course with quizzes!
</p>
</a>

<a
href="https://github.com/vercel/next.js/tree/canary/examples"
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Examples &rarr;</h3>
<p className="mt-4 text-xl">
Discover and deploy boilerplate example Next.js projects.
</p>
</a>

<a
href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Deploy &rarr;</h3>
<p className="mt-4 text-xl">
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>

<footer className="flex h-24 w-full items-center justify-center border-t">
<a
className="flex items-center justify-center gap-2"
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</a>
</footer>
</div>
);
}
Loading

0 comments on commit 601ba2b

Please sign in to comment.