Code Monkey home page Code Monkey logo

always-on-home's Introduction

Create React App Starter with Router, Material UI,

Node.js CI

About:

This repo contains the starter setup that I always spend way too much time setting up and gathering:

Live Demo Using Github Actions we deploy to the free static hosting Github Pages https://madmaxlax.github.io/react-materialui-router-typescript-starter/

How to use

Download the example or clone the repo:

Install it and run:

yarn install
yarn start

This uses Prettier and ESLint, which are two extensions in VScode that help with auto-formatting

Note: For all packages in package.json, I used "latest" as the version. You may want to freeze them at their current latest version

Edit on CodeSandbox

The idea behind the example

I always spent way too much time with new projects setting up prettier, ESlint, React with Router and Material UI. I often used a template like https://github.com/creativetimofficial/material-dashboard-react but then would spend a lot of time scraping out their features to make my own.

This example demonstrates how you can use Create React App with Material UI and TypeScript: https://material-ui.com/guides/typescript/

Structure

  • /public
    • This is a create-react-app feature, raw files that will be served as-is, not involved in the compiling process at all, such as index.html and favicon.ico
  • /Assets
    • This is a create-react-app feature, for items such as scss or images that need to be used in your code or compiled
  • /Components
    • Where you put universally-reusable components for your app (such as link, or custom button)
  • /Layouts
    • Holding place for various layouts of your pages. Likely your pages will have a consistent header and footer and maybe menu. You could put that all in 1 layout here. Another layout might be your un-auth'd login page, which would have less templated stuff in it. Inspired by https://github.com/creativetimofficial/material-dashboard-react
  • /context
    • Where your contexts would be saved. if using redux, consider renaming to store
  • /pages
    • Where your various routes or different whole pages life. Each folder can contain the page content as well as any components that are unique to that page and wouldn't be shared across to the whole app (and moved to the /components folder)
  • /utils
    • Holding place for typescript models or other files / functions / utilities
  • /routes.tsx
    • List of routes/ references to the various pages
  • /theme.tsx
    • Starter for custom theming

optional Docker Container

a Dockerfile is included if you optionally want to run this as a container. Commands:

  • Build the container, then run it:
    • feel free to change the name and tag to anything instead of material-ui-starter, but be consistent
docker build -t material-ui-starter .
docker run --name material-ui-starter -p 3003:3003 material-ui-starter

always-on-home's People

Contributors

madmaxlax avatar

Watchers

 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.