Skip to content

Commit fb66828

Browse files
committed
chore: add nextjs app router app
1 parent f7acad3 commit fb66828

18 files changed

+361
-13
lines changed

apps/next-app-router/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

apps/next-app-router/.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

apps/next-app-router/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

apps/next-app-router/app/favicon.ico

25.3 KB
Binary file not shown.

apps/next-app-router/app/globals.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
:root {
6+
--foreground-rgb: 0, 0, 0;
7+
--background-start-rgb: 214, 219, 220;
8+
--background-end-rgb: 255, 255, 255;
9+
}
10+
11+
@media (prefers-color-scheme: dark) {
12+
:root {
13+
--foreground-rgb: 255, 255, 255;
14+
--background-start-rgb: 0, 0, 0;
15+
--background-end-rgb: 0, 0, 0;
16+
}
17+
}
18+
19+
body {
20+
color: rgb(var(--foreground-rgb));
21+
background: linear-gradient(
22+
to bottom,
23+
transparent,
24+
rgb(var(--background-end-rgb))
25+
)
26+
rgb(var(--background-start-rgb));
27+
}
28+
29+
@layer utilities {
30+
.text-balance {
31+
text-wrap: balance;
32+
}
33+
}

apps/next-app-router/app/layout.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { Metadata } from 'next'
2+
import { Inter } from 'next/font/google'
3+
import './globals.css'
4+
5+
const inter = Inter({ subsets: ['latin'] })
6+
7+
export const metadata: Metadata = {
8+
title: 'Create Next App',
9+
description: 'Generated by create next app',
10+
}
11+
12+
export default function RootLayout({
13+
children,
14+
}: Readonly<{
15+
children: React.ReactNode
16+
}>) {
17+
return (
18+
<html lang="en">
19+
<body className={inter.className}>{children}</body>
20+
</html>
21+
)
22+
}

apps/next-app-router/app/page.tsx

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import Image from 'next/image'
2+
3+
export default function Home() {
4+
return (
5+
<main className="flex min-h-screen flex-col items-center justify-between p-24">
6+
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">
7+
<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">
8+
Get started by editing&nbsp;
9+
<code className="font-mono font-bold">app/page.tsx</code>
10+
</p>
11+
<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:size-auto lg:bg-none">
12+
<a
13+
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
14+
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
15+
target="_blank"
16+
rel="noopener noreferrer"
17+
>
18+
By
19+
{' '}
20+
<Image
21+
src="/vercel.svg"
22+
alt="Vercel Logo"
23+
className="dark:invert"
24+
width={100}
25+
height={24}
26+
priority
27+
/>
28+
</a>
29+
</div>
30+
</div>
31+
32+
<div className="relative z-[-1] flex place-items-center before:absolute before:h-[300px] before:w-full 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-full 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 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 sm:before:w-[480px] sm:after:w-[240px] before:lg:h-[360px]">
33+
<Image
34+
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
35+
src="/next.svg"
36+
alt="Next.js Logo"
37+
width={180}
38+
height={37}
39+
priority
40+
/>
41+
</div>
42+
43+
<div className="mb-32 grid text-center lg:mb-0 lg:w-full lg:max-w-5xl lg:grid-cols-4 lg:text-left">
44+
<a
45+
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
46+
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"
47+
target="_blank"
48+
rel="noopener noreferrer"
49+
>
50+
<h2 className="mb-3 text-2xl font-semibold">
51+
Docs
52+
{' '}
53+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
54+
-&gt;
55+
</span>
56+
</h2>
57+
<p className="m-0 max-w-[30ch] text-sm opacity-50">
58+
Find in-depth information about Next.js features and API.
59+
</p>
60+
</a>
61+
62+
<a
63+
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
64+
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"
65+
target="_blank"
66+
rel="noopener noreferrer"
67+
>
68+
<h2 className="mb-3 text-2xl font-semibold">
69+
Learn
70+
{' '}
71+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
72+
-&gt;
73+
</span>
74+
</h2>
75+
<p className="m-0 max-w-[30ch] text-sm opacity-50">
76+
Learn about Next.js in an interactive course with&nbsp;quizzes!
77+
</p>
78+
</a>
79+
80+
<a
81+
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
82+
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"
83+
target="_blank"
84+
rel="noopener noreferrer"
85+
>
86+
<h2 className="mb-3 text-2xl font-semibold">
87+
Templates
88+
{' '}
89+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
90+
-&gt;
91+
</span>
92+
</h2>
93+
<p className="m-0 max-w-[30ch] text-sm opacity-50">
94+
Explore starter templates for Next.js.
95+
</p>
96+
</a>
97+
98+
<a
99+
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
100+
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"
101+
target="_blank"
102+
rel="noopener noreferrer"
103+
>
104+
<h2 className="mb-3 text-2xl font-semibold">
105+
Deploy
106+
{' '}
107+
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
108+
-&gt;
109+
</span>
110+
</h2>
111+
<p className="m-0 max-w-[30ch] text-balance 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+
}

apps/next-app-router/next.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import utwm from 'unplugin-tailwindcss-mangle/webpack'
2+
3+
/** @type {import('next').NextConfig} */
4+
const nextConfig = {
5+
webpack: (config) => {
6+
config.plugins.push(utwm({
7+
classMapOutput: true,
8+
}))
9+
return config
10+
},
11+
}
12+
13+
export default nextConfig

apps/next-app-router/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "next-app-router",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint",
10+
"tw-extract": "tw-patch extract"
11+
},
12+
"dependencies": {
13+
"next": "14.2.5",
14+
"react": "^18",
15+
"react-dom": "^18"
16+
},
17+
"devDependencies": {
18+
"@types/node": "^20",
19+
"@types/react": "^18",
20+
"@types/react-dom": "^18",
21+
"eslint": "^8",
22+
"eslint-config-next": "14.2.5",
23+
"postcss": "^8",
24+
"tailwindcss": "^3.4.1",
25+
"typescript": "^5"
26+
}
27+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('postcss-load-config').Config} */
2+
const config = {
3+
plugins: {
4+
tailwindcss: {},
5+
},
6+
}
7+
8+
export default config

0 commit comments

Comments
 (0)