├── .eslintrc.json ├── .github └── preview.png ├── src └── app │ ├── favicon.ico │ ├── layout.tsx │ ├── globals.css │ └── page.tsx ├── postcss.config.js ├── next.config.js ├── .gitignore ├── tailwind.config.js ├── public ├── plus.svg ├── nextMark.svg └── next.svg ├── package.json ├── tsconfig.json └── README.md /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /.github/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrainCord/nextjs-template/HEAD/.github/preview.png -------------------------------------------------------------------------------- /src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrainCord/nextjs-template/HEAD/src/app/favicon.ico -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | output: 'export', 4 | reactStrictMode: true, 5 | images: { 6 | unoptimized: true, 7 | }, 8 | trailingSlash: true, 9 | } 10 | 11 | module.exports = nextConfig 12 | -------------------------------------------------------------------------------- /src/app/layout.tsx: -------------------------------------------------------------------------------- 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 | 18 | {children} 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /.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 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env*.local 29 | 30 | # vercel 31 | .vercel 32 | 33 | # typescript 34 | *.tsbuildinfo 35 | next-env.d.ts 36 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}', 5 | './src/components/**/*.{js,ts,jsx,tsx,mdx}', 6 | './src/app/**/*.{js,ts,jsx,tsx,mdx}', 7 | ], 8 | theme: { 9 | extend: { 10 | backgroundImage: { 11 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', 12 | 'gradient-conic': 13 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', 14 | }, 15 | }, 16 | }, 17 | plugins: [], 18 | } 19 | -------------------------------------------------------------------------------- /public/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "next-template", 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 | }, 11 | "dependencies": { 12 | "@types/node": "20.1.4", 13 | "@types/react": "18.2.6", 14 | "@types/react-dom": "18.2.4", 15 | "autoprefixer": "10.4.14", 16 | "eslint": "8.40.0", 17 | "eslint-config-next": "13.4.2", 18 | "next": "13.4.2", 19 | "postcss": "8.4.23", 20 | "react": "18.2.0", 21 | "react-dom": "18.2.0", 22 | "tailwindcss": "3.3.2", 23 | "typescript": "5.0.4" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/app/globals.css: -------------------------------------------------------------------------------- 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 | html { 20 | height: 100vh; 21 | } 22 | 23 | body { 24 | height: 100vh; 25 | color: rgb(var(--foreground-rgb)); 26 | background: linear-gradient( 27 | to bottom, 28 | transparent, 29 | rgb(var(--background-end-rgb)) 30 | ) 31 | rgb(var(--background-start-rgb)); 32 | } 33 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "noEmit": true, 10 | "esModuleInterop": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "jsx": "preserve", 16 | "incremental": true, 17 | "plugins": [ 18 | { 19 | "name": "next" 20 | } 21 | ], 22 | "paths": { 23 | "@/*": ["./src/*"] 24 | } 25 | }, 26 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 27 | "exclude": ["node_modules"] 28 | } 29 | -------------------------------------------------------------------------------- /public/nextMark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/page.tsx: -------------------------------------------------------------------------------- 1 | import Image from 'next/image' 2 | 3 | export default function Home() { 4 | return ( 5 |
6 |
7 | Fleek Logo 14 | add 20 | Next Logo 28 |
29 | 30 |

31 | This is a template for creating a Next.js site and deploying it on Fleek. 32 |

33 | 34 | 67 |
68 | ) 69 | } 70 | 71 | type CardProps = { 72 | title: string; 73 | body: string; 74 | href: string; 75 | icon: string; 76 | width: number; 77 | } 78 | 79 | const Card = ({ title, width, body, href, icon }: CardProps) => { 80 | return ( 81 |
  • 82 | 83 |
    84 | card-icon 90 |

    91 | {title} 92 |

    93 |
    94 |

    95 | {body} 96 |

    97 |
    98 |
  • 99 | ) 100 | } 101 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Next.js + Fleek Starter Kit 2 | 3 | ![image](https://github.com/fleekxyz/nextjs-template/assets/55561695/ecee3337-3dee-4543-a18b-57151cb18448) 4 | 5 | ## 🚀 Project Structure 6 | 7 | Inside of your Next.js project, you'll see the following folders and files: 8 | 9 | ``` 10 | / 11 | ├── public/ 12 | │ └── favicon.svg 13 | ├── src/ 14 | │ └── app/ 15 | │ ├── favicon.ico 16 | │ ├── globals.css 17 | │ ├── layout.tsx 18 | │ └── page.tsx 19 | ├── next.config.js 20 | ├── tailwind.config.js 21 | ├── tsconfig.json 22 | └── package.json 23 | ``` 24 | 25 | If you want to lern more about the `app` router you can checkout [Next.js documentation](https://nextjs.org/docs/app/building-your-application/routing#the-app-directory). 26 | 27 | Any static assets, like images, can be placed in the `public/` directory. 28 | 29 | 30 | ## 🧞 Commands 31 | 32 | All commands are run from the root of the project, from a terminal: 33 | 34 | | Command | Action | 35 | | :--------------------- | :----------------------------------------------- | 36 | | `pnpm install` | Installs dependencies | 37 | | `pnpm run dev` | Starts local dev server at `localhost:3000` | 38 | | `pnpm run build` | Build your production site to `./out/` | 39 | | `pnpm run start` | Preview your build locally, before deploying | 40 | | `pnpm run lint ...` | Run Linter | 41 | 42 | ## ⚡ How to deploy to Fleek 43 | 44 | ### 1. Create a `fleek.json` config file: 45 | You can configure this site deployment using [Fleek CLI]() and running: 46 | ``` 47 | > fleek sites init 48 | WARN! Fleek CLI is in beta phase, use it under your own responsibility 49 | ? Choose one of the existing sites or create a new one. › 50 | ❯ Create a new site 51 | ``` 52 | It will prompt you for a `name`, `dist` directory location & `build command` 53 | - `name`: How you want to name the site 54 | - `dist`: The output directory where the site is located, for this template it's `out` 55 | - `build command`: Command to build your site, this will be used to deploy the latest version either by CLI or Github Actions 56 | 57 | ### 2. Deploy the site 58 | After configuiring your `fleek.json` file, you can deployt the site by running 59 | 60 | ``` 61 | fleek sites deploy 62 | ``` 63 | After running it you will get an output like this: 64 | ``` 65 | WARN! Fleek CLI is in beta, use it at your own discretion 66 | > Success! Deployed! 67 | > Site IPFS CID: QmP1nDyoHqSrRabwUSrxRV3DJqiKH7b9t1tpLcr1NTkm1M 68 | 69 | > You can visit through the gateway: 70 | > https://ipfs.io/ipfs/QmP1nDyoHqSrRabwUSrxRV3DJqiKH7b9t1tpLcr1NTkm1M 71 | ``` 72 | 73 | ### Extra features 74 | - **Continuous Integration (CI):** `fleek sites ci` [Documentation.](https://docs.fleek.xyz/services/sites/#continuous-integration-ci) 75 | - **Adding custom domains:** `fleek domains create` [Documentation.](https://docs.fleek.xyz/services/domains/) 76 | 77 | 78 | ### Keep in mind: 79 | 80 | This template has been configured to produce a static output. 81 | 82 | ```js 83 | /** @type {import('next').NextConfig} */ 84 | const nextConfig = { 85 | output: 'export', 86 | reactStrictMode: true, 87 | images: { 88 | unoptimized: true, 89 | }, 90 | trailingSlash: true, 91 | } 92 | 93 | module.exports = nextConfig 94 | 95 | ``` 96 | 97 | You can find more information about static builds in [Next Documentation](https://nextjs.org/docs/app/building-your-application/deploying/static-exports#configuration) 98 | 99 | 100 | ## 👀 Want to learn more? 101 | 102 | Feel free to check [Next.js documentation](https://nextjs.org/docs) or jump into Next.js [learning platform](https://nextjs.org/learn/foundations/about-nextjs?utm_source=next-site&utm_medium=nav-cta&utm_campaign=next-website). 103 | 104 | --------------------------------------------------------------------------------