• Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    TypeScript
  • Created almost 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A React/TypeScript fullstack boilerplate utilizing React hooks, using Express as backend, UIKit for frontend, MongoDB for storage & open-authenticator for OAuth.

RHUE: react-hooks-uikit-express-oauth-boiler-v2

Status

A React TypeScript boilerplate utilizing React hooks, using Express as backend, UIKit for frontend, MongoDB for storage & open-authenticator for oauth.

Demo website.


Features

  • Webpack+Babel for the client
  • Full TypeScript support for server and client
  • User authentication:
    • email/password (basic/lightweight mode)
    • via open-authenticator(Google, Twitter, LinkedIn, etc.).
  • Auth method merging, linking and unlinking of social accounts. (Only if using open-authenticator).
  • Client
    • React, backed by UIKit components/layout/icons
    • React hooks for state management
    • Mocked auth-gated data example
    • Dynamic UI elements that generate from with open-authenticator, based on your config
  • Server
    • Express server
    • Async/await design with await-to-js error handling
    • MongoDB for storage, via mongoose.
    • Auth-based route guarding
  • TLS/HTTPS:
    • Automatic certificate generation if running composition
    • Simple/dev mode (http only, custom port), for use with reverse proxy configurations or for basic http operation.

Running in basic mode

# clone the repository
$ git clone https://github.com/Scharkee/react-hooks-uikit-express-oauth-boiler-v2.git

# switch to the folder
$ cd react-hooks-uikit-express-oauth-boiler-v2

# install dependencies. If you would rather use npm, try npm i. npm run SCRIPT for things below.
$ yarn

# perform guided setup
$ yarn setup

# build the client and launch everything in devmode on port 8080.
$ yarn dev

# launch in production mode on the port that was chosen when setting up (default 80)
$ yarn launch

Running in composition mode (OAuth-ready)

This takes care of the database, routing, HTTPS certificate generation, and OAuth for you.

Make sure to use mongodb://mongo:27017/boiler as the mongooseConnectionString in the config, if you're running in composition mode.

# clone the repo
$ git clone https://github.com/Scharkee/react-hooks-uikit-express-oauth-boiler-v2.git

# switch to the folder
$ cd react-hooks-uikit-express-oauth-boiler-v2

# perform configuration
$ yarn && yarn setup

# launch!
$ docker-compose up

# At this point you can access everything through your domain,
# as long as it is properly pointed towards your IP.
# However, you will not see any OAuth options yet at the login or profile.

Enabling OAuth logins

In order to enable OAuth logins, run:

# Configure your OAuth strategies (configure open-authenticator):
$ docker exec -it authenticator yarn setup

# After you are happy with the configurations restart the container.
# The config will be persisted locally in config/open-authenticator.
$ docker restart authenticator

# Upon restarting, open-authenticator will automatically install all required dependencies.
# You are good to go!

Domain setup

If running in composition mode, you must have two domains pointed to your IP:

  • One for the boilerplate (e.g. boilerplate.yourdomain.com)
  • One for open-authenticator (e.g. auth.yourdomain.com)

The HTTPS certificates will be generated for you when you run the composition, as long as these domains are indeed pointed to the machine you are running it on.

open-authenticator instance for testing

If you would like to test everything out, but can not set up open-authenticator for one or more reasons, you can use this instance:

"client" : "boiler_C22nynzEB7S3gKCCSzaDKuFX"
"url": "https://auth.ensio.hefa.lt"

This open-authenticator instance contains strategies for Google, Twitter and GitHub.

Do not use this in production, since this client will be removed after some time, and it may not always be online.

Information & sources

Check out open-authenticator: open-authenticator GitHub

React docs can be found here: React docs.

Read about React Hooks here

Read about UIKit here

Contribution & Support

Submit bugs and requests through the project's issue tracker. You are also very welcome to contribute :)

Issues

License

This project is licensed under the terms of the MIT license.

More Repositories

1

netcore-postgres-oauth-boiler

A basic .NET Core website boilerplate using PostgreSQL for storage, Adminer for db management, Let's Encrypt for SSL certificates and NGINX for routing.
C#
64
star
2

react-redux-passport-uikit-express-boiler

A React+Redux boilerplate using Express as backend, UIKit for frontend, MongoDB for storage & Passport for auth.
JavaScript
59
star
3

vue-nuxt-passport-bulma-express-boiler

A Vue+Vuex starter with Nuxt scaffolding, Bulma styling, and Express backend.
JavaScript
22
star
4

slim-video-host

A Vue-based, easily deployable video hosting site. Uses Nuxt scaffolding, local storage powered by NeDB, ElementUI frontend elements. Features robust administration tools, and support for large files without compression/lossiness.
Vue
12
star
5

open-authenticator

A stateless, minimal, dockerized authentication service for easy auth management. Supports custom strategies and a wide variety of PassportJS strategies.
TypeScript
8
star
6

gps-scramble

A tool for controlled randomization of GPS coordinates.
TypeScript
7
star
7

easy-currencies

easy-currencies - A tool for easy conversion of currencies.
TypeScript
7
star
8

docker-vuestorefront-magento2

A composition that automatically sets up Magento 2 along with Elasticsearch and Kibana, and links up to vue-storefront.
Shell
6
star
9

react-native-nativebase-go-boiler

A React-Native/Redux/Native-Base/Go full stack boilerplate for building Android and IOS apps.
JavaScript
3
star
10

paxful-tracker

A tool for tracking the courses of currency pairs on Paxful.
TypeScript
2
star
11

x86-frogger

A primitive recreation of classic Frogger as a project for the Computer Organization course(CSE1400) at Delft University of Technology.
Assembly
2
star
12

schpamm

AutoHotkey
1
star
13

CSE3000

Python
1
star
14

express-fileupload-membufferless

Simple express middleware for uploading files. Adapted to work with large files by removing in-memory blob concatenation.
JavaScript
1
star