magiclabs / example-react-express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo

https://magic-react-express.herokuapp.com/login

Quick Start Instructions

Start server

$ git clone https://github.com/magiclabs/example-react-express.git
$ cd example-react-express
$ mv .env.example .env
$ yarn install
$ node server.js

Start client (in a new CLI tab)

$ cd client
$ mv .env.example .env
$ yarn install
$ yarn start

.env Files

There are two environment files for the application, one client-side and one server-side.

You can grab the REACT_APP_MAGIC_PUBLISHABLE_KEY (client/.env) and MAGIC_SECRET_KEY (.env) from Magic's Dashboard.

client/.env (client)

REACT_APP_MAGIC_PUBLISHABLE_KEY=pk_test_1234567890
REACT_APP_CLIENT_URL=http://localhost:3000

.env (server)

MAGIC_SECRET_KEY=sk_live_123...
CLIENT_URL=http://localhost:3000
  • Note: the tutorial was built using Magic UI components. If you swap them out for your own custom CSS, you can delete @magiclabs/ui and framer-motionfrom your client/package.json dependencies.

Tutorial

https://magic.link/posts/magic-react-express

About


Languages

Language:JavaScript 89.2%Language:HTML 10.1%Language:Shell 0.8%