This is a demo project illustrating how to integrate authentication between a React Native app built with Expo and a Laravel backend.
- 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.
- Node.js
- Expo CLI
- Laravel
- Composer
- MySQL or other database server
-
Clone this repository:
git clone https://github.com/ringkubd/react_native_expo_laravel_authentication
-
Go to app direcoty:
cd app -
Install packages (use yarn or npm):
npm i
-
Create .env file inside app folder.
touch .env
-
Put your backend URL
EXPO_PUBLIC_API_URL=http://192.168.20.231:8000/api
-
Finally run:
npx expo start
-
Go to backend direcoty:
cd backend -
Install packages:
composer install
-
Finally run (Replace (192.168.20.231) by your local ip):
php artisan server --host 192.168.20.231

