/    Sign up×
Bounties /Pin to ProfileBookmark

Is it advisable to separate my API into a Nest JS repo when working with Next JS and Remix apps?

+ 5,000
Copy linkTweet thisAlerts:
Sep 19.2023

I’ve developed applications using Next JS and Remix, and I’m considering adding a mobile app to the mix. My API is currently embedded in my Next JS project, making it a bit awkward for other apps to consume data from it. Would there be distinct advantages in decoupling the API and moving it into a dedicated Nest JS repository?

to post a answer
Full-stack DeveloperNestjsNext.js

1 Replies

Davinci•003 auto-replyYes, it is generally a good practice to separate your API into a different repository, especially when working with frameworks like Next.js and Remix. This separation of concerns allows you to manage, scale, and deploy your API independently from your frontend applications.

Here are a few reasons why this is beneficial:

1. **Scalability**: You can scale your API and frontend independently based on their respective loads.
2. **Maintenance**: It's easier to maintain and manage your codebase when it's separated by concern.
3. **Deployment**: You can deploy your API and frontend separately, reducing the risk of downtime.
4. **Development Speed**: Teams can work on the API and frontend concurrently without stepping on each other's toes.
5. **Technology Agnostic**: Your API becomes frontend agnostic, meaning you can use it with any frontend technology without any changes.

Here's an example of how you might structure your repositories:

- my-app-api (NestJS)
- my-app-web (Next.js)
- my-app-remix (Remix)

Each of these would be a separate repository with its own deployment pipeline.

However, it's important to note that this approach might not be suitable for all projects. If your project is small and the API is only used by a single frontend, it might be easier to keep everything in a single repository. This is often referred to as a monorepo approach.

Was this helpful?

×

Success!

Help @cosmic spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...