Railway is the recommended platform for deploying UniMaps. You will create two Railway services — one for the Laravel backend (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Jcofles/Proyecto-web/llms.txt
Use this file to discover all available pages before exploring further.
Clase1/) and one for the Vue 3 frontend (itfip-map/) — plus a managed MySQL database. This page covers every step from connecting your repository to running your first migration.
Backend deployment
Connect your repository
Go to railway.com/dashboard and create a new project.Choose Deploy from GitHub repo and select the
Jcofles/Proyecto-web repository (or your fork). Railway will detect it as a PHP/Laravel application.Set the root directory
In your service’s Settings, set the Root Directory to When the root directory is correctly set to The
Clase1.If Railway does not support changing the root directory for your plan, leave it blank — the Procfile at the repository root will instruct Railway to change into Clase1 automatically:Clase1, Railway uses the service-level Procfile instead:release command runs migrations and seeds the campus coordinate data automatically on every deploy.Provision a MySQL database
In your Railway project, click New → Database → MySQL.Railway injects
MYSQLHOST, MYSQLPORT, MYSQLDATABASE, MYSQLUSER, and MYSQLPASSWORD variables into connected services automatically. You can reference these directly or remap them to the DB_* names that Laravel expects (see the next step).Add environment variables
In your backend service, open Variables and add the following. Replace placeholder values with your actual Railway-provided URLs and credentials.To generate Copy the output (it starts with
APP_KEY locally before deploying:base64:) and paste it as the value of APP_KEY in Railway.Deploy and verify
Trigger a deploy. Watch the Deploy Logs tab.
- The
releasephase runsphp artisan migrate --forcefollowed by the campus seeder. - The
webphase starts the Laravel server on the Railway-assigned$PORT.
https://your-backend.up.railway.app/api/nodos in your browser. You should see a JSON response similar to {"data":[...]} confirming the API is live and the database is seeded.If the deploy fails, check for these common causes:APP_KEYis empty or malformed.- Database credentials are incorrect or the MySQL service is not yet ready — wait a moment and redeploy.
- The
releasecommand failed before the database was ready. Temporarily comment out thereleaseline in the Procfile, deploy, then runphp artisan migrate --forcemanually from the Railway shell.
Frontend deployment
Create a new service for the frontend
In the same Railway project, click New → GitHub Repo and select the same repository.Set the Root Directory to Set the start command to serve the built output. If Railway detects a Node service, you can use a simple static server:
itfip-map and the build command to:Set frontend environment variables
The only required variable for the frontend is the backend API URL:This value is baked into the Vite build at compile time, so you must redeploy the frontend any time the backend URL changes.
CORS and Sanctum configuration
Because the SPA and API run on different origins (separate Railway subdomains), you must configure Sanctum and CORS correctly or every authenticated request will be rejected.Ensure these variables are set on the backend service:Laravel reads
APP_FRONTEND_URL to build allowed CORS origins. If you change your frontend subdomain, update all three values and redeploy the backend.Post-deployment tasks
After both services are running, run the following commands from the Railway shell (or locally viaphp artisan pointed at the production database) if you need to reset state: