Giter VIP home page Giter VIP logo

arc's Introduction

arclogo2

Standard Style Build Status Coverage Status

ARc (Atomic React) is a React starter kit based on the Atomic Design methodology. It's progressive, which means that you can start with the basic boilerplate and try the other features when you are comfortable.

See the demo.

Branches

The basic stack with React, Webpack, react-router and Jest.

Master plus redux, redux-saga and redux-form.

Redux plus Server Side Rendering (everything works with javascript disabled, even the forms).

Universal plus REST API.

yeoman-generator (soon)

Generate components, redux stores, API endpoints and the entire project through a CLI utility (e.g. $ yo arc:component).

Forks

Did you fork this repo and made something different? Add it to this section and send a PR.

Why

I've been a web developer for the past 14 years, and after dealing with IE vs. Netscape wars, <table> layouts and flash websites I can say we live now the best moment in web development. Web components are awesome and React makes it better.

React stimulates you to create very small and pure components. However, as your project grows, you will have an increasing components folder. At some point, this will be really huge and hard to maintain.

I had a React project with more than 100 components in the components folder. The first approach I tried to organize it was separating the components by domain (described here), but I did realize that most of my components didn't belong to any domain, they were shared, so my problems were just moved to the commons folder.

The Atomic Design approach comes handy to solve this problem because it considers the reusability through composition, which is actually what React is. You will have your minimal/stylish components in one folder, pages in another and so on.

Download

Just clone the repository and remove the .git folder:

$ git clone https://github.com/diegohaz/arc my-app
$ cd my-app
$ rm -rf .git
$ npm install # or yarn

Usage

Run

Once you have installed the dependencies, you can use npm start to run a development server.

Deploy

Use npm run build to transpile the code into the dist folder. Then, you can deploy it everywhere.

Source code

The source code should be placed in src; public/static files should be placed in public so they can be included in the build process.

If you want to start with a clean and minimal source code without the predefined components and tests, just use the src-clean instead by renaming it to src (and removing or renaming the older one to something like src-example).

Because of webpack's config, we can import our source modules without relative paths.

import { Button, HomePage } from 'components' // src/components
import App from 'components/App' // src/components/App
import routes from 'routes' // src/routes

Components

This project leverages the Atomic Design methodology to create a scalable and easy to maintain component folder structure. See why.

However, Atomic Design should be a solution, not another problem. If you want to create a component and don't know where to put it (atoms, molecules, organisms etc.), do not worry, do not think too much, just put it anywhere. After you realize what it is, just move the component folder to the right place. Everything else should work.

This is possible because all components are dynamically exported on src/components/index.js and imported in a way that Atomic Design structure doesn't matter:

import { Button, Hero, HomePage, PageTemplate } from 'components'

To understand better the Atomic Design methodology, you can refer to the src/components folder here and the Pattern Lab Demo, which this project is based on. Basically, you can think this way:

  • An atom is a native html tag or a React Component that renders an html tag (e.g Input);
  • A molecule is a group of atoms (e.g. Field);
  • An organism is a group of atoms, molecules and/or other organisms (e.g. Form);
  • A page is... a page, where you will put mostly organisms (e.g. HomePage);
  • A template is a layout to be used on pages, see why templates are good practice.

Contributing

When issuing, use the following patterns in the title for better understanding:

[v0.3.1-redux] Something wrong is not right # the v0.3.1 release of the redux branch
[redux] Something wrong is not right # the actual code of the redux branch
Something wrong is right # general, related to master or not directly related to any branch

PRs are very appreciated. For bugs/features consider creating an issue before sending a PR. But there're other things you can contribute directly:

  • I'm not a native english speaker. If you find any typo or some text that could be written in a better way, please send a PR, even if it is only a punctuation;
  • If you forked or created another boilerplate based on this one with another features (using css-modules instead of styled-components, for example), add that to the Forks section with the following pattern:

Contributors

Thanks goes to these wonderful people (emoji key):

Prabhat Sharma
Prabhat Sharma

๐Ÿ’ป
Sven Schmidt
Sven Schmidt

๐Ÿ› ๐Ÿ’ป
Sebastian
Sebastian

โš ๏ธ

This project follows the all-contributors specification. Contributions of any kind welcome!

License

The MIT License (MIT)

Copyright (c) 2016 Diego Haz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

arc's People

Contributors

0xsven avatar diegohaz avatar prabhatsharma avatar ssmolinski9 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.