Giter Site home page Giter Site logo

anhgeeky / admin-template-for-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bndynet/admin-template-for-react

0.0 0.0 0.0 4.73 MB

:earth_asia: Admin template for React, React Redux, Redux Saga, React Router, i18n and integrated OAuth login

Home Page: https://bndynet.github.io/admin-template-for-react/

License: MIT License

JavaScript 3.06% TypeScript 94.05% HTML 1.12% SCSS 1.76%

admin-template-for-react's Introduction

Admin Template for React

DEMO - Type any account to log in

code style: prettier

A starter admin template with React, React Redux, Material UI and TypeScript that packages using Webpack and integrates a minimal project structure.

Classic Layout screenshot

Popular Layout screenshot

  • AJAX component: axios
  • UI component: material-ui
  • REACT stack: react, react-dom, react-redux, react-router-config, react-router-dom, redux, redux-saga, react-intl-universal
  • You can custom theme in ./src/theme/config.tsx file

❯ Getting Started

  1. Clone repo git clone <git-url>
  2. npm install to install all dependencies
  3. npm start to start web server or npm run build to build production code into dist folder

❯ Development

Application Configuration Examples

  • ./src/config/app.common.tsx - all common configurations
  • ./src/config/app.dev.tsx - configurations used in local
  • ./src/config/app.prod.tsx - configurations used in production
  • ./src/config/app.github.tsx - example for github authorization
  • ./src/config/app.auth-code.tsx - example for authorization code grant type
  • ./src/config/app.auth-password.tsx - example for password grant type
  • ./src/config/app.mock.tsx - just for local development without login system

Customize more environments

  1. New file ./src/config/app.[env_name].tsx to override your configurations

  2. Recommend to import configurations in app.dev.tsx

    import config = require('./app.your-env');

    Or add below code in ./src/config/index.tsx or ./index.html to freeze your environment

    window.__APP_ENV__ = 'your-env';
  3. npm start and npm run build will always use the environment you defined

Components based on Material UI or some else

Alert, Loading, MiniCard, Notifier, Overlay, Panel, Tag, DataTable, ...

i18n/l10n Support

import * as intl from 'react-intl-universal';

const message = intl.get('i18nKey');

Available Services

  • import { service as resourceService } from "app/service/resource"; to call APIs which has appended access token in request header
  • import { getState as getAuthState } from "app/service/auth"; to get current user information

Debug with Chrome in Visual Studio Code

  1. Requires Visual Studio Code as IDE and extension Debugger for Chrome

  2. npm start to run application

  3. Click menu Debug > Start Debugging to debug with generated .vscode/launch.json file as below:

    {
        "version": "0.2.0",
        "configurations": [
            {
                "type": "chrome",
                "request": "launch",
                "name": "Launch Chrome against localhost",
                "url": "http://localhost:8080",
                "webRoot": "${workspaceFolder}"
            }
        ]
    }
  4. Set breakpoints in your vscode and operate in the new Chrome window Start Debugging opened

Recommendatory extensions for Chrome

  • React Developer Tools
  • Redux DevTools

Above extensions will show you the Actions, States and Reducers in Chrome console.

admin-template-for-react's People

Contributors

bndynet avatar dependabot[bot] avatar tpayne84 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.