Directual + React JS
The path to building a React app without infrastructure hassles 🤘
Last updated
The path to building a React app without infrastructure hassles 🤘
Last updated
Find the step-by-step manual and boilerplate code on GitHub.
With Directual, you can set up your entire backend for a React App in under 15 minutes. Plus, any necessary changes to the database or API can be made almost instantly
Feel free to build your UI components as you're accustomed to, using classes, hooks, etc. In your components, you can seamlessly integrate the following Directual features:
Authentication methods: login, logout, auth context
Getting data from the database
Posting data into the database.
Take a look at these code patterns:
There are two useful files in the Directual React Boilerplate:
auth.js: This file provides methods such as .user
, .sessionID
, .isAuthorized()
, and .hasRole()
setupProxy.js: It creates middleware proxy for directual-api to resolve CORS-related issues. To use this, you'll need to install http-proxy-middleware
.
Additionally, make sure to edit the .env
file to connect with your Directual app. In the .env
file, set:
APP_ID=
YOUR_APP_ID
You can find (or create) your App ID in the API section:
Here is a live demo of the development process: