├── public
├── robots.txt
├── favicon.ico
└── static
│ ├── icon-192.png
│ ├── icon-512.png
│ └── manifest.json
├── next-env.d.ts
├── tailwind.config.js
├── components
└── component.tsx
├── styles
└── index.css
├── tslint.json
├── now.json
├── .gitignore
├── pages
├── _document.tsx
└── index.tsx
├── README.md
├── tsconfig.json
├── postcss.config.js
├── package.json
├── next.config.js
└── LICENSE
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 |
--------------------------------------------------------------------------------
/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skolldev/nextjs-tailwind-typescript-starter/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | theme: {
3 | extend: {}
4 | },
5 | variants: {},
6 | plugins: []
7 | }
8 |
--------------------------------------------------------------------------------
/components/component.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | export default function Component() {
4 | return
;
5 | }
6 |
--------------------------------------------------------------------------------
/public/static/icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skolldev/nextjs-tailwind-typescript-starter/HEAD/public/static/icon-192.png
--------------------------------------------------------------------------------
/public/static/icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skolldev/nextjs-tailwind-typescript-starter/HEAD/public/static/icon-512.png
--------------------------------------------------------------------------------
/styles/index.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | body {
6 | @apply bg-gray-200 p-12;
7 | }
8 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["tslint:recommended", "tslint-react"],
3 | "rules": {
4 | "trailing-comma": false,
5 | "arrow-parens": false,
6 | "object-literal-sort-keys": false,
7 | "jsx-no-multiline-js": false,
8 | "jsx-boolean-value": false
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/now.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 2,
3 | "routes": [
4 | {
5 | "src": "^/service-worker.js$",
6 | "dest": "/_next/static/service-worker.js",
7 | "headers": {
8 | "cache-control": "public, max-age=43200, immutable",
9 | "Service-Worker-Allowed": "/"
10 | }
11 | }
12 | ],
13 | "builds": [
14 | {
15 | "src": "next.config.js",
16 | "use": "@now/next"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/.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 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 | # next
26 | /.next
--------------------------------------------------------------------------------
/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | import Document, { Head, Html, Main, NextScript } from "next/document";
2 |
3 | export default class DefaultDocument extends Document {
4 | public render() {
5 | return (
6 |
7 |
9 |
10 |
11 |
12 |
13 | );
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | A ready-to-go starter for creating Single Page Applications with React, Next.js, Typescript and Tailwind.css
2 |
3 | Readily configured to purge unneeded tailwind styles when building for production.
4 |
5 | Fully supports the PWA standard and installs a service worker when conditions are met.
6 |
7 | Scores 100 in every lighthouse audit.
8 |
9 | Preconfigured to be deployed to Zeit Now (also with PWA support there!)
10 |
11 | Have fun!
12 |
--------------------------------------------------------------------------------
/public/static/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Next JS Starter Template",
3 | "short_name": "Next JS",
4 | "icons": [
5 | {
6 | "src": "/static/icon-192.png",
7 | "type": "image/png",
8 | "sizes": "192x192"
9 | },
10 | {
11 | "src": "/static/icon-512.png",
12 | "type": "image/png",
13 | "sizes": "512x512"
14 | }
15 | ],
16 | "background_color": "#FFFFFF",
17 | "description": "Portfolio Page",
18 | "display": "fullscreen",
19 | "start_url": "/",
20 | "theme_color": "#000"
21 | }
22 |
--------------------------------------------------------------------------------
/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 | },
17 | "exclude": ["node_modules"],
18 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
19 | }
20 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | const purgecss = require("@fullhuman/postcss-purgecss")({
2 | // Specify the paths to all of the template files in your project
3 | content: [
4 | "./pages/**/*.tsx",
5 | "./styles/**/*.css"
6 | // etc.
7 | ],
8 |
9 | // Include any special characters you're using in this regular expression
10 | defaultExtractor: content => content.match(/[\w-/:]+(? ["/"].concat(manifest), // add the homepage to the cache
12 | workboxOpts: {
13 | swDest: "static/service-worker.js",
14 | runtimeCaching: [
15 | {
16 | urlPattern: /^https?.*/,
17 | handler: "NetworkFirst",
18 | options: {
19 | cacheName: "https-calls",
20 | networkTimeoutSeconds: 15,
21 | expiration: {
22 | maxEntries: 150,
23 | maxAgeSeconds: 30 * 24 * 60 * 60 // 1 month
24 | },
25 | cacheableResponse: {
26 | statuses: [0, 200]
27 | }
28 | }
29 | }
30 | ]
31 | }
32 | }
33 | ]
34 | ]);
35 |
--------------------------------------------------------------------------------
/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import "../styles/index.css";
2 |
3 | import { NextPage } from "next";
4 | import Head from "next/head";
5 |
6 | const Home: NextPage = () => (
7 |
8 |
9 |
Next.js Starter
10 |
11 |
12 |
16 |
17 |
29 |
30 | );
31 |
32 | export default Home;
33 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 xDecus
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------