Full StackAdvanced

Custom Fullstack Template

A complete application stack with Next.js frontend, custom backend, PostgreSQL, Redis, Cloudbeaver for database management, and Prometheus for monitoring.

Overview

This template deploys six services that work together as a complete application stack. The frontend and backend are custom starter images you can replace with your own code. The infrastructure services — PostgreSQL, Redis, Cloudbeaver, and Prometheus — are production-ready off-the-shelf images that work out of the box.

Next.jsTypeScriptPostgreSQLRedisCloudbeaverPrometheus

What's Included

Frontend

customizable

Next.js app with TypeScript. Serves the UI and connects to the backend API and Cloudbeaver.

ghcr.io/nexlayer/custom-frontend:latest

Backend

customizable

Custom API server. Connects to PostgreSQL for data and Redis for caching.

ghcr.io/nexlayer/custom-backend:latest

Cloudbeaver

off-the-shelf

Web-based database management UI. Browse and query your PostgreSQL database from the browser.

dbeaver/cloudbeaver:latest

PostgreSQL

off-the-shelf

Primary data store. Used by the backend API and Cloudbeaver.

postgres:15

Redis

off-the-shelf

In-memory cache. Used by the backend for session storage and caching.

redis:7-alpine

Prometheus

off-the-shelf

Metrics collection and monitoring. Scrapes metrics from all services.

prom/prometheus:latest

How It Connects

1.

Frontend serves the UI at / and calls the backend API

2.

Backend handles API requests, reads/writes to PostgreSQL, and uses Redis for caching

3.

Cloudbeaver is available at /cloudbeaver for managing the database directly

4.

Prometheus collects metrics at /prometheus for observability

5.

Services reference each other using Nexlayer's .pod DNS — e.g. db.pod:5432 for PostgreSQL

Deploy on Nexlayer

Install the Nexlayer MCP:

npx @nexlayer/mcp-install

Then give your coding agent the YAML below and ask it to deploy:

Deploy this nexlayer.yaml to Nexlayer

Your agent will read the YAML, configure all six services, wire them together, and give you a live URL. No Kubernetes knowledge required.

Deployment YAML

Save this as nexlayer.yaml in your project, or copy it directly to your agent:

nexlayer.yaml
application:
  name: custom-fullstack
  pods:
    - name: frontend
      path: "/"
      image: "ghcr.io/nexlayer/custom-frontend:latest"
      servicePorts:
        - 3000
      vars:
        NEXT_PUBLIC_API_URL: "http://backend.pod:8000"
        NEXT_PUBLIC_CLOUDBEAVER_URL: "http://cloudbeaver.pod:8978"

    - name: backend
      image: "ghcr.io/nexlayer/custom-backend:latest"
      servicePorts:
        - 8000
      vars:
        DATABASE_URL: "postgresql://user:pass@db.pod:5432/customapp"
        REDIS_URL: "redis://redis.pod:6379"
        JWT_SECRET: "your-jwt-secret"

    - name: cloudbeaver
      path: "/cloudbeaver"
      image: "dbeaver/cloudbeaver:latest"
      servicePorts:
        - 8978
      vars:
        CB_DATABASE_URL: "postgresql://user:pass@db.pod:5432/cloudbeaver"
        CB_ADMIN_PASSWORD: "admin-password"

    - name: redis
      image: "redis:7-alpine"
      servicePorts:
        - 6379
      vars:
        REDIS_PASSWORD: "redis-password"

    - name: db
      image: "postgres:15"
      servicePorts:
        - 5432
      vars:
        POSTGRES_USER: "user"
        POSTGRES_PASSWORD: "pass"
        POSTGRES_DB: "customapp"

    - name: monitoring
      path: "/prometheus"
      image: "prom/prometheus:latest"
      servicePorts:
        - 9090
      vars:
        PROMETHEUS_CONFIG: "/etc/prometheus/prometheus.yml"

Make It Yours

The frontend and backend images are starter containers you can replace with your own. Build your app, push it to a container registry (GitHub Container Registry, Docker Hub, etc.), and swap the image references in the YAML.

The infrastructure services — PostgreSQL, Redis, Cloudbeaver, and Prometheus — are standard images that work as-is. Update the environment variables to change passwords, database names, or configuration.

Remember to change the default passwords in the YAML before deploying to production.