Skip to content

Commit

Permalink
feat: setup Next.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai committed Sep 11, 2024
1 parent 22a9ea7 commit 2bbf7fb
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .knosys/sites/default/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}
23 changes: 23 additions & 0 deletions .knosys/sites/default/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
11 changes: 0 additions & 11 deletions .knosys/sites/default/index.html

This file was deleted.

4 changes: 4 additions & 0 deletions .knosys/sites/default/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
27 changes: 27 additions & 0 deletions .knosys/sites/default/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@openbuild/web3-frontend-bootcamp-website",
"version": "0.0.0",
"private": true,
"dependencies": {
"react": "^18",
"react-dom": "^18",
"next": "14.2.9"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"eslint": "^8",
"eslint-config-next": "14.2.9"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"gen": "next export"
}
}
8 changes: 8 additions & 0 deletions .knosys/sites/default/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

export default config;
Binary file added .knosys/sites/default/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .knosys/sites/default/public/favicon.ico
Binary file not shown.
Binary file added .knosys/sites/default/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions .knosys/sites/default/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--background: #ffffff;
--foreground: #171717;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
21 changes: 21 additions & 0 deletions .knosys/sites/default/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Metadata } from "next";
import "./globals.css";

export const metadata: Metadata = {
title: 'OpenBuild Web3 前端训练营',
description: 'Help more front-end developers dive into Web3 world smoothly.',
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="zh-CN" dir="ltr">
<body>
{children}
</body>
</html>
);
}
11 changes: 11 additions & 0 deletions .knosys/sites/default/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Image from "next/image";
import poster from './poster.jpg';

export default function Home() {
return (
<div className="flex flex-col items-center">
<Image className="w-full max-w-5xl mt-10" src={poster} alt="宣传图" />
<p className="mt-6 text-4xl">😚 敬请期待 😚</p>
</div>
);
}
Binary file added .knosys/sites/default/src/app/poster.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions .knosys/sites/default/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Config } from "tailwindcss";

const config: Config = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
colors: {
background: "var(--background)",
foreground: "var(--foreground)",
},
},
},
plugins: [],
};
export default config;
26 changes: 26 additions & 0 deletions .knosys/sites/default/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

0 comments on commit 2bbf7fb

Please sign in to comment.