Skip to main content

Local Environment Setup

1. Install XAMPP

Download and install XAMPP for Windows. Start the Apache and MySQL services from the XAMPP Control Panel.

2. Install FacturaScripts

Download the latest FacturaScripts release from facturascripts.com and extract it to C:\xampp\htdocs\facturascripts.

Create the database:

CREATE DATABASE facturascripts
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;

Open http://localhost/facturascripts and complete the installation wizard (database host: localhost, user: root, password: empty for default XAMPP).

3. Clone the plugin repos

All repos live in the obeliOmed GitHub org. Clone what you need:

cd C:\Users\<you>\Documents\GitHub

# Core — always needed
gh repo clone obeliOmed/OftalmolBase

# Feature plugins (clone those you will work on)
gh repo clone obeliOmed/OftalmolAgenda
gh repo clone obeliOmed/ObelioSurgery
gh repo clone obeliOmed/ObelioTheme
# ... etc

FacturaScripts loads plugins from C:\xampp\htdocs\facturascripts\Plugins\. The recommended approach is a symbolic link so edits in your GitHub folder are instantly live in XAMPP.

Run PowerShell as Administrator:

# Replace <PluginName> and <YourUsername> with real values
New-Item -ItemType SymbolicLink `
-Path "C:\xampp\htdocs\facturascripts\Plugins\<PluginName>" `
-Target "C:\Users\<YourUsername>\Documents\GitHub\<PluginName>"

Example for OftalmolBase:

New-Item -ItemType SymbolicLink `
-Path "C:\xampp\htdocs\facturascripts\Plugins\OftalmolBase" `
-Target "C:\Users\jquin\Documents\GitHub\OftalmolBase"

:::warning Two separate copies Your GitHub\ folder and XAMPP Plugins\ folder are independent copies unless you use symlinks. Editing files in GitHub does NOT affect XAMPP automatically when copying manually. :::

5. Install plugin dependencies

Each plugin may have PHP dependencies managed by Composer:

cd C:\Users\<you>\Documents\GitHub\<PluginName>
composer install

6. Activate plugins in FacturaScripts

  1. Open http://localhost/facturascripts/admin/Plugins
  2. Find the plugin and click Instalar
  3. FacturaScripts runs the DB migrations automatically

Install in dependency order:

  1. OftalmolBase (ObelioCore)
  2. OftalmolAgenda (ObelioScheduling) — depends on ObelioCore
  3. All other feature plugins — depend on ObelioCore

7. Run tests

cd C:\Users\<you>\Documents\GitHub\<PluginName>

# Unit + integration tests
./vendor/bin/phpunit --testdox

# If you get a missing test config error, check Test/phpunit.xml

All tests passing means your setup is correct.

Troubleshooting

SymptomFix
White screen after plugin installCheck C:\xampp\htdocs\facturascripts\MyFiles\Logs\ for errors
Migration failsMake sure ObelioCore is installed before feature plugins
Symlink not workingEnsure XAMPP's Apache runs as Administrator, or enable symlinks in httpd.conf
composer install failsUpdate Composer: composer self-update