|
1 | | -# typescript_nextjs_template |
2 | | -Template with all the plugins and frameworks that I like to use. |
| 1 | +# Boilerplate and Starter for Next JS 12+, Tailwind CSS 3 and TypeScript |
| 2 | + |
| 3 | +🚀 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. |
| 4 | + |
| 5 | +Clone this project and use it to create your own [Next.js](https://nextjs.org) project. |
| 6 | + |
| 7 | +### Features |
| 8 | + |
| 9 | +Developer experience first: |
| 10 | + |
| 11 | +- 🔥 [Next.js](https://nextjs.org) for Static Site Generator |
| 12 | +- 🎨 Integrate with [Tailwind CSS](https://tailwindcss.com) |
| 13 | +- 💅 PostCSS for processing Tailwind CSS and integrated to `styled-jsx` |
| 14 | +- 🎉 Type checking [TypeScript](https://www.typescriptlang.org) |
| 15 | +- ✅ Strict Mode for TypeScript and React 17 |
| 16 | +- ✏️ Linter with [ESLint](https://eslint.org) (default NextJS, NextJS Core Web Vitals, Tailwind CSS and Airbnb configuration) |
| 17 | +- 💡 Absolute Imports |
| 18 | +- 🛠 Code Formatter with [Prettier](https://prettier.io) |
| 19 | +- 🦊 Husky for Git Hooks |
| 20 | +- 🚫 Lint-staged for running linters on Git staged files |
| 21 | +- 🗂 VSCode configuration: Debug, Settings, Tasks and extension for PostCSS, ESLint, Prettier, TypeScript |
| 22 | +- 🤖 SEO metadata, JSON-LD and Open Graph tags with Next SEO |
| 23 | +- ⚙️ [Bundler Analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) |
| 24 | +- 🖱️ One click deployment with Vercel or Netlify (or manual deployment to any hosting services) |
| 25 | +- 🌈 Include a FREE minimalist theme |
| 26 | +- 💯 Maximize lighthouse score |
| 27 | + |
| 28 | +Built-in feature from Next.js: |
| 29 | + |
| 30 | +- ☕ Minify HTML & CSS |
| 31 | +- 💨 Live reload |
| 32 | +- ✅ Cache busting |
| 33 | + |
| 34 | +### Philosophy |
| 35 | + |
| 36 | +- Minimal code |
| 37 | +- SEO-friendly |
| 38 | +- 🚀 Production-ready |
| 39 | + |
| 40 | +### Requirements |
| 41 | + |
| 42 | +- Node.js 14+ and npm |
| 43 | + |
| 44 | +### Getting started |
| 45 | + |
| 46 | +Run the following command on your local environment: |
| 47 | + |
| 48 | +``` |
| 49 | +git clone --depth=1 https://github.com/lertsoft/typescript-ventures.git my-project-name |
| 50 | +cd my-project-name |
| 51 | +npm install |
| 52 | +``` |
| 53 | + |
| 54 | +Then, you can run locally in development mode with live reload: |
| 55 | + |
| 56 | +``` |
| 57 | +npm run dev |
| 58 | +``` |
| 59 | + |
| 60 | +Open http://localhost:3000 with your favorite browser to see your project. |
| 61 | + |
| 62 | +``` |
| 63 | +. |
| 64 | +├── README.md # README file |
| 65 | +├── next.config.js # Next JS configuration |
| 66 | +├── public # Public folder |
| 67 | +│ └── assets |
| 68 | +│ └── images # Image used by default template |
| 69 | +├── src |
| 70 | +│ ├── layout # Atomic layout components |
| 71 | +│ ├── pages # Next JS pages |
| 72 | +│ ├── styles # PostCSS style folder with Tailwind |
| 73 | +│ ├── templates # Default template |
| 74 | +│ └── utils # Utility folder |
| 75 | +├── tailwind.config.js # Tailwind CSS configuration |
| 76 | +└── tsconfig.json # TypeScript configuration |
| 77 | +``` |
| 78 | + |
| 79 | +### Customization |
| 80 | + |
| 81 | +You can easily configure Next.tsx Boilerplate. Please change the following file: |
| 82 | + |
| 83 | +- `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/ |
| 84 | +- `src/styles/global.css`: your CSS file using Tailwind CSS |
| 85 | +- `src/utils/AppConfig.ts`: configuration file |
| 86 | +- `src/templates/Main.tsx`: default theme |
| 87 | + |
| 88 | +### Deploy to production |
| 89 | + |
| 90 | +You can see the results locally in production mode with: |
| 91 | + |
| 92 | +``` |
| 93 | +$ npm run build |
| 94 | +$ npm run start |
| 95 | +``` |
| 96 | + |
| 97 | +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). |
| 98 | + |
| 99 | +You can create an optimized production build with: |
| 100 | + |
| 101 | +``` |
| 102 | +npm run build-prod |
| 103 | +``` |
| 104 | + |
| 105 | +Now, your blog is ready to be deployed. All generated files are located at `out` folder, which you can deploy with any hosting service. |
| 106 | + |
| 107 | +### Deploy to Netlify |
| 108 | + |
| 109 | +Clone this repository on own GitHub account and deploy to Netlify: |
| 110 | + |
| 111 | +[ |
| 112 | + |
| 113 | +### Deploy to Vercel |
| 114 | + |
| 115 | +Deploy this Next JS Boilerplate on Vercel in one click: |
| 116 | + |
| 117 | +[] |
| 118 | + |
| 119 | +### VSCode information (optional) |
| 120 | + |
| 121 | +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. |
| 122 | + |
| 123 | +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. |
| 124 | + |
| 125 | +### Contributions |
| 126 | + |
| 127 | +Everyone is welcome to contribute to this project. Feel free to open an issue if you have question or found a bug. |
| 128 | + |
| 129 | +### License |
| 130 | + |
| 131 | +Licensed under the MIT License, Copyright © 2022 |
| 132 | + |
| 133 | +See [LICENSE](LICENSE) for more information. |
0 commit comments