This is a basic Laravel 11 project with React frontend components integration. The project demonstrates how to set up Laravel with React and create a modern web application.
- Laravel 11 backend structure
- React 18 with TypeScript frontend
- React Router for navigation
- Sample components (Navbar, Home, About)
- Mock API integration (with code for real Laravel API)
- CSS styling
- Vite for frontend build process
laravel-react-app/
├── app/ # Laravel application code
├── config/ # Laravel configuration files
├── database/ # Laravel database migrations and seeds
├── public/ # Public assets and built React files
├── resources/ # Frontend source files
│ ├── css/ # CSS files
│ └── js/ # React components and app logic
├── routes/ # Laravel API and web routes
└── ...
- Clone the repository
- Install dependencies:
bun install - Start the development server:
bun run dev - Visit
http://localhost:5173in your browser
The React components are located in the resources/js/components directory. The main entry point is resources/js/app.tsx.
The Laravel backend structure is set up with basic configuration files. In a full implementation, you would add controllers, models, migrations, and other Laravel components as needed.
To build the application for production:
bun run build
This will create optimized production files in the public/build directory.
- Create a new component file in
resources/js/components/ - Add routes in
resources/js/app.tsxif needed - Import and use the component as needed
The Home component includes commented code for making API calls to a Laravel backend. Uncomment and modify as needed to connect to your actual API endpoints.
MIT