WayFy’s production architecture on Render consists of three resources: a Web Service running the Flask/Gunicorn backend, a Static Site serving the compiled React frontend, and a Managed PostgreSQL database. The backend and database communicate over Render’s internal network; the frontend is a fully static build served from a CDN edge with no server-side runtime required.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jhonyes04/new-wayfy/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Have the following ready before you start:- A Render account with your WayFy repository connected to GitHub
- A Cloudinary account (for image upload storage)
- A Mapbox public access token (for the map)
- A Groq API key (for the AI assistant)
Backend Deployment
Create a new Render Web Service
In the Render dashboard, click New → Web Service and connect your GitHub repository. Select the branch you want to deploy (typically
main).Set the root directory
Under Root Directory, enter:Render will scope all build and start commands to this directory.
Configure the start command
WayFy’s backend includes a This matches the
Procfile and a src/wsgi.py entry point. Set Start Command to:web: entry in the repository’s Procfile. Gunicorn changes into the src/ subdirectory, loads wsgi.py, and serves the application object exported from that module.The
Procfile also defines a release: phase (pipenv run upgrade) that Render runs automatically before every deploy to apply any pending database migrations. No manual migration step is required on Render if you use the Procfile.Set environment variables
In the Environment tab of the Web Service, add the following key-value pairs:
| Variable | Description |
|---|---|
DATABASE_URL | Internal Database URL from your Render PostgreSQL instance (see next step) |
FLASK_APP | src/app.py |
FLASK_APP_KEY | Flask session secret key — any long random string |
JWT_SECRET_KEY | A long, random secret string — required at startup |
JWT_ACCESS_TOKEN_EXPIRES_HOURS | JWT token lifetime in hours (default: 1) |
GROQ_API_KEY | Your Groq API key (gsk_...) |
CLOUDINARY_CLOUD_NAME | Your Cloudinary cloud name |
CLOUDINARY_API_KEY | Your Cloudinary API key |
CLOUDINARY_API_SECRET | Your Cloudinary API secret |
CORS_ALLOWED_ORIGINS | Your frontend’s Render URL (e.g. https://wayfy.onrender.com) — add after the static site is created |
CONTACT_EMAIL | Email address used for outbound contact messages |
Create a PostgreSQL database and link it
In the Render dashboard, click New → PostgreSQL and create a database in the same region as your Web Service. Once provisioned:
- Open the database’s Info page.
- Copy the Internal Database URL (begins with
postgres://). - Paste it as the value of
DATABASE_URLin your Web Service’s environment variables.
Render’s PostgreSQL connection strings start with
postgres://, but SQLAlchemy 1.4+ requires postgresql://. WayFy’s Flask app automatically rewrites the prefix at startup — you do not need to modify the URL manually.Frontend Deployment
Create a new Render Static Site
In the Render dashboard, click New → Static Site and connect the same GitHub repository.
Configure the build command
Set Build Command to:This installs dependencies with pnpm and then runs the Vite production build, outputting to
frontend/dist/.Set environment variables
In the Environment tab of the Static Site, add:
| Variable | Value |
|---|---|
VITE_BACKEND_URL | The full URL of your deployed Render Web Service (e.g. https://wayfy-api.onrender.com) |
VITE_MAPBOX_TOKEN | Your Mapbox public access token (pk.eyJ1...) |
VITE_BASENAME | / |
Vite bakes environment variables into the static bundle at build time. If you change
VITE_BACKEND_URL after an initial deploy, trigger a Manual Deploy to rebuild and re-bundle the updated value.Post-Deployment Steps
Run database migrations
After the backend Web Service is live, open a shell to run migrations against the production database. In the Render dashboard, navigate to your Web Service and open the Shell tab, then run:Configure CORS
Once the frontend Static Site is deployed and you have its public URL (e.g.https://wayfy.onrender.com), return to your backend Web Service’s environment variables and set: