Skip to content

app-generator/react-node-js-material-kit-pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

React Node Material Kit PRO

Material Kit PRO React features over 1000 individual components, giving you the freedom of choosing and combining. The product comes with a simple JWT authentication flow: login/register/logout powered by a Node JS API Server (PRO version).


Features

  • Premium Material UI design - Designed by Creative-Tim
  • React, Redux, Redux-persist
  • Authentication: JWT Login/Register/Logout
  • Backend Server- Node JS API Server PRO
    • SQLite / TypeORM / Joy / Docker
    • MongoDB / Mongoose / Joy Docker (separate branch, same project)

React Node Material Kit PRO - Full-stack product built in React and Node JS by AppSeed and Creative-Tim.


How to use it

To use the product Node JS (>= 12.x) is required and GIT to clone/download the project from the public repository.

Step #1 - Clone the project (private repository)

$ git clone https://github.com/app-generator/priv-react-material-kit-pro.git
$ cd priv-react-material-kit-pro

Step #2 - Install dependencies via NPM or yarn

$ npm i
// OR
$ yarn

Step #3 - Start in development mode

$ npm run start 
// OR
$ yarn start

Backend Integration

The backend API server address is saved in src/config/constant.js.

export const API_SERVER = "http://localhost:5000/api/";

Frontend api has been created at src/api/auth.js.

const axios = Axios.create({
    baseURL: `${baseURL}/api`,
    headers: { "Content-Type": "application/json" },
});

Register implementation:

  • Frontend method with call to backend
  • Form validation
  • Error handling

Login implementation:

  • Frontend method with call to backend
  • Form validation
  • Error handling

Logout implementation:

  • Frontend method with call to backend

User Context:

  • The user account is now saved both to the React.Context wrapper and localStorage

Protected routes:

  • The user cannot access protected routes like /admin, /rtl without being logged in.
  • Example of 3 different routes:
    <ProtectedRoute path="/admin" component={AdminLayout} />
    <ProtectedRoute path="/rtl" component={RtlLayout} />
    <Route path="/auth" component={AuthLayout} />

API Descriptor

The product uses implements a Unified API definition exposed by all API servers crafted by AppSeed. For more information, please access the official documentation:


API Server Node PRO

Express / Nodejs Starter with JWT authentication, and SQLite or MongoDB persistance. Authentication Flow uses json web tokens via Passport library - passport-jwt.

Features

  • Simple, intuitive codebase - can be extended with ease.
  • Typescript
  • Data validation with Joy
  • Branches:
    • Master: NodeJS / Express / SQLite / TypeORM
    • Mongo: NodeJS / Express / MongoDB / Mongoose
  • Auth: Passport / passport-jwt strategy

How to use the code

Step #1 - Clone the project (private repository)

$ git clone https://github.com/app-generator/priv-api-server-nodejs.git
$ cd priv-api-server-nodejs

Step #2 - Install dependencies via NPM or yarn

$ npm i
// OR
$ yarn

Step #3 - Run the SQLite migration via TypeORM

$ yarn typeorm migration:run

Step #4 - Start the API server (development mode)

$ npm dev
// OR
$ yarn dev

Step #5 - Production Build (files generated in build directory)

$ npm build
// OR
$ yarn build

Step #6 - Start the API server for production (files served from build/index.js)

$ npm start
// OR
$ yarn start

The API server will start using the PORT specified in .env file (default 5000).


React Node Material Kit PRO - Provided by Creative-Tim and AppSeed App Generator.

About

React Node JS - Material Kit PRO React | AppSeed

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published