I am struggling to setup the config file for a monorepo i am trying to deploy to a single site, i have a nextjs app which acts as my frontend and a expressjs app that runs a variety of server functions for my api, a full tree map is bellow, i tried both seperate netlify.tomls and a shared one shown below but neither seem to load correctly when trying to import my project from git so i am wandering what the correct project structure/netlify.toml is for this situation?
Netlify Toml
[build]
base = "frontend"
command = "npm run build"
publish = ".next"
[functions]
external_node_modules = ["express"]
node_bundler = "esbuild"
[[redirects]]
force = true
from = "/api/*"
status = 200
to = "/.netlify/functions/api/:splat"
Project Tree
.
├── firebase-debug.log
├── firebase.json
├── firestore-debug.log
├── firestore.indexes.json
├── firestore.rules
├── frontend
│ ├── README.md
│ ├── app
│ │ ├── accounts
│ │ │ ├── layout.tsx
│ │ │ ├── oauth
│ │ │ │ └── page.tsx
│ │ │ └── page.tsx
│ │ ├── components
│ │ │ ├── accountCard.tsx
│ │ │ ├── lineChart.tsx
│ │ │ └── transactionsBreakdown.tsx
│ │ ├── dashboard
│ │ │ ├── [id]
│ │ │ │ └── page.tsx
│ │ │ ├── layout.tsx
│ │ │ └── page.tsx
│ │ ├── favicon.ico
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ ├── nav.tsx
│ │ ├── page.tsx
│ │ └── signin
│ │ └── page.tsx
│ ├── firebase.js
│ ├── middleware.ts
│ ├── netlify.toml
│ ├── next-env.d.ts
│ ├── next.config.js
│ ├── package-lock.json
│ ├── package.json
│ ├── postcss.config.js
│ ├── public
│ │ ├── manifest.json
│ │ ├── next.svg
│ │ ├── service-worker.js
│ │ ├── service-worker.js.LICENSE.txt
│ │ └── vercel.svg
│ ├── service-worker
│ │ ├── index.js
│ │ ├── sw.tsconfig.json
│ │ └── webpack.config.js
│ ├── tailwind.config.ts
│ ├── tsconfig.json
│ └── types
│ ├── api.d.ts
│ └── service-worker.d.ts
├── server
│ ├── dist
│ ├── netlify.toml
│ ├── node_modules
│ ├── package-lock.json
│ ├── package.json
│ ├── serviceKey.json
│ ├── src
│ │ ├── db
│ │ │ └── *.ts
│ │ ├── index.ts
│ │ ├── plaid.ts
│ │ ├── routes
│ │ │ └── *.ts
│ │ └── webhookHandlers
│ └── tsconfig.json
├── tree.txt
└── ui-debug.log