Skip to main content

Prerequisites

Ensure you have the following installed before starting:
RequirementVersionNotes
PHP8.2+Required by composer.json
Composer2.xDependency manager
Node.js18 LTS+For Vite and Tailwind
npm9+Bundled with Node.js
SQLite3.xDefault DB — no server needed
You can swap SQLite for MySQL. See Environment Configuration for details.

Setup

1

Clone the repository

git clone https://github.com/AlexanderDamont1/ElCoco.git
cd ElCoco
2

Run the setup script

The composer.json includes a setup script that handles everything in one command:
composer run setup
This runs the following in sequence:
  1. composer install — installs PHP dependencies
  2. Copies .env.example to .env if it doesn’t exist
  3. php artisan key:generate — generates the application encryption key
  4. php artisan migrate --force — runs all database migrations
  5. npm install — installs JavaScript dependencies
  6. npm run build — compiles assets with Vite
After setup, APP_KEY in your .env will be filled automatically. Do not share this key.
3

Configure your environment

Open .env and adjust the following values for local development:
.env
APP_NAME=ElCoco
APP_ENV=local
APP_URL=http://localhost:8000

# SQLite (default — no extra config needed)
DB_CONNECTION=sqlite

# Mail — log driver writes emails to storage/logs/laravel.log
MAIL_MAILER=log
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="DMI"
For MySQL instead of SQLite:
.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=elcoco
DB_USERNAME=root
DB_PASSWORD=secret
4

Link public storage

PDF files are stored in storage/app/public and served via the storage symlink:
php artisan storage:link
5

Start the development servers

Use the dev script to run all services concurrently:
composer run dev
This starts four processes in parallel:
  • serverphp artisan serve on http://localhost:8000
  • queuephp artisan queue:listen --tries=1
  • logsphp artisan pail --timeout=0
  • vitenpm run dev (hot module reload)
6

Submit your first quote

  1. Open http://localhost:8000/cotizador in your browser
  2. Browse the service categories on the left panel
  3. Click any block to add it to your quote — prices and hours update instantly
  4. Fill in the Client Information form (name and email are required)
  5. Click Submit Quote
After submission you’ll see a reference number like COT-67F1A2B3C4D5E. The quote is saved to the quotes table with status sent and a PDF is written to storage/app/public/quotes/.
7

Access the admin panel

The admin area requires an authenticated user. Create one with Artisan Tinker:
php artisan tinker
\App\Models\User::create([
    'name' => 'Admin',
    'email' => '[email protected]',
    'password' => bcrypt('password'),
    'email_verified_at' => now(),
]);
exit
Then log in at http://localhost:8000/login and navigate to:
  • Dashboardhttp://localhost:8000/dashboard
  • Quoteshttp://localhost:8000/admin/cotizaciones
  • Blockshttp://localhost:8000/bloques

Verify the API

Confirm the API is responding:
# Health check
curl http://localhost:8000/api/health

# List quote block categories
curl http://localhost:8000/api/quote-blocks
Expected health response:
{
  "status": "healthy",
  "timestamp": "2024-03-15T10:00:00.000000Z"
}

What’s next

Quote Builder

Understand how the client-facing SPA works in detail.

Quote Blocks

Configure the service blocks that clients can select.

PDF Export

Customise the branded quote PDF template.

API Reference

Explore all available REST endpoints.

Build docs developers (and LLMs) love