Git Product home page Git Product logo

react-semantic.ui-starter's Introduction

React-Semantic.UI-Starter

Out-of-box:

Build Status codecov bitHound Dependencies bitHound Dev Dependencies bitHound Code bitHound Overall Score JavaScript Style Guide

What is it?

Production-ready, performance-first, optimized, robust, fully-featured boilerplate/example with Server-side rendering and lazy-loading for your new Progressive Web App.

Lighthouse result - you can find it here

SPOILER: 97/100. It might be better/worse in your browser.

Includes:

Usage

Install:

git clone --depth=1 https://github.com/Metnew/react-semantic.ui-starter.git
cd react-semantic.ui-starter && rm -rf .git
npm install

ENV vars:

BASE_API - App uses this path for requests with relative urls. By default http://localhost:4000/api/v1 - json-server. BASE_API is required for npm run ssr, npm run dev, npm run build

Run:

###############################################################
npm run dev # run app in dev mode, BASE_API env var is required!
###############################################################
npm run db  # run mock db for app(from another process)
###############################################################
npm run ssr # run server-side rendering (IT NEEDS already built app) and BASE_API env var is required!
###############################################################

Build:

###############################################################
npm run build # build app, accept next env vars:
# APP_LANGUAGE=ru npm run build - build only selected language, if isn't set, then build app with all i18n languages!
# ANALYZE_BUNDLE npm run build - add `webpack-bundle-analyzer` to plugins
npm run build:demo # build with process.env.BUILD_DEMO = true
###############################################################

These commands generate the dist folder.

Test:

npm run test # run tests with Jest, BASE_API env var is required!

Lint:

npm run lint:styles  # lint styles with Stylelint
npm run lint:scripts # lint scripts with ESlint

Docs:

npm run docs # generate docs and `serve`

Nearest future:

  • Project must be isomorphic (design in progress). Code must somehow works with React-Native too. I'll be very happy, if you can help me with this task ๐Ÿ˜‰, or just recommend something.
  • Bundle server-side code with Webpack (testing implementation, in master branch soon)
  • SSR with HMR(testing implementation, in master branch soon)
  • Improved docs || how-it-works guide || article (in progress) - project lacks some info about implementation and design.

FAQ

Where are static assets?

You can store static assets (images, videos) in /static folder.

Where is manifest.json?

You can find it in webpack_config/config.js

Is SSR available?

Yes! Check /src/server/server.js. App uses rapscallion for async rendering on server.

How lazy-loading implemented:

Check src/common/routing/index.js. TL;DR: dynamic import().

Is theming available?

Yes, with styled-components's <ThemeProvider> you can specify your own theme. By default, app uses theme from www.materialpallette.com.

How it differs from other starters?

App is designed for big projects. Personally, I use almost similar boilerplate in production. Main purpose - build highly customizable isomorphic(!) skeleton for PWA, with SSR, code-splitting, following best practices.

"You have a components folder and containers folder..and in the container you have another components folder?"

Components inside containers/**/components are components that are required by container.

For example, Dashboard(container) has DashboardComponent(component). You can think about DashboardComponent as "Isolated component", it isn't used in app anywhere except own parent-container.

Components in components are components that:

  1. Don't have own logic and connection with state (as opposite to containers)
  2. Aren't "isolated".(!)

Where are tests?

There are tests for actions and for reducers. Each reducer/action has own folder, where you can find:

  1. Reducer/action itself.
  2. Tests for it.

How to write tests?

You can find action testing example here. It uses redux-mock-store.

How does the built app look?

Like this.

Also:

Have a question? Ask it. ๐Ÿ˜‰

PRs, and issues are welcome ๐Ÿ˜ˆ

Author

Vladimir Metnew [email protected]

LICENSE

MIT

react-semantic.ui-starter's People

Contributors

metnew avatar squarism avatar engleek avatar ekoeryanto avatar jdickey avatar

Watchers

James Cloos avatar Gikuyu Nderitu 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.