Deploying AR Barbería to production requires a few additional steps beyond the local development setup. You need to harden the environment configuration, compile frontend assets, apply migrations with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/OswalSnow/AR-Barber/llms.txt
Use this file to discover all available pages before exploring further.
--force flag, link the storage directory for portfolio image access, cache the framework configuration, and ensure your web server can write to the correct directories. This page walks through each step in order.
Pre-deployment checklist
Before uploading any files or running commands on the server, verify the following settings in your production.env file:
Generate the application key
If this is a fresh environment, generate the encryption key:If you are migrating from another server, copy the existing
APP_KEY value — changing it invalidates all active sessions.Configure a production database
Switch from SQLite to MySQL or PostgreSQL. SQLite is file-based and not suitable for concurrent production traffic.
Build production assets
Compile and minify the frontend JavaScript and CSS with Vite:Use
npm ci instead of npm install on production servers. It installs exact versions from package-lock.json and fails if the lockfile is out of sync, making builds reproducible.Run database migrations
Apply all pending migrations. The--force flag is required in production environments because Laravel otherwise refuses to run migrations when APP_ENV=production as a safety measure:
Link the storage directory
AR Barbería stores portfolio images instorage/app/public. Create a symlink so the web server can serve them from the public/ directory:
public/storage symlink is ever deleted.
Optimize for production
Cache the framework’s configuration, route list, and compiled Blade views to eliminate filesystem reads on every request:File permissions
The web server process (typicallywww-data on Nginx/Apache) must be able to write to two directories:
| Directory | Purpose |
|---|---|
storage/ | Logs, cached views, compiled files, uploaded portfolio images. |
bootstrap/cache/ | Cached configuration, routes, and services. |
Docker-based deployment with Laravel Sail
AR Barbería ships with Laravel Sail for Docker-based deployments. To start the full application stack in detached mode:docker-compose.yml. After the containers are running, execute the post-deploy commands inside the container:
Queue worker
The development script usesphp artisan queue:listen, which is convenient locally but unsuitable for production because it does not restart automatically after failures.
In production, manage the queue worker with a process supervisor such as Supervisor:
supervisor.conf
After deploying new code, restart the queue workers so they load the updated application:Running workers continue processing the current job before stopping. Supervisor restarts them automatically.
Booking endpoint rate limiting
The appointment booking endpoint is protected by Laravel’sthrottle:3,1 middleware, which limits each IP address to 3 requests per minute. This is enforced at the routing level and requires no additional configuration.
If you place AR Barbería behind a reverse proxy (Nginx, Cloudflare, etc.), ensure the proxy forwards the real client IP using the X-Forwarded-For header and that Laravel’s TrustProxies middleware is configured to trust your proxy’s IP range. Without this, all requests appear to come from the proxy’s IP and the rate limiter will not work correctly.