Skip to content

ringkubd/react_native_expo_laravel_authentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Native Expo with Laravel Sanctum Authentication

This is a demo project illustrating how to integrate authentication between a React Native app built with Expo and a Laravel backend.

Features

  • User Login: Users can log in using their registered email and password.
  • Authentication Middleware: Protects routes from unauthorized access.
  • Token-based Authentication: Uses santum token for authentication.
  • Redux-tollkit: Uses redux-tollkit for api.

Requirements

  • Node.js
  • Expo CLI
  • Laravel
  • Composer
  • MySQL or other database server

Installation

Frontend (React Native with Expo)

  1. Clone this repository:

    git clone https://github.com/ringkubd/react_native_expo_laravel_authentication
    
  2. Go to app direcoty:

    cd app
    
  3. Install packages (use yarn or npm):

    npm i
    
  4. Create .env file inside app folder.

    touch .env
    
  5. Put your backend URL

    EXPO_PUBLIC_API_URL=http://192.168.20.231:8000/api
    

Alt text Alt text

  1. Finally run:

    npx expo start
    

Backend (Laravel 11)

  1. Go to backend direcoty:

    cd backend
    
  2. Install packages:

    composer install
    
  3. Finally run (Replace (192.168.20.231) by your local ip):

    php artisan server --host 192.168.20.231

About

Laravel 11 sanctum and React Native Expo authentication demo

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published