This project serves as a minimal template for rapid development, using Laravel as a REST API for the backend and React for the frontend, all styled with Tailwind CSS. It features user authentication and profile management, providing a solid foundation for building more complex applications.
- User signup and login.
- Profile viewing, updating, and deletion.
- Password change functionality.
- Protected routes using Laravel Sanctum for authentication.
- Mobile-first design approach with responsive layouts.
A branch raw
is also available, providing the same project without any styling. This is useful for those who prefer plain CSS or frameworks like Bootstrap instead of Tailwind CSS. The installation process remains the same; simply use git clone -b raw
to clone the repository.
demo.mp4
To get started with this project, follow the steps below:
-
Clone the repository
git clone https://github.com/cristianscheid/laravel-react-base.git cd laravel-react-base
-
Set up backend environment
-
Navigate to the backend directory (
laravel-react-base/backend/
). -
Install dependencies:
composer install
-
Set up environment variables:
cp .env.example .env
Open the
.env
file 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:
php artisan migrate
-
-
Set up frontend environment
-
Navigate to the frontend directory (
laravel-react-base/frontend/
). -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env
Open the
.env
file and set the API base URL to point to your Laravel application (default:http://localhost:8000
).
-
-
Start the servers
-
From backend directory (
laravel-react-base/backend/
):php artisan serve
-
From frontend directory (
laravel-react-base/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.