Nextock Installation Documentation
Welcome to the Nextock setup guidelines. This file contains step-by-step instructions on setting up both the **Laravel Administrative Panel API** and compiling the **Flutter Mobile Companion application**.
System Prerequisites
💻 Web Panel Requirements
- • PHP 8.1 or higher (with BCMath, PDO, XML extensions enabled)
- • Composer v2.0+ package manager
- • MySQL 5.7+ or MariaDB database server
- • Node.js v18+ & NPM (for compiling Tailwind/Vite assets)
📱 Flutter Client Requirements
- • Flutter SDK v3.12.2 or higher
- • Dart SDK v3.x
- • Android Studio (for SDK configurations) or Xcode (for iOS builds, macOS only)
- • A physical device or emulator for testing
3. Laravel Backend Installation
Follow these command steps in order to download files, install PHP vendor files, create tables, and start your server.
Step 3.1: Install Dependencies
Run the composer installation commands from the root directory of nextock-project:
composer install
Step 3.2: Configure Environment File
Duplicate the example configuration file and adjust database variables:
cp .env.example .env
php artisan key:generate
Open .env and fill in your database access parameters:
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nextock_db
DB_USERNAME=root
DB_PASSWORD=YOUR_PASSWORD
Step 3.3: Database Migrations & Seeds
Create tables, seed administrative user roles, permissions, and basic category mockups:
php artisan migrate --seed
Step 3.4: Build Vite Assets
Compile front-end assets for theme togglers and blade views:
npm install
npm run build
Step 3.5: Run the Server
Run the built-in development server to serve endpoints:
php artisan serve
You can now access your admin dashboard at http://127.0.0.1:8000. Default login credentials:
4. Flutter Mobile Client setup
Follow these commands from your nextock-mobile root directory to compile and run companion client configurations.
Step 4.1: Download Pub Packages
Fetch package extensions listed inside pubspec.yaml:
flutter pub get
Step 4.2: Run Build Runner
Since Nextock Mobile utilizes code generators for Riverpod, Freezed, and local Isar tables, compile files:
dart run build_runner build --delete-conflicting-outputs
Step 4.3: Configure API Endpoint Environment
Point the Flutter app to the active Laravel backend URL using Dart compile definitions. Choose the target environment IP:
| Target Platform | API URL Endpoint parameter | Description |
|---|---|---|
| Android Emulator | http://10.0.2.2:8000/api |
Allows emulators to map host local loop. |
| iOS Simulator | http://localhost:8000/api |
Simulators share host network stack. |
| Physical Mobile Device | http://<YOUR_LOCAL_IP>:8000/api |
Requires computer & device to be on same Wi-Fi. |
Step 4.4: Launch the Client
Example run command targeting an Android Emulator environment:
flutter run --dart-define=API_BASE_URL=http://10.0.2.2:8000/api --dart-define=APP_ENV=development
Step 4.5: Compile for Production Release
Compile release assets for user deployment:
flutter build apk --releaseflutter build appbundle --releaseflutter build ipa --release5. Authenticating & Connecting the Ecosystem
The Flutter app communicates using Laravel Sanctum Personal Access Tokens. Follow these instructions to sync keys:
-
1.
Sign in to the administrative Laravel Panel via
http://127.0.0.1:8000/login. - 2. Navigate to Settings → API Settings.
- 3. Create a new Personal Access Token named e.g., "Mobile-Scanner-Token" and copy the token string.
- 4. Open the Flutter companion, fill in credentials, and your mobile client will cache the Sanctum tokens securely using secure storage wrappers.
6. Troubleshooting FAQ
Problem: Mobile app connection fails (SocketException / Connection Refused)
Solution: Verify that you passed the correct IP address in your --dart-define=API_BASE_URL configuration. Also verify your Laravel server is listening on all network interfaces. Use php artisan serve --host=0.0.0.0 if running configurations on external LAN networks.
Problem: Build Runner conflict errors
Solution: Run `dart run build_runner clean` followed by `dart run build_runner build --delete-conflicting-outputs` to force adapters regeneration.