Giter Club home page Giter Club logo

clean-react-app's Introduction

Clean React App

PRs Welcome Open Source Node Version React Version

Logo

Create React apps using Clean Architecture with no build configuration.

  • User Guide – How to develop apps bootstrapped with Clean React App.

Clean React App works on macOS, Windows, and Linux.
If something doesn’t work, please file an issue.

Quick Overview

npx @rubemfsv/clean-react-app my-app
cd my-app
npm start or npm run dev


This boilerplate contains the following settings:

  • Local storage adapter;
  • Axios as HTTP Client;
  • Webpack configured for development and production environments;
  • Basic end-to-end test settings with Cypress;
  • Unit tests with Jest;
  • Husky with pre-push to run unit tests;
  • Authentication with validations;
  • Validation layer for reuse of validations;
  • Some hooks to help with API calls and form submissions;
  • Private route configured;
  • Three pages to help improve productivity:
    • Login page
    • Sign up page
    • Dashboard


πŸ‘· Installation

You must first have installed NodeJS (I recommend nvm to deal with versions), Yarn, and then:

git clone https://github.com/rubemfsv/clean-react-app.git

Step 1:

cd clean-react-app - access the project files

Step 2:

yarn (or npm install) - to install dependencies

Step 3:

Change your webpack.dev.js and webpack.prod.js env url to your real urls

Step 4:

yarn dev (or npm run dev) - to initialize the project under development

Observations:

yarn test (or npm run test) - to run jest unit testing

yarn test:e2e (or npm run test:e2e) - to run cypress e2e testing (if you use linux or windows, the command may change because of the , but you can change the script or run it by node_modules/.bin/cypress open)

yarn start (or npm start) - to initialize the project under production webpack;

In the package.json file, there are scripts that you can run with node and yarn



πŸ“‚ Architecture

The architecture used in this project was the Clean Architecture, using the concepts proposed by Roberto Martin. To know how to implement this architecture, there is an article applying this Architecture with React that describes very well the thought line.

cypress/
src/
  data/
    protocols/
    test/
    usecases/
  domain/
    errors/
    models/
    test/
    usecases/
  infra/
    cache/
    http/
    test/
  main/
    adapters/
    config/
    decorators/
    factories/
      cache/
      decorators/
      http/
      pages/
      usecases/
    routes/
    scripts/
    index.tsx
  presentation/
    assets/
      fonts/
      images/
    components/
    hooks/
    pages/
    protocols/
    routes/
    styles/
    test/
  validation/
    errors/
    protocols/
    test/
    validators/

πŸ–₯️ Login page

It's a simple login page with a form and error handling. It already has input, button, field and loader components.

Login page

πŸ–₯️ Sign up page

It is a registration page with a form that receives the username, email, password and password confirmation. It already has error handling and reused components.

Sign up page

πŸ–₯️ Dashboard page

It is an empty page that is redirected after successful login. It's there to help with development, saving time by being the starting point.

Dashboard page



πŸ› Issues

If something doesn’t work, please file an issue.



πŸ“œ Code of Conduct

We are committed to providing a welcoming and safe environment in our community. All contributors, maintainers, and everyone participating in this project are expected to adhere to our Code of Conduct. Please read the full text so that you can understand what actions will and will not be tolerated.



πŸ“‘ Branches and contributions

As this project is intended to be open source and free for everyone to use, feel free to contribute improvements.

If something can be improved, just create a branch from main and make a Pull Request with the suggestions.



Contributors

Meet the talented individuals who have contributed to Clean React App project:



License

Clean React App is available under MIT. See LICENSE for more details.

clean-react-app's People

Contributors

rubemfsv avatar ashok-kumar-dharanikota avatar rockingrohit9639 avatar victorevh avatar oliviocandido avatar vijaykv5 avatar coldrohak avatar arnav-2004 avatar boredcity avatar vibh1103 avatar erikgmatos avatar tech3br 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.