• Stars
    star
    144
  • Rank 248,302 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 2 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Frontend Monorepo Boilerplate TypeScript / Tailwind / Material UI / Next.js

TypeScript semantic-release

CI CI CI CI

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 install
  • 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-next-static, 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-static)
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:

  • Code is organized and grouped by feature. Collocate code as close as possible to where it's relevant. β­£
  • Strive for data immutability. β­£
  • Strive for functions to be pure, stateless and have single responsibility. β­£
  • Majority of function arguments should be required (use optional sparingly). β­£
  • Embrace const assertions. β­£
  • Strong emphasis to keep naming conventions consistent and readable. β­£
  • Use named exports. β­£
  • Use of server-state library is encouraged (react-query, apollo client...). β­£
  • Use of client-state library for global state is discouraged. β­£
  • 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.
  • For consistency all applications in monorepo are built with Next.js, but can be easily replaced with any other React framework/tooling (Vite, Remix etc.)
  • 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.)

More Repositories

1

react-parallax-tilt

πŸ‘€ Easily apply tilt hover effect on React components - lightweight/zero dependencies (3kB)
TypeScript
900
star
2

typescript-style-guide

βš™οΈ TypeScript Style Guide. Concise set of conventions and best practices used to create consistent, maintainable code.
MDX
448
star
3

typeorm-express-typescript

πŸ’Š Minimal Express RESTful API boilerplate. Spin it up with single command. TypeScript, TypeORM, Postgres and Docker with focus on best practices and painless developer experience.
TypeScript
405
star
4

react-hook-mighty-mouse

🐭 React hook that tracks mouse events on selected element - zero dependencies
TypeScript
117
star
5

trpc-api-boilerplate

βš’οΈ Minimal tRPC API boilerplate for separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.
TypeScript
75
star
6

demozap

⚑ Create React components demos in a zap
TypeScript
55
star
7

react-demo-tab

πŸ“‘ React component to easily create demos of other components
TypeScript
40
star
8

trpc-fe-boilerplate-next

βš’οΈ Minimal tRPC frontend Nextjs boilerplate for separate BE-FE repositories. Easily consume fully typesafe APIs.
TypeScript
22
star
9

twit-wrapper

Twitter API client for Node.js
JavaScript
14
star
10

react-magnetic-board

🧲 Light, zero dependencies magnetic board component using HTML5 canvas
TypeScript
12
star
11

eslint-plugin-no-array-reduce

🚫 ESLint rule to disallow Array.reduce() method
TypeScript
11
star
12

prisma-next-typescript

πŸ’Š Minimal RESTful API boilerplate. Spin it up with ease. TypeScript, Prisma, Next.js and Postgres with focus on best practices and painless developer experience.
TypeScript
11
star
13

RocketMission

WinForms application using C# .NET 2.0
C#
10
star
14

vagrant-ubuntu-lamp-xdebug

Vagrant implementation of LAMP stack running on Ubuntu using PHP 7 and Xdebug with minimum dependencies installed.
Shell
9
star
15

DropMVC

πŸ’§ Lightweight PHP MVC framework
PHP
7
star
16

fb-wrapper

Facebook API client for Node.js
TypeScript
5
star
17

trpc-fe-boilerplate-vite

βš’οΈ Minimal tRPC frontend Vite boilerplate for separate BE-FE repositories. Easily consume fully typesafe APIs.
TypeScript
5
star
18

react-use-ark

Hook to easily access ARK blockchain Ρ¦ API in React application
TypeScript
1
star