The Surqo frontend is a Next.js 15 application deployed to Vercel for three reasons: its native GitHub Integration triggers automatic production deploys on every push toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ricardomb-tech/surqo/llms.txt
Use this file to discover all available pages before exploring further.
master, its edge CDN serves static assets globally from the nearest PoP, and its preview deployment system gives each pull request its own isolated URL for testing before merging. Zero configuration is needed beyond connecting the repository and setting four environment variables.
Deployment Steps
Connect the GitHub repository to Vercel
- Go to vercel.com and sign in.
- Click Add New → Project.
- Select Import Git Repository and choose
ricardomb-tech/surqo. - Set the Root Directory to
frontend(since this is a monorepo withbackend/andfrontend/subdirectories). - Vercel auto-detects Next.js — leave all build settings at their defaults.
Configure environment variables
In the Vercel project dashboard, go to Settings → Environment Variables and add the following four variables. Set them for Production, Preview, and Development environments:
Deploy
Push any commit to the Vercel picks up the push via its GitHub webhook, builds the Next.js app, and deploys to the global edge network within ~60 seconds. You can monitor the build in real time under Deployments in the Vercel dashboard.
master branch to trigger an automatic production deploy:Configure the custom domain
To serve the frontend from DNS propagation typically takes 5–30 minutes. Vercel automatically provisions a Let’s Encrypt SSL certificate once the nameservers resolve.
surqo.online instead of the default surqo.vercel.app:- In the Vercel dashboard, go to Settings → Domains.
- Add
surqo.onlineandwww.surqo.online. - At your domain registrar (e.g. Hostinger), update the nameservers to point to Vercel’s DNS:
Surqo’s production domain is already configured this way — the Hostinger nameservers point to
ns1.vercel-dns.com and ns2.vercel-dns.com.Preview Deployments
Every pull request targeting
master automatically gets its own isolated preview URL in the format surqo-git-<branch>-ricardomb-tech.vercel.app. This lets you test UI changes, verify environment variable behaviour, and share a live link for review — all before any code lands in production. Preview deployments share the same environment variables configured in Vercel’s dashboard.Route Protection
The/(app)/* routes — dashboard, sensors, farms, alerts, and the AI analysis page — require authentication. This is enforced at the SSR middleware layer before any page renders, so unauthenticated users never receive protected HTML.
frontend/src/middleware.ts
@supabase/ssr to read the Supabase session from HTTP-only cookies. This means the access token is never exposed to JavaScript on the client, and route protection cannot be bypassed by manipulating client-side state.
Environment Variable Reference
| Variable | Value | Purpose |
|---|---|---|
NEXT_PUBLIC_API_URL | https://surqo-api.fly.dev | REST API base URL for all fetch calls |
NEXT_PUBLIC_WS_URL | wss://surqo-api.fly.dev | WebSocket base URL for live sensor feed |
NEXT_PUBLIC_SUPABASE_URL | https://xxxx.supabase.co | Supabase project URL for auth client |
NEXT_PUBLIC_SUPABASE_ANON_KEY | sb_publishable_... | Supabase anon/public key (safe to expose) |