Giter VIP home page Giter VIP logo

ozanmanav / frontend-monorepo-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mkosir/frontend-monorepo-boilerplate

0.0 0.0 0.0 11.02 MB

⚡ Frontend monorepo boilerplate. TypeScript, vanilla CSS/Tailwind/MUI with focus on best practices and painless developer experience.

Home Page: https://turbo-app-prod.netlify.app/

License: MIT License

JavaScript 13.93% TypeScript 84.84% CSS 0.25% HTML 0.97%

frontend-monorepo-boilerplate's Introduction

Frontend Monorepo Boilerplate TypeScript / Tailwind / Material UI

CI TypeScript semantic-release

Deployments - Prod / Stage / Storybook

CI CI CI

CI CI CI

CI CI

Frontend monorepo with focus on best practices and painless developer experience:

  • Monorepo setup that can be easily extended 🔧
  • Spin it up with single command 🌀
  • TypeScript 100% codebase
  • Blazing fast builds, lints, tests with Turborepo remote caching

Requirements

Running

Easily set up a local development environment

  • npm i
  • npm run build
  • npm run dev - Start all apps 🚀

Visit one of the monorepo apps localhost:3100

Features:

Commands

Bellow commands will be executed on monorepo level - on all apps and packages where npm script exists.

Command Description
prepare Setup git hooks with Husky (executes on npm install)
build Build all apps and packages (output build, dist)
dev Start all apps
lint Lint all apps and packages
lint-staged-husky Run prettier and lint on staged files
tsc Run TypeScript compiler
test Run tests on all apps and packages
storybook Start storybooks on all apps and packages
storybook-build Build all storybooks (output build-storybook)
format-lint Lint formatting with Prettier
format-fix Fix formatting with Prettier
clean Remove installed, generated and cached folders
remove-turbo-cache Removes Turborepo local cache
update-dependencies Update dependencies to their latest versions

Coding Guidelines

Convention over configuration should be followed as much as possible as described in TypeScript Style Guide.

TLDR:

  • Strive for data immutability.
  • Embrace const assertions.
  • Avoid type assertions.
  • Embrace discriminated unions.
  • Strive for functions to be pure, stateless and have single responsibility.
  • Majority of function arguments should be required (use optional sparingly).
  • Strong emphasis to keep naming conventions consistent and readable.
  • Use named exports.
  • Code is organized and grouped by feature. Collocate code as close as possible to where it's relevant.
  • UI components must only show derived state and send events, nothing more (no business logic).
  • Test business logic, not implementation details.

Monorepo

Monorepo features and conventions:

  • Monorepo is opinionated in order to achieve best developer experience. It's meant to be used as frontend only monorepo, 100% TypeScript, consistent codebase across whole monorepo with automated tooling in place as ESLint, Prettier, TypeScript, conventional commits etc.
  • Workspaces:
    • It comes with two workspaces apps and packages.
    • All configurations (eslint, jest, tailwind etc.) in packages are always prefixed with "config-" and imported into other workspaces directly from source without building (never transpiled).
    • All other packages beside configurations are always being built/transpiled to dist/ folder.
  • Merging to main branch deploys to stage environment, creating new GitHub release deploys to production.
  • Monorepo doesn't implement any high-level architectures (islands, micro-frontends), but is prepared with that in mind, so it can be easily extended (page composition, adding shared state etc.)

frontend-monorepo-boilerplate's People

Contributors

mkosir 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.