Use case · Full-stack apps

Deploy a full-stack app in one project.

A full-stack app is a frontend, a backend API, and a database working together. On Runex, you deploy all three in one project: the frontend and API from GitHub, the database as a managed service, connected over a private network.

  • Frontend + API from GitHub
  • Managed PostgreSQL
  • Private network between them
project · acme
web
https://app.acme.com · public
api
api.internal:8080 · private
database
postgres.internal:5432
env
DATABASE_URL · injected
previews
one per pull request
status
running
illustrative namesrunex

Definition

What is a full-stack app?

An app with a user interface, server-side logic, and stored data. Each layer is usually its own service.

The frontend is what users see in the browser, often built with Next.js or React. The backend API handles business logic and talks to the database. The database stores the data.

Hosting a full-stack app means running all three, connecting them securely, and giving the frontend a public HTTPS address.

On Runex, a project groups those services. Each one runs in its own isolated container, and they reach each other over the project's private network.

Architecture

How is a full-stack app structured on Runex?

One public service, the rest private. Users reach the frontend; the API and database stay internal.

architecture
browser
   │  https://app.acme.com
   ▼
web       Next.js            public
   │  http://api.internal:8080
   ▼
api       Node · Python · Go private
   │  DATABASE_URL
   ▼
postgres  managed            private
architecturerunex

If the browser calls your API directly, give the API its own public domain, such as api.acme.com. If only your frontend's server calls it, keep it private.

How to deploy

How do you deploy a full-stack app on Runex?

Deploy the database, then the API, then the frontend. Each step takes a few minutes.

  1. You

    Create a database

    Add managed PostgreSQL to the project.

  2. Runex

    Inject the connection

    DATABASE_URL appears in your API's variables.

  3. You

    Deploy the API

    Connect its repo or folder via the GitHub App.

  4. You

    Deploy the frontend

    Point it at the API URL and add your domain.

One push, whole stack.

After setup, pushing to GitHub redeploys the service that changed, and each pull request gets its own preview.

Compare

Monorepo or separate repos: which is better?

Both work on Runex. A monorepo keeps changes together; separate repos keep services independent.

Monorepo or separate repos: which is better?
MonorepoSeparate repos
Where the code livesFrontend and API in one repositoryOne repository per service
Changing both layersOne pull requestTwo coordinated pull requests
Access controlEveryone sees everythingPer-repo GitHub access
Good forSmall teams moving fastLarger teams or shared APIs

Example

Example: a SaaS dashboard on Runex

A Next.js frontend, a FastAPI backend, and PostgreSQL.

  1. Create PostgreSQL in project acme
  2. Deploy acme/api (FastAPI): it reads DATABASE_URL
  3. Deploy acme/web (Next.js) with API_URL set
  4. CNAME app.acme.com → cname.runex.cloud
  5. Open a pull request → a preview of the whole change
  6. Merge → production redeploys with zero downtime
acme
web
acme/web · Next.js
api
acme/api · FastAPI
db
PostgreSQL · managed
domain
app.acme.com
deploys
on push to main
illustrative nameshttps ✓

FAQ

Full-stack questions

Common questions before the first deploy.

Can I deploy the frontend and backend separately?

Yes. On Runex the frontend and API are separate services in one project, so each deploys, scales, and rolls back on its own.

Does Runex provide managed databases?

Yes. Runex runs managed PostgreSQL, MySQL, Redis, and MongoDB, and injects the connection string into your app as an environment variable.

How does my frontend call my backend API?

Server-side code can use the API's internal hostname on the private network. Code running in the browser needs the API's public URL, such as api.example.com.

Can I use my own external database instead?

Yes. Set your provider's connection string as DATABASE_URL in the dashboard and your app connects to it like any other database.

Next step

Ship your whole stack.

Frontend, API, and database: one project, one push.