Using a custom backend server with Next.js in a monorepo.
I was searching for an open source repository that schedules and posts on social media. I found Gitroom.
Gitroom is a awesome, built by Nevo David. You can 📨 schedule social media and articles. Exchange or buy posts from other members 👨🏻💻. Monitor your GitHub trending, and so much more 📈.
The following are some interesting things I learnt from this repository
1. You can use your own backend with Next.js
2. A note about customFetch
3. The way the files are named.
It has folders named as frontend, backend, cron etc.,
I wondered for quite some time now, if we could use our own backend when you are already using the Next.js, a “full stack” react framework but, I kept seeing people advising to use your custom backend when you need advanced features like cron, web sockets etc., on Reddit.
Now that I found Gitroom that demonstrates the custom backend usage along with Next.js and cron, I have a good feeling that you could learn some advanced patterns studying this repository.
I have never seen a service file named using dots like “custom.fetch.func.ts”. Sure, there’s config files named as tailwind.config.ts etc.,
Here’s what chatGPT has to say about this:
“
This kind of naming does not fit into a traditional case style like snake_case, kebab-case, or camelCase.
However, if we ignore the file extension (“.ts”) and consider only “custom.fetch.func,” it can be seen as:
Dot notation: This isn’t a standard case style but is sometimes used in programming to represent a hierarchical relationship or to namespace parts of a name.
“
To be honest, choose w/e naming conventions work for you. I use lowercase words separated by dashes as a file name, like custom-fetch-func.ts
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.