Giter Club home page Giter Club logo

sample-react-oauth's Introduction

Start your Development with an Innovative Admin Template for Material-UI and React. Soft UI Dashboard React is built with over 70 frontend individual elements, like buttons, inputs, navbars, nav tabs, cards, or alerts, giving you the freedom of choosing and combining. The product comes with a simple JWT authentication flow: login/register/logout.


๐Ÿš€ Built with React App Generator

  • โœ… Innovative Soft UI Design - Crafted by Creative-Tim
  • โœ… React, Redux, Redux-persist
  • โœ… Authentication: JWT, OAuth via GitHub
  • โœ… Full-stack ready using Node JS API Server (open-source project)
    • Features: Typescript / SQLite / TypeORM / Joy (validation) / Passport library - passport-jwt strategy.

Tests

Compatibility matrix using Ubuntu 18.04 LTS as reference.

NodeJS NPM YARN
v14.0.0 โœ… โŒ
v15.0.0 โœ… โŒ
v16.15.0 โœ… โœ…

React Soft Dashboard - Open-source full-stack product


Video Presentation

This material explains how to deploy the product LIVE using the Drag & Drop Deployer.

React Soft Dashboard, open-source fullstack project - Video Presentation.


โœจ 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

$ git clone https://github.com/app-generator/react-soft-ui-dashboard.git
$ cd react-soft-ui-dashboard

๐Ÿ‘‰ Step #2 - Install dependencies via NPM or yarn

$ npm i
// OR
$ yarn

๐Ÿ‘‰ Step 3 - Edit the .env using the template .env.sample.

REACT_APP_BACKEND_SERVER='http://localhost:5000/api/'

REACT_APP_GITHUB_OAUTH_CLIENT_ID     = ... # Github OAuth Client
REACT_APP_GITHUB_OAUTH_CLIENT_SECRET = ... # Github OAuth Secret
REACT_APP_GITHUB_OAUTH_REDIRECT_URL  = ... # Github OAuth Callback URL

๐Ÿ‘‰ Step #4 - Start the app using HTTPS (used bu AOuth Callback)

$ export HTTPS=true   # bash
$ set    HTTPS=true   # Windows/CMD
$env:HTTPS = "true"   # Windows/Powershell

๐Ÿ‘‰ Step #5 - Start in development mode

$ npm run start 
// OR
$ yarn start

โœจ Configure the backend server

The product comes with a usable JWT Authentication flow that provides only the basic requests: login/logout/register.

๐Ÿ‘‰ API Server URL - src/config/constant.js

const config = {
    ...
    API_SERVER: 'http://localhost:5000/api/'  // <-- The magic line
};

๐Ÿ‘‰ API Server Descriptor - POSTMAN Collection

The API Server signature is provided by the Unified API Definition

  • API POSTMAN Collection - can be used to mock (simulate) the backend server or code a new one in your preferred framework.

โœจ Node JS API Server

The product is also open-source and is already configured to work with Berry Dashboard Template - product features:

  • Typescript / Node js / Express server
  • JWT authentication (passport-jwt strategy)
  • Persistence: SQLite

Links


Node JS API - Open-source API server built on top of Express Nodejs Framework.


Compile the API Server

๐Ÿ‘‰ Step #1 - Clone the project

$ git clone https://github.com/app-generator/api-server-nodejs.git
$ cd 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

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



React OAuth Sample - Provided by AppSeed.

sample-react-oauth's People

Contributors

app-generator avatar fullstackkdev avatar

Watchers

 avatar  avatar  avatar

sample-react-oauth's Issues

API URI - Wrong Sign IN URL

Hello @FullStackkDev

The SignIN/SignUP is not working.

The URI used to communicate with the API is changed:

  • current SignIN URI: http://localhost:5000/api/login
  • correct SignIN URI: http://localhost:5000/api/users/login

Same issue with the registration.

Please take a look. Ty!


The expected URLs are listed below:

  • REACT_APP_BACKEND_SERVER='http://localhost:5000/api/'
    • Format: PROTO + IP + PORT + (suffix) /api/
    • terminated in slash
  • SIGN_IN is the backend server (above value) + users/login
  • SIGN_UP is the backend server (above value) + users/register

image

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.