These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- PHP >= 8.2
- Composer
- Node.js & NPM or Yarn
- MySQL
-
Clone the repository:
git clone https://github.com/abhipraya-kusuma-dev/seragam-app-v2 cd seragam-app-v2 -
Install PHP dependencies:
composer install
-
Install JavaScript dependencies:
npm install # or yarn install -
Set up your environment file:
- Copy the
.env.examplefile to.env.cp .env.example .env
- Your
.envfile should be populated with the correct credentials. Key settings from your configuration include:APP_NAME="Seragam App" APP_URL=http://localhost DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=order_app DB_USERNAME=root DB_PASSWORD= SESSION_DRIVER=database QUEUE_CONNECTION=database CACHE_STORE=database
- Generate a new application key:
php artisan key:generate
- Copy the
-
Run database migrations: This will set up the necessary tables for the application, including for sessions, jobs, and cache.
php artisan migrate
(use --seed to seed admin account)
-
Compile front-end assets:
npm run dev # or yarn dev
This application uses Laravel Reverb, a first-party WebSocket server for Laravel, to handle real-time communication.
Your .env file should be configured with the following settings for Reverb to work correctly. These variables connect your Laravel backend and your Inertia.js frontend to the Reverb server.
- Option 1: Use the Artisan Command (Recommended): The easiest and most secure way to get new credentials is to run the install command again. This will generate a new set of secure, random values for you.
php artisan reverb:install- Option 2
Update your
.envfile with your manual value:
BROADCAST_CONNECTION=reverb
# -----------------------------
# Reverb Server Configuration
# -----------------------------
REVERB_APP_ID=974811
REVERB_APP_KEY=appKeyTralala
REVERB_APP_SECRET=yourSecret
REVERB_HOST="localhost"
REVERB_PORT=8080
REVERB_SCHEME=http
# -----------------------------
# Reverb Client (Vite) Configuration
# -----------------------------
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"Start the development server:
php artisan serveStart the front-end asset compiler:
npm run devEnsure the Reverb server is running in a separate terminal:
php artisan reverb:start(use --debug for better dev experience)
Track the queue of the reverb (Optional):
php artisan queue:workAccess the application in your browser, typically at http://localhost:8000 (or the URL from php artisan serve).