Skip to content

Turborepo Boilerplate using NextJS, TypeScript and Styled Components

Notifications You must be signed in to change notification settings

LucasBassetti/turborepo-typescript-boilerplate

Repository files navigation

Turborepo Boilerplate

Turborepo boilerplate with the following stack:

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

Apps Folder Strucutre

The following aspects were used to create the apps folder structure

↳ @types                            # extension types (not related to application types)
  ...
↳ src                               # sources
  ↳ components                      # shared components used in the pages templates
    ↳ complex                       # mixin of data display and input components
      ↳ {ComponentName}             # component name with CamelCase
        ↳ index.tsx                 # element
        ↳ styles.ts                 # styles
        ↳ test.tsx                  # tests
    ↳ data_display                  # ui components without actions
      ↳ {ComponentName}             # component name with CamelCase
        ↳ index.tsx                 # element
        ↳ styles.ts                 # styles
        ↳ test.tsx                  # tests
    ↳ icons                         # icons
      ↳ {ComponentName}             # component name with CamelCase
        ↳ index.tsx                 # element
        ↳ styles.ts                 # styles
        ↳ test.tsx                  # tests
    ↳ forms                         # completed forms
      ↳ {ComponentName}             # component name with CamelCase
        ↳ index.tsx                 # element
        ↳ styles.ts                 # styles
        ↳ test.tsx                  # tests
    ↳ inputs                        # buttons, selects, text fields, etc
      ↳ {ComponentName}             # component name with CamelCase
        ↳ index.tsx                 # element
        ↳ styles.ts                 # styles
        ↳ test.tsx                  # tests
    ↳ placeholders                  # placeholders of components
      ↳ {ComponentName}             # component name with CamelCase
        ↳ index.tsx                 # element
        ↳ styles.ts                 # styles
        ↳ test.tsx                  # tests
    ↳ templates                     # generic templates used in multiple pages templates
      ↳ {ComponentName}             # component name with CamelCase
        ↳ index.tsx                 # element
        ↳ styles.ts                 # styles
        ↳ test.tsx                  # tests
  ↳ constants                       # application constants
    {filename}.tsx                  # some file with constants
    ...
  ↳ hocs                            # application hocs
    ...
  ↳ hooks                           # application hooks
    ↳ use{HookName}                 # application hook
      ↳ index.ts                    # hook function
      ↳ test.ts                     # hook tests
  ↳ layout                          # layout wrapper for all pages (header, etc.)
    ...
  ↳ page_templates                  # routes screens
    ↳ private                       # private screens
      ↳ ComponentTemplate           # route main component (don't create subfolder)
        ↳ components                # components used only in a specific route (see components)
        index.tsx                   # element
        styles.ts                   # styles
    ↳ public                        # public screens
      ↳ ComponentTemplate           # route main component (don't create subfolder)
        ↳ components                # components used only in a specific route (see components)
        index.tsx                   # element
        styles.ts                   # styles
  ↳ providers                       # application providers
    ↳ {ProviderName}Provider        # Provider component
      index.tsx                     # element
      styles.ts                     # styles
  ↳ styles                          # global styles and themes
    global.ts                       # global styles
    theme.ts                        # global themes
    ...
  ↳ utils                           # helper functions
    {filename}.tsx                  # some file with helper functions
    ...

Commands

  • dev: runs your application on localhost:3000
  • build: creates the production build version
  • start: starts a simple server with the build production code
  • generate: generate component files
  • lint: runs the linter in all components and pages
  • test: runs jest to test all components and pages
  • test:watch: runs jest in watch mode
  • storybook: runs storybook on localhost:6006
  • build-storybook: create the build version of storybook

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

Turborepo Boilerplate using NextJS, TypeScript and Styled Components

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published