This project is a web application built with Laravel, Inertia, and React. It provides a modern, efficient way to create server-side rendered React applications with Laravel.
Before you begin, ensure you have the following installed on your system:
- PHP (>= 8.1)
- Composer
- Node.js (>= 14.x)
- npm or yarn
- MySQL or another database supported by Laravel
Follow these steps to set up the project on your local machine:
-
Clone the repository
git clone [email protected]:osammy820/tybenet-mini-project.git cd tybenet-mini-project
-
Install PHP dependencies
composer install
-
Install JavaScript dependencies
npm install # or if you're using yarn yarn install
-
Set up the environment file
cp .env.example .env
Then, open the
.env
file and configure your database connection details. -
Generate an application key
php artisan key:generate
-
Run database migrations
php artisan migrate
-
Seed the database
php artisan db:seed
The default seeder will create a user with the email
[email protected]
and passwordpassword
. -
Link storage
php artisan storage:link
To run the application, you need to start both the Laravel backend server and the frontend development server.
-
Start the Laravel development server
php artisan serve
This will start the server at
http://localhost:8000
. -
Compile and hot-reload frontend assets
In a new terminal window, run:
npm run dev # or if you're using yarn yarn dev
This will start the Vite development server for your frontend assets.
-
Access the application
Open your web browser and visit
http://localhost:8000
to see the application in action.
When you're ready to deploy your application, you should compile your assets for production:
npm run build
# or if you're using yarn
yarn build
This will create optimized production-ready assets in your public
directory.