Setup Nhost with React
Get up and running with Nhost and React
Create Project
If you haven’t, please create a project through the Nhost Dashboard.
Setup Database
Navigate to the SQL Editor of the database and run the following SQL to create a new table movies
with some great movies.
Track this
is enabledpermissions
Select the new table movies
just created, and click in Edit Permissions to set the following permissions for the public
role and select
action.
Setup a React Application
Create a React application using Vite.
Install the Nhost package for React
Navidate to the React application and install @nhost/react
.
Configure the Nhost client and fetch the list of movies
Create a new file with the following code to creates the Nhost client.
<subdomain>
and <region>
with the subdomain and region for the projectFinally, update ./src/App.jsx
to fetch the list of movies.
The end
Run your project with npm run dev -- --open --port 3000
and enter http://localhost:3000
in your browser.