A simple CRUD application designed to demonstrate the integration of Laravel with React via a RESTful API. This project provides a clear example of connecting a Laravel backend with a React frontend, featuring user authentication, login functionality, and basic operations for managing user data.
- Secure sign-up, login, and logout functionality using token-based authentication with Laravel Sanctum.
- Basic operations for creating, reading, updating, and deleting user records.
- Pagination on the frontend for navigating through user data.
- Feedback notifications for actions like adding, deleting, and updating records.
- Password validation and required field checks to ensure data integrity and correctness.
demo.mp4
To get started with this project, follow the steps below:
-
Clone the repository
git clone https://github.com/cristianscheid/users-crud.git cd users-crud -
Set up backend environment
-
Navigate to the backend directory (
users-crud/backend/). -
Install dependencies:
composer install -
Set up environment variables:
cp .env.example .envOpen the
.envfile and configure your database and other settings (you can keep the default settings to use SQLite for simplicity). -
Generate application key:
php artisan key:generate --ansi -
Run database migrations and seed the database:
php artisan migrate --seed
-
-
Set up frontend environment
-
Navigate to the frontend directory (
users-crud/frontend/). -
Install dependencies:
npm install -
Set up environment variables:
cp .env.example .envOpen the
.envfile and set the API base URL to point to your Laravel application (default:http://localhost:8000).
-
-
Start the servers
-
From backend directory (
users-crud/backend/):php artisan serve -
From frontend directory (
users-crud/frontend/):npm run dev
Once the application is running, you can access it at
http://localhost:5173.Distributed under the MIT License. See LICENSE.txt for more information.
-