Browse Source

Initial commit

- bottom nav
main
sipp11 3 years ago
commit
b6b197a3db
  1. 12
      .babelrc
  2. 2
      .eslintignore
  3. 86
      .eslintrc
  4. 1
      .github/FUNDING.yml
  5. 35
      .gitignore
  6. 5
      .husky/pre-commit
  7. 11
      .vscode/extensions.json
  8. 31
      .vscode/launch.json
  9. 25
      .vscode/settings.json
  10. 21
      .vscode/tasks.json
  11. 21
      LICENSE
  12. 157
      README.md
  13. 5
      lint-staged.config.js
  14. 3
      netlify.toml
  15. 5
      next-env.d.ts
  16. 14
      next.config.js
  17. 4117
      package-lock.json
  18. 53
      package.json
  19. 10
      postcss.config.js
  20. BIN
      public/apple-touch-icon.png
  21. BIN
      public/assets/images/nextjs-starter-banner.png
  22. BIN
      public/favicon-16x16.png
  23. BIN
      public/favicon-32x32.png
  24. BIN
      public/favicon.ico
  25. 95
      src/components/BottomNav.tsx
  26. 26
      src/components/SidebarNav.tsx
  27. 66
      src/layout/Meta.tsx
  28. 9
      src/pages/_app.tsx
  29. 20
      src/pages/_document.tsx
  30. 79
      src/pages/about.tsx
  31. 26
      src/pages/blank.tsx
  32. 186
      src/pages/index.tsx
  33. 21
      src/styles/global.css
  34. 20
      src/templates/Main.tsx
  35. 6
      src/utils/AppConfig.ts
  36. 45
      tailwind.config.js
  37. 46
      tsconfig.json

12
.babelrc

@ -0,0 +1,12 @@
{
"presets": [
[
"next/babel",
{
"styled-jsx": {
"plugins": ["styled-jsx-plugin-postcss"]
}
}
]
]
}

2
.eslintignore

@ -0,0 +1,2 @@
node_modules
out

86
.eslintrc

@ -0,0 +1,86 @@
{
// Configuration for JavaScript files
"extends": [
"airbnb-base",
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true
}
]
},
"overrides": [
// Configuration for TypeScript files
{
"files": [
"**/*.ts",
"**/*.tsx"
],
"plugins": [
"@typescript-eslint",
"unused-imports"
],
"extends": [
"airbnb-typescript",
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true
}
],
"react/destructuring-assignment": "off", // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
"jsx-a11y/anchor-is-valid": "off", // Next.js use his own internal link system
"react/require-default-props": "off", // Allow non-defined react props as undefined
"react/jsx-props-no-spreading": "off", // _app.tsx uses spread operator and also, react-hook-form
"@next/next/no-img-element": "off", // We currently not using next/image because it isn't supported with SSG mode
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal"
],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": [
"react"
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"@typescript-eslint/comma-dangle": "off", // Avoid conflict rule between Eslint and Prettier
"import/prefer-default-export": "off", // Named export is easier to refactor automatically
"class-methods-use-this": "off", // _document.tsx use render method without `this` keyword
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
]
}
}
]
}

1
.github/FUNDING.yml

@ -0,0 +1 @@
custom: ['https://creativedesignsguru.com/category/nextjs/', 'https://www.buymeacoffee.com/ixartz']

35
.gitignore vendored

@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next
/out
# production
/build
# misc
.DS_Store
*.pem
Thumbs.db
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# dotenv local files
.env*.local
# local folder
local
# vercel
.vercel

5
.husky/pre-commit

@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# Disable concurent to run build-types after ESLint in lint-staged
npx lint-staged --concurrent false

11
.vscode/extensions.json vendored

@ -0,0 +1,11 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"mikestead.dotenv",
"csstools.postcss",
"blanu.vscode-styled-jsx",
"msjsdiag.debugger-for-chrome",
"bradlc.vscode-tailwindcss"
]
}

31
.vscode/launch.json vendored

@ -0,0 +1,31 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Next: Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Next: Node",
"program": "${workspaceFolder}/node_modules/.bin/next",
"args": ["dev"],
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal"
}
],
"compounds": [
{
"name": "Next: Full",
"configurations": ["Next: Node", "Next: Chrome"]
}
]
}

25
.vscode/settings.json vendored

@ -0,0 +1,25 @@
{
"editor.tabSize": 2,
"editor.detectIndentation": false,
"jest.autoRun": {
"watch": false,
"onSave": "test-file"
},
"search.exclude": {
"package-lock.json": true
},
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": false,
"editor.codeActionsOnSave": [
"source.addMissingImports",
"source.fixAll.eslint"
],
// Multiple language settings for json and jsonc files
"[json][jsonc]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

21
.vscode/tasks.json vendored

@ -0,0 +1,21 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Project wide type checking with TypeScript",
"type": "npm",
"script": "build-types",
"problemMatcher": ["$tsc"],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true,
"reveal": "never"
}
}
]
}

21
LICENSE

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Remi W.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

157
README.md

@ -0,0 +1,157 @@
# Boilerplate and Starter for Next JS 12+, Tailwind CSS 3 and TypeScript [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40Ixartz)](https://twitter.com/ixartz)
<p align="center">
<a href="https://creativedesignsguru.com/demo/Nextjs-Boilerplate/"><img src="public/assets/images/nextjs-starter-banner.png?raw=true" alt="Next js starter banner"></a>
</p>
🚀 Boilerplate and Starter for Next.js, Tailwind CSS and TypeScript ⚡ Made with developer experience first: Next.js, TypeScript, ESLint, Prettier, Husky, Lint-Staged, VSCode, Netlify, PostCSS, Tailwind CSS.
Clone this project and use it to create your own [Next.js](https://nextjs.org) project. You can check a [Next js templates demo](https://creativedesignsguru.com/demo/Nextjs-Boilerplate/).
### Features
Developer experience first:
- 🔥 [Next.js](https://nextjs.org) for Static Site Generator
- 🎨 Integrate with [Tailwind CSS](https://tailwindcss.com)
- 💅 PostCSS for processing Tailwind CSS and integrated to `styled-jsx`
- 🎉 Type checking [TypeScript](https://www.typescriptlang.org)
- ✅ Strict Mode for TypeScript and React 17
- ✏ Linter with [ESLint](https://eslint.org) (default NextJS, NextJS Core Web Vitals and Airbnb configuration)
- 💡 Absolute Imports
- 🛠 Code Formatter with [Prettier](https://prettier.io)
- 🦊 Husky for Git Hooks
- 🚫 Lint-staged for running linters on Git staged files
- 🗂 VSCode configuration: Debug, Settings, Tasks and extension for PostCSS, ESLint, Prettier, TypeScript
- 🤖 SEO metadata, JSON-LD and Open Graph tags with Next SEO
- ⚙ [Bundler Analyzer](https://www.npmjs.com/package/@next/bundle-analyzer)
- 🖱 One click deployment with Vercel or Netlify (or manual deployment to any hosting services)
- 🌈 Include a FREE minimalist theme
- 💯 Maximize lighthouse score
Built-in feature from Next.js:
- ☕ Minify HTML & CSS
- 💨 Live reload
- ✅ Cache busting
### Philosophy
- Minimal code
- SEO-friendly
- 🚀 Production-ready
### Nextless.js SaaS Boilerplate
Build your SaaS product faster with [React SaaS Boilerplate](https://nextlessjs.com).
[![React SaaS Boilerplate Next.js](https://creativedesignsguru.com/assets/images/themes/next-js-saas-starter-kit.jpg)](https://nextlessjs.com)
### Premium Themes
| [Green Nextjs Landing Page Template](https://creativedesignsguru.com/landing-green-modern-nextjs-theme/) | [Purple Saas Nextjs Theme](https://creativedesignsguru.com/landing-purple-modern-react-theme/) |
| --- | --- |
| [![Green Nextjs Landing Page Template](https://creativedesignsguru.com/assets/images/themes/landing-green-modern-nextjs-theme-xs.png)](https://creativedesignsguru.com/landing-green-modern-nextjs-theme/) | [![Blue Landing Page Nextjs Theme](https://creativedesignsguru.com/assets/images/themes/landing-blue-modern-nextjs-theme-xs.png)](https://creativedesignsguru.com/landing-blue-modern-react-theme/) |
Find more [Nextjs Themes](https://creativedesignsguru.com/category/nextjs/).
### Requirements
- Node.js and npm
### Getting started
Run the following command on your local environment:
```
git clone --depth=1 https://github.com/ixartz/Next-js-Boilerplate.git my-project-name
cd my-project-name
npm install
```
Then, you can run locally in development mode with live reload:
```
npm run dev
```
Open http://localhost:3000 with your favorite browser to see your project.
```
.
├── README.md # README file
├── next.config.js # Next JS configuration
├── public # Public folder
│ └── assets
│ └── images # Image used by default template
├── src
│ ├── layout # Atomic layout components
│ ├── pages # Next JS pages
│ ├── styles # PostCSS style folder with Tailwind
│ ├── templates # Default template
│ └── utils # Utility folder
├── tailwind.config.js # Tailwind CSS configuration
└── tsconfig.json # TypeScript configuration
```
### Customization
You can easily configure Next js Boilerplate. Please change the following file:
- `public/apple-touch-icon.png`, `public/favicon.ico`, `public/favicon-16x16.png` and `public/favicon-32x32.png`: your website favicon, you can generate from https://favicon.io/favicon-converter/
- `src/styles/global.css`: your CSS file using Tailwind CSS
- `src/utils/AppConfig.ts`: configuration file
- `src/templates/Main.tsx`: default theme
### Deploy to production
You can see the results locally in production mode with:
```
$ npm run build
$ npm run start
```
The generated HTML and CSS files are minified (built-in feature from Next js). It will also removed unused CSS from [Tailwind CSS](https://tailwindcss.com).
You can create an optimized production build with:
```
npm run build-prod
```
Now, your blog is ready to be deployed. All generated files are located at `out` folder, which you can deploy with any hosting service.
### Deploy to Netlify
Clone this repository on own GitHub account and deploy to Netlify:
[![Netlify Deploy button](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/ixartz/Next-js-Boilerplate)
### Deploy to Vercel
Deploy this Next JS Boilerplate on Vercel in one click:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fixartz%2FNext-js-Boilerplate)
### VSCode information (optional)
If you are VSCode users, you can have a better integration with VSCode by installing the suggested extension in `.vscode/extension.json`. The starter code comes up with Settings for a seamless integration with VSCode. The Debug configuration is also provided for frontend and backend debugging experience.
Pro tips: if you need a project wide type checking with TypeScript, you can run a build with <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>B</kbd> on Mac.
### Contributions
Everyone is welcome to contribute to this project. Feel free to open an issue if you have question or found a bug.
### License
Licensed under the MIT License, Copyright © 2020
See [LICENSE](LICENSE) for more information.
---
Made with ♥ by [CreativeDesignsGuru](https://creativedesignsguru.com) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40Ixartz)](https://twitter.com/ixartz)
[![Sponsor Next JS Boilerplate](https://cdn.buymeacoffee.com/buttons/default-red.png)](https://www.buymeacoffee.com/ixartz)

5
lint-staged.config.js

@ -0,0 +1,5 @@
module.exports = {
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'eslint'],
'**/*.ts?(x)': () => 'npm run build-types',
'*.json': ['prettier --write'],
};

3
netlify.toml

@ -0,0 +1,3 @@
[build]
publish = "out"
command = "npm run build-prod"

5
next-env.d.ts vendored

@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

14
next.config.js

@ -0,0 +1,14 @@
/* eslint-disable import/no-extraneous-dependencies */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer({
poweredByHeader: false,
trailingSlash: true,
basePath: '',
// The starter code load resources from `public` folder with `router.basePath` in React components.
// So, the source code is "basePath-ready".
// You can remove `basePath` if you don't need it.
reactStrictMode: true,
});

4117
package-lock.json generated

File diff suppressed because it is too large Load Diff

53
package.json

@ -0,0 +1,53 @@
{
"name": "next-js-boilerplate",
"version": "1.0.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"build-stats": "cross-env ANALYZE=true npm run build",
"export": "next export",
"build-prod": "run-s clean build export",
"clean": "rimraf .next out",
"lint": "next lint",
"build-types": "tsc --noEmit --pretty",
"prepare": "husky install"
},
"dependencies": {
"next": "^12.0.9",
"next-seo": "^4.29.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"styled-jsx-plugin-postcss": "^4.0.1"
},
"devDependencies": {
"@next/bundle-analyzer": "^12.0.9",
"@types/node": "^17.0.13",
"@types/react": "^17.0.38",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"autoprefixer": "^10.4.2",
"cross-env": "^7.0.3",
"cssnano": "^5.0.16",
"eslint": "^8.7.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-next": "^12.0.9",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^7.0.4",
"lint-staged": "^12.3.2",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.5",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"tailwindcss": "^3.0.17",
"typescript": "^4.5.5"
},
"license": "ISC"
}

10
postcss.config.js

@ -0,0 +1,10 @@
// Please do not use the array form (like ['tailwindcss', 'postcss-preset-env'])
// it will create an unexpected error: Invalid PostCSS Plugin found: [0]
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}),
},
};

BIN
public/apple-touch-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

BIN
public/assets/images/nextjs-starter-banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

BIN
public/favicon-16x16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

BIN
public/favicon-32x32.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1001 B

BIN
public/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

95
src/components/BottomNav.tsx

@ -0,0 +1,95 @@
export default function BottomNav() {
return (
<div className="fixed bottom-4 left-1/2 transform -translate-x-1/2 inline-flex justify-between bg-blue-600 w-11/12 rounded-3xl z-20 ">
<a
aria-current="page"
className="inline-flex flex-col items-center text-xs font-medium py-3 px-4 text-white flex-grow transition-all hover:bg-blue-200 hover:rounded-3xl hover:text-blue-600"
href="#"
>
<svg
className="w-7 h-7"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"></path>
</svg>
<span className="sr-only">Home</span>
</a>
<a
className="inline-flex flex-col items-center text-xs font-medium text-blue-400 py-3 px-4 flex-grow transition-all hover:bg-blue-200 hover:rounded-3xl hover:text-blue-600"
href="#"
>
<svg
className="w-8 h-8"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
d="M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z"
clipRule="evenodd"
></path>
</svg>
<span className="sr-only">Chat</span>
</a>
<button className="relative inline-flex flex-col items-center text-xs font-medium text-white py-3 px-6 flex-grow">
<div className="absolute bottom-4 p-3 rounded-full border-2 border-blue-600 bg-blue-600 hover:border-blue-400 hover:bg-blue-400 hover:bottom-6 transition-all ease-in-out delay-50">
<svg
className="w-7 h-7"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V7z"
clipRule="evenodd"
></path>
</svg>
</div>
<span className="sr-only">Upload</span>
</button>
<a
className="inline-flex flex-col items-center text-xs font-medium text-blue-400 py-3 px-4 flex-grow transition-all hover:bg-blue-200 hover:rounded-3xl hover:text-blue-600"
href="#"
>
<svg
className="w-7 h-7"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
clipRule="evenodd"
></path>
</svg>
<span className="sr-only">Search</span>
</a>
<a
className="inline-flex flex-col items-center text-xs font-medium text-blue-400 py-3 px-4 flex-grow transition-all hover:bg-blue-200 hover:rounded-3xl hover:text-blue-600"
href="#"
>
<svg
className="w-7 h-7"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 0 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z"
clipRule="evenodd"
></path>
</svg>
<span className="sr-only">Profile</span>
</a>
</div>
);
}

26
src/components/SidebarNav.tsx

@ -0,0 +1,26 @@
export default function SidebarNav() {
return (
<div className="fixed bg-purple-400/80 mx-auto min-h-screen transition-all duration-150 ease-in z-10 w-32 -left-32 md:left-0">
<ul>
<li>
<span role="img" aria-label="fire">
🔥
</span>{' '}
<a href="https://nextjs.org" rel="nofollow">
Next.js
</a>{' '}
for Static Site Generator
</li>
<li>
<span role="img" aria-label="art">
🎨
</span>{' '}
Integrate with{' '}
<a href="https://tailwindcss.com" rel="nofollow">
Tailwind CSS
</a>
</li>
</ul>
</div>
);
}

66
src/layout/Meta.tsx

@ -0,0 +1,66 @@
import { NextSeo } from 'next-seo';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { AppConfig } from '@/utils/AppConfig';
type IMetaProps = {
title: string;
description: string;
canonical?: string;
};
const Meta = (props: IMetaProps) => {
const router = useRouter();
return (
<>
<Head>
<meta charSet="UTF-8" key="charset" />
<meta
name="viewport"
content="width=device-width,initial-scale=1"
key="viewport"
/>
<link
rel="apple-touch-icon"
href={`${router.basePath}/apple-touch-icon.png`}
key="apple"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href={`${router.basePath}/favicon-32x32.png`}
key="icon32"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href={`${router.basePath}/favicon-16x16.png`}
key="icon16"
/>
<link
rel="icon"
href={`${router.basePath}/favicon.ico`}
key="favicon"
/>
</Head>
<NextSeo
title={props.title}
description={props.description}
canonical={props.canonical}
openGraph={{
title: props.title,
description: props.description,
url: props.canonical,
locale: AppConfig.locale,
site_name: AppConfig.site_name,
}}
/>
</>
);
};
export { Meta };

9
src/pages/_app.tsx

@ -0,0 +1,9 @@
import { AppProps } from 'next/app';
import '../styles/global.css';
const MyApp = ({ Component, pageProps }: AppProps) => (
<Component {...pageProps} />
);
export default MyApp;

20
src/pages/_document.tsx

@ -0,0 +1,20 @@
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { AppConfig } from '@/utils/AppConfig';
// Need to create a custom _document because i18n support is not compatible with `next export`.
class MyDocument extends Document {
render() {
return (
<Html lang={AppConfig.locale}>
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default MyDocument;

79
src/pages/about.tsx

@ -0,0 +1,79 @@
import { Meta } from '@/layout/Meta';
import { Main } from '@/templates/Main';
const About = () => (
<Main meta={<Meta title="Lorem ipsum" description="Lorem ipsum" />}>
<div className="flex flex-col flex-grow">
<blockquote className="text-2xl font-semibold italic text-center text-slate-900">
{' '}
When you look&nbsp;
<span className="relative">
<span
className="block absolute -inset-1 -skew-y-3 bg-amber-500 "
aria-hidden="true"
></span>
<span className="relative text-white after:content-['__↗']">
annoyed
</span>
</span>
&nbsp;all the time, people think that you&apos;re busy.
</blockquote>
<div className="py-8 px-8 max-w-sm mx-auto bg-white rounded-xl shadow-lg space-y-2 sm:py-4 sm:flex sm:items-center sm:space-y-0 sm:space-x-6 dark:bg-slate-200">
<img
className="block mx-auto h-24 rounded-full sm:mx-0 sm:shrink-0"
src="https://tailwindcss.com/img/erin-lindford.jpg"
alt="Woman's Face"
/>
<div className="text-center space-y-2 sm:text-left">
<div className="space-y-0.5">
<p className="text-lg text-black font-semibold">Erin Lindford</p>
<p className="text-slate-500 font-medium">Product Engineer</p>
</div>
<button className="px-4 py-1 text-sm text-purple-600 font-semibold rounded-full border border-purple-200 hover:text-white hover:bg-purple-600 hover:border-transparent focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2">
Message
</button>
</div>
</div>
<figure className="md:flex bg-slate-100 rounded-xl p-8 md:p-0 dark:bg-slate-800">
<img
className="w-24 h-24 rounded-xl md:w-48 md:h-auto md:rounded-none rounded-full mx-auto"
src={`https://tailwindcss.com/_next/static/media/sarah-dayan.a8ff3f1095a58085a82e3bb6aab12eb2.jpg`}
alt=""
width="384"
height="512"
/>
<div className="pt-6 md:p-8 text-center md:text-left space-y-4">
<blockquote>
<p className="text-lg font-medium">
Tailwind CSS is the only framework that I&apos;ve seen scale on
large teams. It&apos;s easy to customize, adapts to any design,
and the build size is tiny.
</p>
</blockquote>
<figcaption className="font-medium">
<div className="text-sky-500 dark:text-sky-400">Sarah Dayan</div>
<div className="text-slate-700 dark:text-slate-500">
Staff Engineer, Algolia
</div>
</figcaption>
</div>
</figure>
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Ratione fuga
recusandae quidem. Quaerat molestiae blanditiis doloremque possimus
labore voluptatibus distinctio recusandae autem esse explicabo molestias
officia placeat, accusamus aut saepe.
</p>
<p>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Ratione fuga
recusandae quidem. Quaerat molestiae blanditiis doloremque possimus
labore voluptatibus distinctio recusandae autem esse explicabo molestias
officia placeat, accusamus aut saepe.
</p>
</div>
</Main>
);
export default About;

26
src/pages/blank.tsx

@ -0,0 +1,26 @@
import { Meta } from '@/layout/Meta';
import { Main } from '@/templates/Main';
export default function Blank() {
return (
<Main meta={<Meta title="Lorem ipsum" description="Lorem ipsum" />}>
<div className="flex flex-col flex-grow border-4 border-gray-400 border-dashed bg-white rounded mt-4">
BLANK
</div>
<blockquote className="text-2xl font-semibold italic text-center text-slate-900">
{' '}
When you look&nbsp;
<span className="relative">
<span
className="block absolute -inset-1 -skew-y-3 bg-amber-500 "
aria-hidden="true"
></span>
<span className="relative text-white after:content-['__↗']">
annoyed
</span>
</span>
&nbsp;all the time, people think that you&apos;re busy.
</blockquote>
</Main>
);
}

186
src/pages/index.tsx

@ -0,0 +1,186 @@
import { useRouter } from 'next/router';
import { Meta } from '@/layout/Meta';
import { Main } from '@/templates/Main';
const Index = () => {
const router = useRouter();
return (
<Main
meta={
<Meta
title="Next.js Boilerplate Presentation"
description="Next js Boilerplate is the perfect starter code for your project. Build your React application with the Next.js framework."
/>
}
>
<a href="https://github.com/ixartz/Next-js-Boilerplate">
<img
src={`${router.basePath}/assets/images/nextjs-starter-banner.png`}
alt="Nextjs starter banner"
/>
</a>
<h1 className="font-bold text-2xl">
Boilerplate code for your Nextjs project with Tailwind CSS
</h1>
<p>
<span role="img" aria-label="rocket">
🚀
</span>{' '}
Next.js Boilerplate is a starter code for your Next js project by
putting developer experience first .{' '}
<span role="img" aria-label="zap">
</span>{' '}
Made with Next.js, TypeScript, ESLint, Prettier, Husky, Lint-Staged,
VSCode, Netlify, PostCSS, Tailwind CSS.
</p>
<h2 className="font-semibold text-lg">Next js Boilerplate Features</h2>
<p>Developer experience first:</p>
<ul>
<li>
<span role="img" aria-label="fire">
🔥
</span>{' '}
<a href="https://nextjs.org" rel="nofollow">
Next.js
</a>{' '}
for Static Site Generator
</li>
<li>
<span role="img" aria-label="art">
🎨
</span>{' '}
Integrate with{' '}
<a href="https://tailwindcss.com" rel="nofollow">
Tailwind CSS
</a>
</li>
<li>
<span role="img" aria-label="nail_care">
💅
</span>{' '}
PostCSS for processing Tailwind CSS
</li>
<li>
<span role="img" aria-label="tada">
🎉
</span>{' '}
Type checking Typescript
</li>
<li>
<span role="img" aria-label="pencil2">
</span>{' '}
Linter with{' '}
<a href="https://eslint.org" rel="nofollow">
ESLint
</a>
</li>
<li>
<span role="img" aria-label="hammer_and_wrench">
🛠
</span>{' '}
Code Formatter with{' '}
<a href="https://prettier.io" rel="nofollow">
Prettier
</a>
</li>
<li>
<span role="img" aria-label="fox_face">
🦊
</span>{' '}
Husky for Git Hooks
</li>
<li>
<span role="img" aria-label="no_entry_sign">
🚫
</span>{' '}
Lint-staged for running linters on Git staged files
</li>
<li>
<span role="img" aria-label="no_entry_sign">
🗂
</span>{' '}
VSCode configuration: Debug, Settings, Tasks and extension for
PostCSS, ESLint, Prettier, TypeScript
</li>
<li>
<span role="img" aria-label="robot">
🤖
</span>{' '}
SEO metadata, JSON-LD and Open Graph tags with Next SEO
</li>
<li>
<span role="img" aria-label="robot">
</span>{' '}
<a
href="https://www.npmjs.com/package/@next/bundle-analyzer"
rel="nofollow"
>
Bundler Analyzer
</a>
</li>
<li>
<span role="img" aria-label="rainbow">
🌈
</span>{' '}
Include a FREE minimalist theme
</li>
<li>
<span role="img" aria-label="hundred">
💯
</span>{' '}
Maximize lighthouse score
</li>
</ul>
<p>Built-in feature from Next.js:</p>
<ul>
<li>
<span role="img" aria-label="coffee">
</span>{' '}
Minify HTML &amp; CSS
</li>
<li>
<span role="img" aria-label="dash">
💨
</span>{' '}
Live reload
</li>
<li>
<span role="img" aria-label="white_check_mark">
</span>{' '}
Cache busting
</li>
</ul>
<h2 className="font-semibold text-lg">Our Stater code Philosophy</h2>
<ul>
<li>Minimal code</li>
<li>SEO-friendly</li>
<li>
<span role="img" aria-label="rocket">
🚀
</span>{' '}
Production-ready
</li>
</ul>
<p>
Check our GitHub project for more information about{' '}
<a href="https://github.com/ixartz/Next-js-Boilerplate">
Nextjs Boilerplate
</a>
. You can also browse our{' '}
<a href="https://creativedesignsguru.com/category/nextjs/">
Premium NextJS Templates
</a>{' '}
on our website to support this project.
</p>
</Main>
);
};
export default Index;

21
src/styles/global.css

@ -0,0 +1,21 @@
@tailwind base;
/* a {
@apply text-blue-700;
} */
/* a:hover {
@apply border-b-2 border-blue-700;
} */
@tailwind components;
@tailwind utilities;
.content p {
@apply my-6;
}
.content ul {
@apply my-6;
}

20
src/templates/Main.tsx

@ -0,0 +1,20 @@
import { ReactNode } from 'react';
import BottomNav from '@/components/BottomNav';
type IMainProps = {
meta: ReactNode;
children: ReactNode;
};
const Main = (props: IMainProps) => (
<div className="flex flex-row min-h-screen bg-gray-100 text-gray-800">
<BottomNav />
{/* <SidebarNav /> */}
<main className="flex flex-col flex-grow transition-all duration-150 ease-in m-5">
{props.children}
</main>
</div>
);
export { Main };

6
src/utils/AppConfig.ts

@ -0,0 +1,6 @@
export const AppConfig = {
site_name: 'Starter',
title: 'Nextjs Starter',
description: 'Starter code for your Nextjs Boilerplate with Tailwind CSS',
locale: 'en',
};

45
tailwind.config.js

@ -0,0 +1,45 @@
module.exports = {
content: ['./src/**/*.{js,ts,jsx,tsx}'],
theme: {
fontSize: {
xs: '0.75rem',
sm: '0.875rem',
base: '1rem',
lg: '1.125rem',
xl: '1.25rem',
'2xl': '1.5rem',
'3xl': '1.875rem',
'4xl': '2.25rem',
'5xl': '3rem',
'6xl': '4rem',
},
extend: {
colors: {
gray: {
100: '#f7fafc',
200: '#edf2f7',
300: '#e2e8f0',
400: '#cbd5e0',
500: '#a0aec0',
600: '#718096',
700: '#4a5568',
800: '#2d3748',
900: '#1a202c',
},
blue: {
100: '#ebf8ff',
200: '#bee3f8',
300: '#90cdf4',
400: '#63b3ed',
500: '#4299e1',
600: '#3182ce',
700: '#2b6cb0',
800: '#2c5282',
900: '#2a4365',
},
},
},
},
variants: {},
plugins: [],
};

46
tsconfig.json

@ -0,0 +1,46 @@
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"removeComments": true,
"preserveConstEnums": true,
"strict": true,
"alwaysStrict": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"allowUnreachableCode": false,
"noFallthroughCasesInSwitch": true,
"target": "es5",
"outDir": "out",
"declaration": true,
"sourceMap": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"allowJs": false,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"jsx": "preserve",
"noEmit": true,
"isolatedModules": true,
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@/public/*": ["./public/*"]
}
},
"exclude": ["./out/**/*", "./node_modules/**/*"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}
Loading…
Cancel
Save