Mark Schiefelbein, Nov 09

How to Start a Developer Newsletter

Learn how to start your own awesome development newsletter with Revue's Mark Schiefelbein.
Design & UX
Paul Maplesden, Nov 06

How to Supercharge Your Product Design Workflow with CloudApp

We'll show you how to improve your workflow by bringing together teams, communicating smarter, and working on a consistent version of the product.
Michiel Mulders, Nov 01

How to Deploy Node Applications: Heroku vs Now.sh

Michiel Mulders compares Heroku and Now.sh, showing how to deploy Node apps to each service and looking at additional features like monitoring and logging.
Design & UX
Luke Hay, Nov 01

Getting to Know Your Users With Analytics

There’s a lot of data available in your analytics package that will help build up your knowledge of who’s visiting your website.
Tom Butler, Oct 31

Your First PHP Code

Now that you have your virtual server up and running, it’s time to write your first PHP script. PHP is a server-side language.
Design & UX
Jessica Enders, Oct 31

Designing Form Layout: Color

Human beings are sensitive to color. We process it without us even realizing, and we can’t help noticing differences. This is useful in form design.
Lee Brandt, Oct 30

Build a React App with User Authentication in 15 Minutes

This article originally appeared on the OKTA blog. Thank you for supporting the partners who make SitePoint possible.

React has quickly become one of the most favored front-end web frameworks, and is second only to plain old HTML5, according to JAXenter. So it’s no surprise that developers are learning it, and employers are asking for it.

In this tutorial, you’ll start with a very simple React app with a couple of pages and some routing built in, and add authentication using Okta’s Sign-In Widget. The Sign-In Widget is an embeddable Javascript widget that allows developers to use Okta’s secure, scalable architecture with a minimum of effort from within React applications. Let’s get started!

Get the Simple React Seed Project

Start by cloning the simple React seed project.

git clone https://github.com/leebrandt/simple-react-seed.git okta-react-widget-sample
cd okta-react-widget-sample

Add the Okta Sign-In Widget

Install the Okta Sign-In Widget using npm.

npm install @okta/okta-signin-widget@2.3.0 --save

This will add the Okta Sign-In Widget code to your node_modules folder. We’ll be using version 2.3.0 of the Sign-In Widget.

Okta in node_modules

Then add the styles for the widget in your index.html file from the Okta CDN. Add these lines inside the <head> tag:


    <!-- Theme file: Customize or replace this file if you want to override our default styles -->

The LoginPage Component

First, create a folder called auth in the ./src/components folder, then create a file called LoginPage.js where the LoginPage component will go.

Start with the most basic of components:

import React from 'react';

export default class LoginPage extends React.Component{
      <div>Login Page</div>

This little component doesn't do much but at least you now have a handle to add the LoginPage to your routing. So in your ./src/app.js file, you'll import the component at the top:

import LoginPage from './components/auth/LoginPage';

and then add the route inside the main route (the one with the path of "/")

<Route path="/login" component={LoginPage}/>

Add the OpenID Connect Application in Okta

In order to use Okta as your OpenID Connect provider for authentication, you’ll need to set up an application in the Okta developer console.

If you don't have an Okta developer account, go create one! Once you're logged in, click on Applications in the top navbar, then click Add Application. Select SPA as the platform and click Next. Change the redirect URI to http://localhost:3000, and click Done. The application will be created with the following settings:

OIDC Application Settings

Now that you have an application created in Okta, you can set up the widget to talk to your new app!

Add the Widget to Your Component

import React from 'react';
import OktaSignIn from '@okta/okta-signin-widget';

export default class LoginPage extends React.Component{
    this.widget = new OktaSignIn({
      baseUrl: 'https://{oktaOrgUrl}',
      clientId: '{clientId}',
      redirectUri: 'http://localhost:3000',
      authParams: {
        responseType: 'id_token'

      <div>Login Page</div>

Copy the Client ID generated from your application's settings page and paste it over {clientId}. Make sure you also replace {oktaOrgUrl} with your Okta organization URL, which you can find by going back to the main Dashboard page in the developer console. Usually it will look like: https://dev-12345.oktapreview.com.

Thus far you've imported the OktaSignIn function from the Okta Sign-In Widget npm module you installed earlier. Next, in the constructor of the component, you initialized an instance of OktaSignIn with the configuration for the application. This way, the application code will be able to talk to Okta and Okta will recognize that this is the app you just created.

Show The Login Widget

Next, you’ll create the code to actually render the Sign-In Widget to the page! You'll need to change your render method to create an HTML element you can render the widget into. Make sure to get a reference to the element that will be rendered. Then, add a componentDidMount function to make sure you don't try to render the widget before the HTML element is on the page.

Design & UX
Jessica Enders, Oct 30

Designing Form Layout: Spacing

Human beings see things that are close to each other as being related. Conversely, things that are not related usually have some space between them.
Design & UX
Jessica Enders, Oct 30

Designing Form Layout: Alignment

Create a straight, unobstructed, vertical path to completion. Now it's faster for your form to be filled out, and it looks neater and simpler too.
Bruno Skvorc, Oct 30

How to Optimize MySQL: Indexes, Slow Queries, Configuration

Here's a compendium of practical MySQL optimization tricks - from bottlenecks to configuration and indexes. Leave your ORM behind and get your hands dirty!
Design & UX
Emma Howell, Oct 28

Understanding the Core Concepts of User Research

In this section, we’re going to run through 10 concepts. These form the basic building blocks of effective user research design.
Design & UX
Ben Coleman, Oct 28

How to Make Paper Prototypes

There are no rules for making paper prototypes––that is what's great about it. You just need materials that are commonly found in any home or office.
Kaloyan Kolev, Oct 27

Quickly Create Simple yet Powerful Angular Forms

Forms are an essential part of most web applications. Kaloyan Kolev shows how to create template-driven and reactive Angular forms along with validation.
Design & UX
Daniel Schwarz, Oct 27

How to Prototype Interactions with Adobe XD

The following is a short extract from our book, Jump Start Adobe XD, written by Daniel Schwarz, a highly practical tutorial.
Design & UX
Dan Goodwin, Oct 27

UX: What Can We Prototype? What Can't We Prototype?

In this article, we'll look at some of the uses for prototypes -- and also some of the things that you shouldn't use prototypes for.
Glenn Goodrich, Oct 25

Understanding the Model-View-Controller (MVC) Architecture in Rails

Rails really takes the idea of separating an application's data, user interface, and control logic to a whole new level. In this article we'll see how.
Design & UX
SitePoint Team, Oct 25

5 Top Web Apps for Your Web Design Workflow

There’s a host of apps on the market that are designed to make web design easier. The ultimate goal behind these apps: to make the designer more productive.
Design & UX
Craig Buckler, Oct 24

How to Get Started with Material Design for Bootstrap

Craig Buckler shows you how to use Material Design for Bootstrap to build great websites for projects and clients faster.
Design & UX
Luke Hay, Oct 24

11 Common Analytics Pitfalls to Watch Out For

This article lists some of the main analytics pitfalls, and how they’re best avoided—to ensure your analysis paints a true picture of user behavior.
Design & UX
Luke Hay, Oct 23

Your Guide to Understanding Key Analytics Terms

For those not used to looking at website analytics, some of the terminology can seem like a foreign language.
Design & UX
Daniel Schwarz, Oct 20

How to Use Adobe XD's Smart Guides

Smart guides illustrate how objects align to one another — they can display the distance between layers, or whether a layer has snapped to another.
Jurgen Van de Moere, Oct 19

Top 12 Productivity Tips for WebStorm and Angular - Part 1

Jurgen Van de Moere shows you how to complete your Angular projects quickly with JetBrains' WebStorm IDE.
Design & UX
Emma Howell, Oct 19

How to Conduct User Research: Getting the Right People

Once you’ve decided who you want to include in the research, you’ll need a way to ensure that you’re actually getting those people.
Craig Buckler, Oct 19

How to Create Custom Components Using Component IO

Craig Buckler shows you how to create your first reusable component with Component IO.