Git Product home page Git Product logo

arch-ref-react's Introduction

React Architecture

  • React
  • Custom Create react app
  • Reuse components
  • Tests with Jest and Enzyme

This is your source code tree:

src
|-- assets
|-- components
|-- containers
|-- pages
|-- routes
|-- services
|-- helpers
|-- App.js
|-- index.js
...

Every item created inside components, containers, pages... will be a folder with their code, the tests file, and to keep your code simple and short you can add extra files for helpers or styles it this folder. The folder structure will look like this:

components
|-- YouComponent
    |-- index.js
    |-- ComponentName.test.js
    |-- styles.js
    |-- // Extra files for things like helpers or styles
...

Folders description

./assets

Here will be all your project assets as images, icons...

./components

Components are presentational only elements, grouping UI items

./containers

Containers are responsible for connecting components with services and global state management. All the logic stays here, to keep components only with visual concerns

./pages

Pages are mapped in routes and have all the components needed to implement a functionality

./routes

Routes contains the react-router-dom implementation to map the project's routes to the respective pages

./services

Services are responsible to handle the connection with all external elements, like APIs

./helpers

Directory to keep all helpers functions to share all over the project


Scripts

Server from develop

npm start

Code from build

npm run build

Running tests

npm test

Running tests coverage

npm run coverage

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.