Git Product home page Git Product logo

react-redux-starter's Introduction

React Redux Starter

A boilerplate React project equipped with Redux and Material UI. Bootstrapped with Create React App, using the Redux and Redux Toolkit template.

Installation

Navigate to the project's root directory and run:

npm install

Create any of these .env files:

ENV File Description
.env Default
.env.local Loaded for all environments except test
.env.development Loaded on npm start
.env.production Loaded on npm run build
.env.test Loaded on npm test

Add these environment variables and replace their corresponding values:

REACT_APP_NAME=React Redux Starter
REACT_APP_API_BASE=http://localhost:8000/api/v1
REACT_APP_SESSION_KEY=react-redux-starter-session

Expected response body structure from login request

{
    "user": {
        "name": "John Doe",
        "email": "[email protected]",
        "roles": [
            {
                "id": 1,
                "name": "Admin",
            }
        ]
    },
    "token": ""
}
  • The user object must have a roles property which contains an array of roles. Roles must be mapped on src\utils\roles.js.
  • The token property's value will be automatically attached to the Authorization header of every HTTP request.

Available Scripts

npm start

Runs the app in the development mode.

npm test

Launches the test runner in the interactive watch mode.

npm run build

Builds the app for production to the build folder.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

npm run format

Format the code style of all relevant files in the src directory.

react-redux-starter's People

Contributors

ebuengamarvin avatar

Watchers

 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.