Next.js Discord

Discord Forum

How to host a monorepo on a vps?

Answered
Cuvier’s Dwarf Caiman posted this in #help-forum
Open in Discord
Cuvier’s Dwarf CaimanOP
I am working on a project that has the frontend built in nextjs and the backend built in nestjs both the backend and the frontend are inside of a turbo monorepo.
the backend uses a postgres database with prisma to store data. The whole projects uses doppler. Docker is used along with it.

This is the command I run inside of the apps/api (nestjs project) to start the backend locally: doppler -t <doppler-secret> run -- docker-compose up
And this is the command to start both of the projects (the api + frontend) doppler -t <doppler-secret> run -- pnpm turbo dev
The package.json looks like
{
  "private": true,
  "scripts": {
    "build": "turbo run build",
    "dev": "turbo run dev",
    "lint": "turbo run lint",
    "format": "prettier --write \"**/*.{ts,tsx,md}\""
  },
  "devDependencies": {
    "eslint": "^7.32.0",
    "prettier": "^2.5.1",
    "turbo": "latest"
  },
  "packageManager": "pnpm@7.15.0",
  "name": "simply-recruit"
}

here is the turbo.json file contents
{
    "$schema": "https://turbo.build/schema.json",
    "globalDependencies": ["**/.env.*local"],
    "pipeline": {
        "build": {
            "outputs": [".next/**", "!.next/cache/**"]
        },
        "start": {
            "dependsOn": ["build"]
        },
        "lint": {},
        "test": {},
        "db": {
            "persistent": true
        },
        "dev": {
            "cache": false,
            "persistent": true
        }
    }
}

And this is the contents pnpm-workspace.yaml file
packages:
  - "apps/*"
  - "packages/*"

What I need to do is host this monorepo on a blank vps. How do I do that?
Answered by Cuvier’s Dwarf Caiman
Succeeded
View full answer

1 Reply

Cuvier’s Dwarf CaimanOP
Succeeded
Answer