All Projects → netzwerg → react-you-do-you

netzwerg / react-you-do-you

Licence: MIT license
How I use React + Redux + Material-UI + TypeScript – you do you 💖

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to react-you-do-you

react-typescript-material-ui-with-auth-starter
React + Material UI + Auth starter using TypeScript
Stars: ✭ 27 (-73.79%)
Mutual labels:  create-react-app, material-ui, starter-template
Starter React Flux
Generate your React PWA project with TypeScript or JavaScript
Stars: ✭ 65 (-36.89%)
Mutual labels:  create-react-app, material-ui, prettier
create-material-ui-app
create-react-app + storybook + storybook-addon-material-ui
Stars: ✭ 55 (-46.6%)
Mutual labels:  create-react-app, material-ui, storybook
React Crm
A reusable CRM project for real-world business based on React 16, Redux & Material-UI 4
Stars: ✭ 307 (+198.06%)
Mutual labels:  material-ui, react-redux, storybook
React Social Network
Simple React Social Network
Stars: ✭ 409 (+297.09%)
Mutual labels:  create-react-app, material-ui, react-redux
Create React App Redux
React Router, Redux, Redux Thunk & Create React App boilerplate
Stars: ✭ 885 (+759.22%)
Mutual labels:  create-react-app, react-redux
React Antd Admin Template
一个基于React+Antd的后台管理模版,在线预览https://nlrx-wjc.github.io/react-antd-admin-template/
Stars: ✭ 1,022 (+892.23%)
Mutual labels:  create-react-app, react-redux
React Redux Example
React Redux Example
Stars: ✭ 54 (-47.57%)
Mutual labels:  create-react-app, react-redux
React Admin
基于[email protected]的react动态权限后台管理系统模板
Stars: ✭ 151 (+46.6%)
Mutual labels:  create-react-app, react-redux
Youtube React
A Youtube clone built in React, Redux, Redux-saga
Stars: ✭ 421 (+308.74%)
Mutual labels:  create-react-app, react-redux
P32929.github.io
Second iteration of my portfolio - created using ReactJS, Material-UI, Overmind, etc
Stars: ✭ 84 (-18.45%)
Mutual labels:  create-react-app, material-ui
Cra Recipe
Step-by-step guide to bootstrap a CRA app from scratch.
Stars: ✭ 158 (+53.4%)
Mutual labels:  create-react-app, storybook
React Mobx React Router Boilerplate
A simple boilerplate based on create-react-app and add mobx, react-router, linter, prettier and so on. 一个简单的 react 脚手架依赖于 create-react-app 新增了 mobx react-router,linter,prettier 等。
Stars: ✭ 12 (-88.35%)
Mutual labels:  create-react-app, prettier
Todo React Redux
Todo app with Create-React-App • React-Redux • Firebase • OAuth
Stars: ✭ 942 (+814.56%)
Mutual labels:  create-react-app, react-redux
Web
⚡️ Supercharged version of Create React App with all the bells and whistles.
Stars: ✭ 594 (+476.7%)
Mutual labels:  create-react-app, material-ui
Conf
Landing page for event React Conf Brazil
Stars: ✭ 104 (+0.97%)
Mutual labels:  create-react-app, prettier
storybook-preset-craco
Craco preset for Storybook
Stars: ✭ 34 (-66.99%)
Mutual labels:  create-react-app, storybook
Wanna
💡✔ Wanna is an implementation of a 21st-century to-do list app.
Stars: ✭ 189 (+83.5%)
Mutual labels:  create-react-app, material-ui
promotion-web
基于React: v18.x.x/Webpack: v5.x.x/React Router v6.x.x/ Antd: v5..x.x/Fetch Api/ Typescript: v4.x.x 等最新版本进行构建...
Stars: ✭ 374 (+263.11%)
Mutual labels:  prettier, react-redux
Material Ui Superselectfield
multiselection autocomplete dropdown component for Material-UI
Stars: ✭ 260 (+152.43%)
Mutual labels:  create-react-app, material-ui

react-you-do-you

badge

An example of how I use React + Redux + Material-UI + TypeScript.

Or: The code I wish existed when I got started.
Or: A project template to start off on the right foot.

This is how I do it – you do you 💖

Deployed live version: https://netzwerg.github.io/react-you-do-you

Setup & Tooling

Structure

Organize by feature:

  • Each feature gets its own folder

  • Defines its own slice of models/actions/reducer

  • Defines its own components, clearly separated into presentation (inside components folder) and glue-code/logic (inside containers folder)

State Management

  • Keep state in a fully typed, immutable model:

    • Use interfaces or type aliases rather than classes (rule of thumb: prefer interfaces because they give better compile error message, use type aliases for sum type awesomeness)

    • Use TypeScript’s readonly keyword and Readonly[Array|Stream|Set|Map] utility types

  • Use Redux Toolkit, an "opinionated, batteries-included toolset for efficient Redux development"

    • Compose feature-specific reducers

    • Write container components to connect presentation components to the Redux store. Why? Presentation components are more re-usable if they don’t know how state is shaped nor how it’s managed.

    • Use redux-thunk for async actions

    • Optional: Write Reducers with Immer

Broad Overview

container vs component

User Interface

Use Material UI 5, a React component library based on Material Design:

  • Huge selection of components, fully customizable

  • Theme support (e.g. light vs dark)

  • tss-react type-safe CSS styling

Testing

I am mostly developing prototypes these days, so I am not an expert when it comes to testing. However, this is the minimum I always test:

  • Slices: Making sure each action is handled correctly (~80% of my logic)

  • Error-free rendering of each component ("Rendering Smoke Tests")

Storybook

The project contains a full Storybook configuration. Writing stories for your UI components allows building & testing them in isolation. Example stories are contained in src/stories.

To run locally:

yarn run storybook

Continuous Integration & Delivery

On every push or pull request, a set of GitHub Actions are kicked off:

  • Run all tests

  • Check for circular dependencies

  • Build & deploy the app

If successful, the app is available on https://<username>.github.io/<reponame>; (via GitHub Pages).

Usage

Explore Locally

Warning
Requires Node ^14.17.0 || >=16.0.0 (Details)
git clone https://github.com/netzwerg/react-you-do-you.git
cd react-you-do-you
yarn install
yarn start

Feel free to use npm rather than yarn – I have a slight preference for yarn, mainly because of resolutions support

As Project Template

  • Rename root folder to my-fancy-new-project-name

  • Replace all occurrences of react-you-do-you with my-fancy-new-project-name

  • Remove existing Git repo: rm -rf .git

  • Initialize a new Git repo: git init

Available Scripts

yarn start

Compiles and runs the app in development mode.

Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any compile or lint errors in the console.

yarn test

Launches the test runner in interactive watch mode.

yarn run build

Builds the app for production to the build folder.

yarn run lint

Runs ESLint (with TypeScript support) on all *.ts or *.tsx files in the src directory.

yarn run lint:fix

Runs ESLint (with TypeScript support) on all *.ts or *.tsx files in the src directory, automatically fixing problems.

yarn run storybook

Runs Storybook

© Rahel Lüthy 2019-2022 MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].