Skip to main content

Quickstart Guide

Get the Viax platform running on your local machine or connect to the production backend in just a few steps.

Prerequisites

Before you begin, ensure you have the following installed:

Flutter SDK

Version 3.35.3 or higher

Dart SDK

Version 3.0 or higher

Git

For cloning the repository

Code Editor

VS Code or Android Studio recommended

Choose Your Setup

You have two options to get started:
Connect directly to the production VPS - perfect for testing without local setup.

This is the fastest way to get started. The backend is already deployed and running.
1

Clone the Repository

git clone https://github.com/Braian551/viax.git
cd viax
2

Install Dependencies

flutter pub get
This downloads all required Flutter packages defined in pubspec.yaml.
3

Verify Configuration

The app is configured to use production by default. Check lib/src/core/config/app_config.dart:
static const String _envBaseUrl = String.fromEnvironment(
  'API_BASE_URL',
  defaultValue: 'http://76.13.114.194', // Production VPS
);
4

Run the App

# For Android emulator
flutter run

# For specific device
flutter run -d <device-id>

# List available devices
flutter devices
5

Test the Connection

The app will automatically connect to:
  • Backend URL: http://76.13.114.194
  • Database: MySQL on VPS
  • Email Service: Gmail SMTP configured
Try registering a new user to verify everything works!
The production backend is fully functional with all features enabled. You can create users, register drivers, and test the complete flow.

Option B: Local Development Setup

For development and customization, set up the complete stack locally.
1

Install Laragon

Download and install Laragon from laragon.orgLaragon includes:
  • Apache web server
  • MySQL database
  • PHP 8.3+
  • phpMyAdmin
2

Clone the Repository

git clone https://github.com/Braian551/viax.git
cd viax
3

Set Up Backend

Copy the backend folder to Laragon’s www directory:
# Windows
xcopy /E /I backend C:\laragon\www\viax\backend

# Or manually copy:
# From: viax/backend
# To: C:\laragon\www\viax\backend
4

Create Database

Open Laragon and start all services, then:
  1. Click Database button (opens phpMyAdmin)
  2. Create new database named viax
  3. Set charset to utf8mb4_unicode_ci
  4. Import the SQL file: basededatos.sql
5

Install PHP Dependencies

Open Laragon terminal and run:
cd C:\laragon\www\viax\backend
composer install
6

Configure Flutter for Local

Update the base URL for your environment:
# For Android Emulator (10.0.2.2 maps to localhost)
flutter run --dart-define=API_BASE_URL=http://10.0.2.2/viax/backend

# For Physical Device (use your computer's IP)
flutter run --dart-define=API_BASE_URL=http://192.168.1.XXX/viax/backend
Find your IP with ipconfig (Windows) or ifconfig (Mac/Linux)
7

Verify Backend

Test the backend is working:
# In browser, visit:
http://localhost/viax/backend/health.php

# Should return:
{"status":"ok"}
8

Run the App

flutter pub get
flutter run
For complete local setup instructions, see Local Development Setup

Verify Installation

1. Check Flutter Doctor

flutter doctor -v
Ensure all checkmarks are green. Common issues:
  • Android SDK not found → Install Android Studio
  • iOS toolchain (Mac only) → Install Xcode

2. Test Backend Connectivity

The app automatically tests the backend connection on launch. Watch for: Success indicators:
  • Login screen appears
  • No connection errors
  • Registration flow works
Connection issues:
  • “Could not connect to server” error
  • Timeout messages
  • Failed API calls

3. Test Key Features

  1. Tap “Crear cuenta” (Create account)
  2. Fill in user details
  3. Verify email with 6-digit code
  4. Login with credentials

Environment Configuration

Viax supports multiple environments through Dart defines:
# Production (default)
flutter run

# Local Development
flutter run --dart-define=API_BASE_URL=http://10.0.2.2/viax/backend

# Staging (if you have a staging server)
flutter run --dart-define=API_BASE_URL=https://staging.viax.com
The app automatically detects the environment based on the URL:
  • localhost, 10.0.2.2, 192.168.* → Development
  • Contains staging → Staging
  • Everything else → Production

Building for Production

Once you’ve tested the app:
# Build release APK
flutter build apk --release

# Output: build/app/outputs/flutter-apk/app-release.apk

Troubleshooting

For Emulator:
  • Use 10.0.2.2 instead of localhost
  • Verify backend is running: http://localhost/viax/backend/health.php
For Physical Device:
  • Use your computer’s local IP (e.g., 192.168.1.100)
  • Ensure phone and computer are on the same WiFi network
  • Check firewall settings
  • Verify Laragon MySQL is running (green icon)
  • Check database credentials in backend/config/database.php:
    • Host: localhost
    • Username: root
    • Password: root (default Laragon)
    • Database: viax
  • Ensure database viax exists in phpMyAdmin
  • Check internet connection (maps require online access)
  • Verify Mapbox API key in env configuration
  • Check browser console for CORS errors
  • Ensure GPS permissions are granted
  • Production backend uses configured Gmail SMTP
  • For local setup, configure PHPMailer in backend
  • Check spam folder for verification emails
  • Verify email service credentials in backend config

Next Steps

Explore Features

Discover all platform capabilities

Architecture

Understand the system design

Environment Setup

Configure for different environments

Deploy

Deploy to production
Congratulations! You now have Viax running. Start exploring the platform features and customizing for your needs.

Build docs developers (and LLMs) love