the problem with polyrepo
I noticed this with 2 companies I had an onsite with last year. The first was YC-backed and used Next.js, and the second was 1984-backed and used React Native for the frontend web/mobile client. In both cases, they both had something in common: they were both using a python FastAPI server with a Prisma ORM layer on top of a Postgres DB. Even without today’s AI-heavy climate and the self-hosting huggingface ecosystem, there remain lots of python-heavy audio/video processing that would eventually require python-ffmpeg (node-ffmpeg falls far short).
The problem with polyrepo Next/python structures is the duplicated schema.prisma files that arise from multiple Prisma client connections. Often times you’ll find yourself manually copying the schema files from one repo to another, a true engineering pain. Other pain points include disconnected API changes, commit messages, and intellisense.
configuring a monorepo
We all know the benefits of a monorepo. However, configuring a monorepo often feels like matching different permutations of config files to make things work. In the standard mantra of build things and ship fast the last thing you would want to do is to configure your monorepo to your liking.
Next-Wind-Fast-Prisma-Docker-Turbo
https://github.com/scottsus/Next15-Tailwindcss-FastAPI-Prisma-Turbo
I did the hard part so you don’t have to.
On the frontend: a Next.js fullstack app with tailwindcss, Shadcn, Prisma, and typescript, with additional styling tools like lucide and react-loader-spinner. Oh and also Vercel’s AI SDK.
On the backend: a FastAPI server that uses async/await, dockerized, with docker-compose scripts, and a Prisma-python client.
The beauty lies in the dev tooling: prettier, prettier-plugin-tailwindcss, prettier-plugin-sort-imports (this one is important), and turbopack.
All scripts are packaged nicely in each package.json. Even the .vscode folder has been setup so you don’t see the yellow squiggly lines in your python files.
deployment
It works in the general case, but if you’ve made it this far, I’d love to introduce you to self-hosting with Coolify. While you can have Vercel or any other cloud provider take care of the Next.js app, it’s difficult to find a good cloud provider for a FastAPI server, and most hosted Postgres solutions like Supabase and Neon limit you to just 1-2 databases at a time.
With Coolify deploying Postgres takes one click, whereas any dockerized app can be deployed with 2-3 clicks. This monorepo has already configured deployment on Coolify for the dockerized FastAPI server, meaning you barely have to do any work beyond this point. Moreover, Coolify is scalable (up to a certain point), won’t charge you a gold bar like Vercel, and is completely open source, which is cool.
try it out
Everything has been nicely configured for you. Even if you’re not using the FastAPI server, feel free to give the apps/web a try; I’m sure you’ll like the dev tooling.
This repo will continually be a work in progress. I’ll add more useful tools along the way; some next items appear to be: a Docusaurus /docs app, … ?
Feel free to contribute an issue/PR if you find something useful!