π Laravel Sanctum Authentication
π RESTful API Architecture
ποΈ MySQL Database Integration
π‘οΈ Security Best Practices
π Comprehensive Documentation
β‘ React 18 with Hooks
π¨ Tailwind CSS Styling
π± Responsive Design
π Axios HTTP Client
β‘ Vite Build Tool
Category
Technology
Version
Description
π§ Backend
Laravel
11.x
PHP Framework
βοΈ Frontend
React
18.x
JavaScript Library
π¨ Styling
Tailwind CSS
3.x
Utility-first CSS
ποΈ Database
MySQL
8.0+
Relational Database
π‘ HTTP Client
Axios
-
Promise-based HTTP
β‘ Build Tool
Vite
-
Frontend Tooling
π Project Architecture
ποΈ project-root/
βββ π§ backend/ # Laravel 11 API Server
β βββ π± app/ # Application Logic
β β βββ Http/Controllers/ # API Controllers
β β βββ Models/ # Eloquent Models
β β βββ Middleware/ # Custom Middleware
β βββ βοΈ config/ # Configuration Files
β βββ ποΈ database/ # Migrations & Seeders
β β βββ migrations/ # Database Migrations
β β βββ seeders/ # Database Seeders
β βββ π£οΈ routes/ # API Routes
β βββ π .env.example # Environment Template
β
βββ βοΈ frontend/ # React Application
βββ π± src/ # Source Code
β βββ components/ # React Components
β βββ pages/ # Page Components
β βββ services/ # API Services
β βββ utils/ # Utility Functions
βββ π public/ # Static Assets
βββ π¦ package.json # Dependencies
βββ βοΈ tailwind.config.js # Tailwind Configuration
π§ Backend Requirements
Component
Version
Status
PHP
>= 8.2
Composer
Latest
MySQL
>= 8.0
βοΈ Frontend Requirements
Component
Version
Status
Node.js
>= 18.0
NPM
>= 8.0
Yarn
>= 1.22
# π Clone the project
git clone < repository-url>
cd project-root
# π Navigate to backend
cd my-project-backend
# π¦ Install dependencies
composer install
# π Setup environment
cp .env.example .env
# π Generate application key
php artisan key:generate
# ποΈ Run migrations
php artisan migrate
# π± Seed database (optional)
php artisan db:seed
# π Navigate to frontend
cd ../my-project-frontend
# π¦ Install dependencies
npm install
# or
yarn install
# π Create environment file
touch .env
π§ Backend Configuration
# ποΈ Database Configuration
DB_CONNECTION = mysql
DB_HOST = 127.0.0.1
DB_PORT = 3306
DB_DATABASE = laravel_react_db
DB_USERNAME = your_username
DB_PASSWORD = your_password
# π Laravel Sanctum
SANCTUM_STATEFUL_DOMAINS = localhost:5173
# π CORS Configuration
FRONTEND_URL = http://localhost:5173
βοΈ Frontend Configuration
π Create frontend/.env
# π API Configuration
VITE_API_URL = http://localhost:8000/api
VITE_APP_URL = http://localhost:5173
# π Authentication
VITE_SANCTUM_STATEFUL_DOMAINS = localhost:8000
π₯οΈ Development Servers
π Start Both Servers Simultaneously
π§ Terminal 1 - Laravel API
cd backend
# π Start Laravel server
php artisan serve
βοΈ Terminal 2 - React App
cd frontend
# π Start React server
npm run dev
We welcome contributions! π
π΄ Fork the repository
πΏ Create your feature branch (git checkout -b feature/AmazingFeature)
πΎ Commit your changes (git commit -m 'Add some AmazingFeature')
π€ Push to the branch (git push origin feature/AmazingFeature)
π Open a Pull Request
This project is licensed under the MIT License.
Need help? We're here for you! πͺ
π Star this repository if you found it helpful! π
Made with β€οΈ by Shoyo