Giter Site home page Giter Site logo

nextjs_tailwindcss_storybook_sandbox's Introduction

Next js React Web Project Template (Typescript, Sass, Tailwind Css, SVGR, Prettier, Storybook, SEO, On-Demand ISR pre-configs and other generally used features and tools in production.)

This is a React Next.js project bootstrapped with create-next-app. To the default setup have been added:

  • Prettier - Popular opinionated code formatter.
  • Sass - Popular Css extension.
  • Tailwind Css - Utility-first CSS framework. Added to utilities such as :
    • tailwind-merge Utility function to efficiently merge Tailwind CSS classes in JS without style conflicts.
    • prettier-plugin-tailwindcss A Prettier plugin that automatically sorts Tailwind classes based on recommended class order.
  • Storybook - Frontend workshop for previewing and testing your UI components and pages in isolation.
  • SVGR - Tool box for using SVGs in React directly as components like in Create React App.
  • Easy SEO management with next-seo
  • Next js On-Demand ISR
    • Next js On-demand Incremental Static Regeneration api config to revalidate static stale pages on demand.
  • Conventional Commits Linting - Set of rules for enforcing creation of more human and machine-readable explicit commits.
  • Absolute imports. See Additional notes section.

Quick Start

Start using this template with Create Next App.

yarn create next-app -e https://github.com/ouedyan/nextjs-template

Then check all TODO sections (by doing a global search for e.g.) to complete the project's setup. You can delete this README and use the simplified README.prod instead in your project.

Additional notes about the template

Absolute imports have been configured in tsconfig.json

{
  "compilerOptions": {
    //...
    "baseUrl": ".",
    "paths": {
      "@/*": [
        "*"
      ]
    }
  },
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx"
  ]
  //...
}

Scripts

Run the development server

yarn dev

Building for production

yarn build

Run in production mode

yarn start

Run Storybook server

yarn storybook

Build Storybook as a static web application

yarn build-storybook

Project directory structure

Main folder structure

๐Ÿ“‚ components
  ...๐Ÿ“„ {Component}.tsx
  ...๐Ÿ“‚ {page}
     ...๐Ÿ“„ {Component}.tsx

๐Ÿ“‚ lib
  ๐Ÿ“‚ data
    ...๐Ÿ“„ {service}.ts
  ๐Ÿ“‚ types
    ...๐Ÿ“„ {type}.ts

๐Ÿ“‚ pages
  ๐Ÿ“‚ api
    ...๐Ÿ“„ {apiPath}.ts
  _app.tsx ?
  _document.tsx ?
  ...๐Ÿ“„ {path}.ts

๐Ÿ“‚ public
  ๐Ÿ“‚ icons
  ๐Ÿ“‚ images
  ๐Ÿ“„ favicon.ico
  ๐Ÿ“„ robots.txt
  
๐Ÿ“‚ stories
  ...๐Ÿ“„ {Component}.stories.tsx
  ...๐Ÿ“‚ {page}
     ...๐Ÿ“„ {Component}.stories.tsx

๐Ÿ“‚ styles
  ๐Ÿ“„ globals.scss

Project's main tech stack useful resources

React

Next.js

Tailwind Css

Typescript

nextjs_tailwindcss_storybook_sandbox's People

Contributors

idmo avatar

Watchers

Jason Cline avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.