Giter VIP home page Giter VIP logo

react-semantic.ui-starter's Introduction

React-Semantic.UI-Starter

Out-of-box:

DEMO: You can find it here

Build Status codecov David David Known Vulnerabilities

What is it?

Production-ready, performance-first, optimized, robust, fully-featured boilerplate/example for your new Progressive Web App.

Lighthouse result - you can find it here

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

DOMContentLoaded, and etc:

When app is cached with Service Workers:

Includes:

Usage

Install:

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

Run:

npm run dev # run app in dev mode
npm run db  # run mock db for app(from another process)

Build:

npm run build # build app
npm run build:demo # build with process.env.BUILD_DEMO = true

It generates dist folder.

Test:

npm run test # run tests with Jest

FAQ

Where is manifest.json?

You can find it in webpack_config/config.js

Is SSR available?

It's under active development inside /server folder.

How it differs from other starters?

Performance-first.
Main purpose - build highly customizable skeleton for PWA, with SSR, following best practices.

Is it official starter from semantic-ui-react ?

No, (currently no, but maybe... ๐Ÿ˜‰).

"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".(!)

As your app's components will increase in size, it can be refactored to similar structure that currently implemented in - semantic-ui-react.

JSON-server? Why?

Maybe it will be useful for some purposes in your project.

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 Auth works?

Migration from React-Router v3 to v4 may cause some problems.
There is no onEnter props in Route component.

So, we can solve it that way:

  1. Implement global routing object.
  2. Implement RouteAuth component that protects child component from unauthorized users.
  3. Pass function that checks is user allowed to visit route as prop in every RouteAuth component.
  4. When RouteAuth renders it calls that function.
  5. As authCheck function can call redux store, we can access redux's state before Route is rendered.
  6. Profit!!!!!
  7. We have access to redux state in function that allows Route to be rendered.
  8. Also, there is an additional handler for auth logic in App container.

How built app looks?

Like this.

Also:

Unstable branch with latest features.

Have a question? Ask it. ๐Ÿ˜‰

PRs, and issues are welcome ๐Ÿ˜ˆ

Author

Vladimir Metnew [email protected]

LICENSE

MIT

react-semantic.ui-starter's People

Contributors

athiwatp avatar metnew 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.