A modern full-stack e-commerce platform built with Laravel and React, specializing in micro-camping and weekender tech gear.
- Modern Stack: Laravel 11 + React 18 + TypeScript + Vite
- Authentication: Laravel Sanctum SPA authentication
- Responsive Design: TailwindCSS for modern, mobile-first UI
- API-First: RESTful API architecture
- Developer Experience: Hot reloading, type safety, and modern tooling
- Production Ready: Optimized builds and deployment automation
βββ backend/ # Laravel 11 API Backend
β βββ app/ # Application logic
β βββ config/ # Configuration files
β βββ database/ # Migrations, factories, seeders
β βββ routes/ # API routes
β βββ ...
βββ frontend/ # React + TypeScript Frontend
β βββ src/
β β βββ components/ # React components
β β βββ hooks/ # Custom hooks
β β βββ services/ # API services
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Utility functions
β βββ ...
βββ deploy.sh # Deployment script
- PHP 8.2 or higher
- Node.js 20 or higher
- Composer 2.x
- MySQL 8.0+ (or SQLite for development)
- Git
git clone https://github.com/LXMachado/e-commerce-React-laravel-tailwind.git
cd e-commerce-React-laravel-tailwind# Navigate to backend directory
cd backend
# Install PHP dependencies
php ../composer install
# Copy environment file
cp .env.example .env
# Generate application key
php artisan key:generate
# Configure database in .env file
# DB_CONNECTION=sqlite (for development)
# or configure MySQL connection
# Run migrations
php artisan migrate
# Seed database (optional)
php artisan db:seed# Navigate to frontend directory
cd frontend
# Install Node dependencies
npm installUpdate the backend .env file with your configuration:
APP_NAME="Weekender E-commerce"
APP_ENV=local
APP_KEY=base64:your-generated-key
APP_DEBUG=true
APP_URL=http://localhost:8000
DB_CONNECTION=sqlite
# or for MySQL:
# DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=weekender_db
# DB_USERNAME=your_username
# DB_PASSWORD=your_password
SANCTUM_STATEFUL_DOMAINS=localhost:3000,127.0.0.1:3000
SESSION_DOMAIN=localhostYou can run both frontend and backend simultaneously:
# From project root
npm run devOr run them separately:
# Terminal 1 - Backend (Laravel)
npm run dev:backend
# Runs on http://localhost:8000
# Terminal 2 - Frontend (React)
npm run dev:frontend
# Runs on http://localhost:3000Backend (Laravel):
cd backend
php artisan serve --host=0.0.0.0 --port=8000Frontend (React):
cd frontend
npm run devnpm run buildnpm run buildnpm testcd frontend
npm run testcd backend
php artisan test# Lint all code
npm run lint
# Fix linting issues
npm run lint:fix# Format all code
npm run formatThe Laravel backend provides a RESTful API. Key endpoints include:
POST /api/register- User registrationPOST /api/login- User authenticationPOST /api/logout- User logoutGET /api/user- Get authenticated userGET /api/products- List productsPOST /api/products- Create product (admin)GET /api/orders- List user ordersPOST /api/orders- Create order
This project is configured for deployment on Hostinger with automated deployment via the included deploy.sh script.
-
Build the frontend:
npm run build
-
Run the deployment script:
./deploy.sh
The project includes GitHub Actions workflow for automated deployment. See DEPLOYMENT.md for detailed deployment instructions.
- Laravel 11 - PHP framework
- Laravel Sanctum - SPA authentication
- MySQL/SQLite - Database
- PHP 8.2+ - Programming language
- React 18 - UI library
- TypeScript - Type safety
- Vite - Build tool and dev server
- TailwindCSS - Utility-first CSS framework
- React Router - Client-side routing
- ESLint - JavaScript/TypeScript linting
- Prettier - Code formatting
- PHP CS Fixer - PHP code style fixer
- Concurrently - Run multiple commands
weekender-ecommerce/
βββ backend/ # Laravel Backend
β βββ app/
β β βββ Http/Controllers/
β β βββ Models/
β β βββ Providers/
β βββ config/
β βββ database/
β β βββ migrations/
β β βββ factories/
β β βββ seeders/
β βββ routes/
β β βββ api.php
β β βββ web.php
β βββ ...
βββ frontend/ # React Frontend
β βββ src/
β β βββ components/
β β βββ hooks/
β β βββ services/
β β βββ types/
β β βββ utils/
β β βββ App.tsx
β β βββ main.tsx
β βββ public/
β βββ ...
βββ .github/
β βββ workflows/ # GitHub Actions
βββ deploy.sh # Deployment script
βββ DEPLOYMENT.md # Deployment guide
βββ package.json # Root package.json
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the DEPLOYMENT.md for deployment-specific issues
- Open an issue on GitHub
- Review the Laravel and React documentation
Built with β€οΈ for the camping and outdoor tech community
