init
Browse files- README.md +5 -1
- app/layout.tsx +0 -21
- app/page.tsx +0 -8
- next.config.js +3 -1
- package-lock.json +2 -2
- package.json +1 -1
- pages/_app.tsx +6 -0
- pages/_document.tsx +13 -0
- pages/api/hello.ts +13 -0
- pages/index.tsx +118 -0
- {app β public}/favicon.ico +0 -0
- public/next.svg +1 -0
- public/vercel.svg +1 -0
- {app β styles}/globals.css +0 -0
- tsconfig.json +1 -6
README.md
CHANGED
@@ -14,7 +14,11 @@ pnpm dev
|
|
14 |
|
15 |
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
16 |
|
17 |
-
You can start editing the page by modifying `
|
|
|
|
|
|
|
|
|
18 |
|
19 |
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
20 |
|
|
|
14 |
|
15 |
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
16 |
|
17 |
+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
|
18 |
+
|
19 |
+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
|
20 |
+
|
21 |
+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
22 |
|
23 |
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
24 |
|
app/layout.tsx
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
import './globals.css'
|
2 |
-
import { Inter } from 'next/font/google'
|
3 |
-
|
4 |
-
const inter = Inter({ subsets: ['latin'] })
|
5 |
-
|
6 |
-
export const metadata = {
|
7 |
-
title: 'Create Next App',
|
8 |
-
description: 'Generated by create next app',
|
9 |
-
}
|
10 |
-
|
11 |
-
export default function RootLayout({
|
12 |
-
children,
|
13 |
-
}: {
|
14 |
-
children: React.ReactNode
|
15 |
-
}) {
|
16 |
-
return (
|
17 |
-
<html lang="en">
|
18 |
-
<body className={inter.className}>{children}</body>
|
19 |
-
</html>
|
20 |
-
)
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/page.tsx
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
|
2 |
-
export default function Home() {
|
3 |
-
return (
|
4 |
-
<main className="flex min-h-screen flex-col items-center justify-between p-24">
|
5 |
-
{/* <SearchPanel/> */}
|
6 |
-
</main>
|
7 |
-
)
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next.config.js
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
/** @type {import('next').NextConfig} */
|
2 |
-
const nextConfig = {
|
|
|
|
|
3 |
|
4 |
module.exports = nextConfig
|
|
|
1 |
/** @type {import('next').NextConfig} */
|
2 |
+
const nextConfig = {
|
3 |
+
reactStrictMode: true,
|
4 |
+
}
|
5 |
|
6 |
module.exports = nextConfig
|
package-lock.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
{
|
2 |
-
"name": "
|
3 |
"version": "0.1.0",
|
4 |
"lockfileVersion": 3,
|
5 |
"requires": true,
|
6 |
"packages": {
|
7 |
"": {
|
8 |
-
"name": "
|
9 |
"version": "0.1.0",
|
10 |
"dependencies": {
|
11 |
"@types/node": "20.2.3",
|
|
|
1 |
{
|
2 |
+
"name": "my-app",
|
3 |
"version": "0.1.0",
|
4 |
"lockfileVersion": 3,
|
5 |
"requires": true,
|
6 |
"packages": {
|
7 |
"": {
|
8 |
+
"name": "my-app",
|
9 |
"version": "0.1.0",
|
10 |
"dependencies": {
|
11 |
"@types/node": "20.2.3",
|
package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"name": "
|
3 |
"version": "0.1.0",
|
4 |
"private": true,
|
5 |
"scripts": {
|
|
|
1 |
{
|
2 |
+
"name": "my-app",
|
3 |
"version": "0.1.0",
|
4 |
"private": true,
|
5 |
"scripts": {
|
pages/_app.tsx
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import '@/styles/globals.css'
|
2 |
+
import type { AppProps } from 'next/app'
|
3 |
+
|
4 |
+
export default function App({ Component, pageProps }: AppProps) {
|
5 |
+
return <Component {...pageProps} />
|
6 |
+
}
|
pages/_document.tsx
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Html, Head, Main, NextScript } from 'next/document'
|
2 |
+
|
3 |
+
export default function Document() {
|
4 |
+
return (
|
5 |
+
<Html lang="en">
|
6 |
+
<Head />
|
7 |
+
<body>
|
8 |
+
<Main />
|
9 |
+
<NextScript />
|
10 |
+
</body>
|
11 |
+
</Html>
|
12 |
+
)
|
13 |
+
}
|
pages/api/hello.ts
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
2 |
+
import type { NextApiRequest, NextApiResponse } from 'next'
|
3 |
+
|
4 |
+
type Data = {
|
5 |
+
name: string
|
6 |
+
}
|
7 |
+
|
8 |
+
export default function handler(
|
9 |
+
req: NextApiRequest,
|
10 |
+
res: NextApiResponse<Data>
|
11 |
+
) {
|
12 |
+
res.status(200).json({ name: 'John Doe' })
|
13 |
+
}
|
pages/index.tsx
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import Image from 'next/image'
|
2 |
+
import { Inter } from 'next/font/google'
|
3 |
+
|
4 |
+
const inter = Inter({ subsets: ['latin'] })
|
5 |
+
|
6 |
+
export default function Home() {
|
7 |
+
return (
|
8 |
+
<main
|
9 |
+
className={`flex min-h-screen flex-col items-center justify-between p-24 ${inter.className}`}
|
10 |
+
>
|
11 |
+
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
|
12 |
+
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
|
13 |
+
Get started by editing
|
14 |
+
<code className="font-mono font-bold">pages/index.tsx</code>
|
15 |
+
</p>
|
16 |
+
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:h-auto lg:w-auto lg:bg-none">
|
17 |
+
<a
|
18 |
+
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
|
19 |
+
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
|
20 |
+
target="_blank"
|
21 |
+
rel="noopener noreferrer"
|
22 |
+
>
|
23 |
+
By{' '}
|
24 |
+
<Image
|
25 |
+
src="/vercel.svg"
|
26 |
+
alt="Vercel Logo"
|
27 |
+
className="dark:invert"
|
28 |
+
width={100}
|
29 |
+
height={24}
|
30 |
+
priority
|
31 |
+
/>
|
32 |
+
</a>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700/10 after:dark:from-sky-900 after:dark:via-[#0141ff]/40 before:lg:h-[360px]">
|
37 |
+
<Image
|
38 |
+
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
|
39 |
+
src="/next.svg"
|
40 |
+
alt="Next.js Logo"
|
41 |
+
width={180}
|
42 |
+
height={37}
|
43 |
+
priority
|
44 |
+
/>
|
45 |
+
</div>
|
46 |
+
|
47 |
+
<div className="mb-32 grid text-center lg:mb-0 lg:grid-cols-4 lg:text-left">
|
48 |
+
<a
|
49 |
+
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
|
50 |
+
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
51 |
+
target="_blank"
|
52 |
+
rel="noopener noreferrer"
|
53 |
+
>
|
54 |
+
<h2 className={`mb-3 text-2xl font-semibold`}>
|
55 |
+
Docs{' '}
|
56 |
+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
57 |
+
->
|
58 |
+
</span>
|
59 |
+
</h2>
|
60 |
+
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
61 |
+
Find in-depth information about Next.js features and API.
|
62 |
+
</p>
|
63 |
+
</a>
|
64 |
+
|
65 |
+
<a
|
66 |
+
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
|
67 |
+
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
68 |
+
target="_blank"
|
69 |
+
rel="noopener noreferrer"
|
70 |
+
>
|
71 |
+
<h2 className={`mb-3 text-2xl font-semibold`}>
|
72 |
+
Learn{' '}
|
73 |
+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
74 |
+
->
|
75 |
+
</span>
|
76 |
+
</h2>
|
77 |
+
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
78 |
+
Learn about Next.js in an interactive course with quizzes!
|
79 |
+
</p>
|
80 |
+
</a>
|
81 |
+
|
82 |
+
<a
|
83 |
+
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
|
84 |
+
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
85 |
+
target="_blank"
|
86 |
+
rel="noopener noreferrer"
|
87 |
+
>
|
88 |
+
<h2 className={`mb-3 text-2xl font-semibold`}>
|
89 |
+
Templates{' '}
|
90 |
+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
91 |
+
->
|
92 |
+
</span>
|
93 |
+
</h2>
|
94 |
+
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
95 |
+
Discover and deploy boilerplate example Next.js projects.
|
96 |
+
</p>
|
97 |
+
</a>
|
98 |
+
|
99 |
+
<a
|
100 |
+
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
|
101 |
+
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
|
102 |
+
target="_blank"
|
103 |
+
rel="noopener noreferrer"
|
104 |
+
>
|
105 |
+
<h2 className={`mb-3 text-2xl font-semibold`}>
|
106 |
+
Deploy{' '}
|
107 |
+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
|
108 |
+
->
|
109 |
+
</span>
|
110 |
+
</h2>
|
111 |
+
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
|
112 |
+
Instantly deploy your Next.js site to a shareable URL with Vercel.
|
113 |
+
</p>
|
114 |
+
</a>
|
115 |
+
</div>
|
116 |
+
</main>
|
117 |
+
)
|
118 |
+
}
|
{app β public}/favicon.ico
RENAMED
File without changes
|
public/next.svg
ADDED
public/vercel.svg
ADDED
{app β styles}/globals.css
RENAMED
File without changes
|
tsconfig.json
CHANGED
@@ -14,15 +14,10 @@
|
|
14 |
"isolatedModules": true,
|
15 |
"jsx": "preserve",
|
16 |
"incremental": true,
|
17 |
-
"plugins": [
|
18 |
-
{
|
19 |
-
"name": "next"
|
20 |
-
}
|
21 |
-
],
|
22 |
"paths": {
|
23 |
"@/*": ["./*"]
|
24 |
}
|
25 |
},
|
26 |
-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"
|
27 |
"exclude": ["node_modules"]
|
28 |
}
|
|
|
14 |
"isolatedModules": true,
|
15 |
"jsx": "preserve",
|
16 |
"incremental": true,
|
|
|
|
|
|
|
|
|
|
|
17 |
"paths": {
|
18 |
"@/*": ["./*"]
|
19 |
}
|
20 |
},
|
21 |
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
22 |
"exclude": ["node_modules"]
|
23 |
}
|