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.
What's Included
Frontend
customizableNext.js app with TypeScript. Serves the UI and connects to the backend API and Cloudbeaver.
Backend
customizableCustom API server. Connects to PostgreSQL for data and Redis for caching.
Cloudbeaver
off-the-shelfWeb-based database management UI. Browse and query your PostgreSQL database from the browser.
PostgreSQL
off-the-shelfPrimary data store. Used by the backend API and Cloudbeaver.
Redis
off-the-shelfIn-memory cache. Used by the backend for session storage and caching.
Prometheus
off-the-shelfMetrics collection and monitoring. Scrapes metrics from all services.
How It Connects
Frontend serves the UI at / and calls the backend API
Backend handles API requests, reads/writes to PostgreSQL, and uses Redis for caching
Cloudbeaver is available at /cloudbeaver for managing the database directly
Prometheus collects metrics at /prometheus for observability
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-installThen give your coding agent the YAML below and ask it to deploy:
Deploy this nexlayer.yaml to NexlayerYour 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:
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.